Google Maps JavaScript API Example.
Last active
November 15, 2018 12:33
-
-
Save davilera/ba57d46f0765154fa360b9ef0d7399cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=TU_CLAVE_DE_API_AQUI"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOU_API_KEY_HERE"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadNelioHQMap() { | |
// Code here. | |
} | |
google.maps.event.addDomListener( window, 'load', loadNelioHQMap ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mapEl = document.getElementById( 'neliohq-map' ); | |
var mapOptions = { | |
center: new google.maps.LatLng( 41.406424, 2.192606 ), | |
disableDoubleClickZoom: true, | |
draggable : true, | |
mapTypeControl: false, | |
mapTypeId: google.maps.MapTypeId.ROADMAP, | |
panControl: true, | |
scaleControl: false, | |
scrollwheel: true, | |
streetViewControl: false, | |
overviewMapControl: true, | |
overviewMapControlOptions: { | |
opened: false, | |
}, | |
zoom: 12, | |
zoomControl: true, | |
zoomControlOptions: { | |
style: google.maps.ZoomControlStyle.DEFAULT, | |
} | |
}; | |
var map = new google.maps.Map( mapEl, mapOptions ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new google.maps.Marker({ | |
map: map, | |
position: new google.maps.LatLng( 41.406424, 2.192606 ), | |
icon: { | |
path: google.maps.SymbolPath.CIRCLE, | |
fillColor: '#80c6dd', | |
fillOpacity: 1, | |
scale: 6, | |
strokeWeight: 6, | |
strokeColor: '#80c6dd' | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mapOptions = { | |
// ... | |
styles: [{"featureType":"water","elementType":"geometry", /* ... */ }] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment