Last active
November 1, 2017 11:25
-
-
Save koanvl/d8ce84120fe780efeaf4cf4d80d9ca76 to your computer and use it in GitHub Desktop.
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
//GOOGLE MAPS API | |
//js | |
if (document.getElementById('map-canvas')){ | |
var myLatlng = new google.maps.LatLng(49.5282699, 29.9455942); | |
var mapOptions = { | |
zoom: 15, | |
center: myLatlng | |
} | |
var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); | |
var marker = new google.maps.Marker({ | |
position: myLatlng, | |
title:"REVOCANDA" | |
}); | |
// To add the marker to the map, call setMap(); | |
marker.setMap(map); | |
// Editable string with html markup for tooltip content | |
var contentString = '<div class="map-content">'+ | |
'<div id="siteNotice">'+ | |
'<h3 id="firstHeading" class="map-heading">REVOCANDA</h3>'+ | |
'</div>'+ | |
'<div class="map-markup-description">'+ | |
'<p>пгт. Володарка, ул. Заречная, 98'+ | |
'<p>+38 (097) 615 43 97</p>'+ | |
'<p>+38 (093) 214 48 55</p>'+ | |
'</div>'+ | |
'</div>'; | |
var infowindow = new google.maps.InfoWindow({ | |
content: contentString | |
}); | |
// open tooltip on load | |
infowindow.open(map, marker); | |
google.maps.event.addDomListener(window, "resize", function() { | |
var center = map.getCenter(); | |
google.maps.event.trigger(map, "resize"); | |
map.setCenter(center); | |
}); | |
//html | |
<div class="map-container"> | |
<div id="map-canvas"></div> | |
</div> | |
//sass | |
/*map*/ | |
.map-container | |
position: relative | |
padding-top: 70% | |
width: 100% | |
margin: 0 auto | |
#map-canvas | |
position: absolute | |
width: 100% | |
height: 100% | |
top: 0 | |
.map-markup-description | |
p | |
margin: 5px 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment