Created
October 3, 2019 07:15
-
-
Save liviucerchez/5fe782ec214835dda864a1de10534b26 to your computer and use it in GitHub Desktop.
Peter - Contact Map
This file contains 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
<div class="responsive-container no-bottom"> | |
<div class="responsive-wrapper"> | |
<div id="gmap" class="map"></div> | |
</div> | |
</div> | |
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false&key=API_KEY"></script> | |
<script> | |
jQuery(function() { | |
if (typeof(google) !== "undefined") { | |
var map_name = 'custom_gmap', | |
// set location | |
location = new google.maps.LatLng(40.796146, -73.960157), | |
// set marker position | |
marker_pos = new google.maps.LatLng(40.796146, -73.960157), | |
marker_title = 'Peter', | |
stylers = [{ | |
"featureType": "all", | |
"elementType": "all", | |
"stylers": [ { "saturation": "-80" }, { "lightness": 20 } ] | |
}], | |
mapOptions = { zoom: 12, center: location, mapTypeId: map_name, mapTypeControl: false, scrollwheel: false }, | |
map = new google.maps.Map(document.getElementById("gmap"), mapOptions), | |
styledMapOptions = { map: map, name: map_name + "_map" }, | |
marker = new google.maps.Marker({ | |
position: marker_pos, | |
map: map, | |
title: marker_title, | |
icon: 'https://liviucerchez.com/peter/wp-content/uploads/sites/18/2016/04/sample-marker.png' | |
}), | |
custommap = new google.maps.StyledMapType(stylers,styledMapOptions); | |
map.mapTypes.set(map_name, custommap); | |
map.setMapTypeId(map_name); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment