Skip to content

Instantly share code, notes, and snippets.

@Quinten
Created June 17, 2013 13:04
Show Gist options
  • Save Quinten/5796705 to your computer and use it in GitHub Desktop.
Save Quinten/5796705 to your computer and use it in GitHub Desktop.
implement a google map (js) fast
<div class="contact-map">
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false&amp;language=nl"></script>
<script type="text/javascript">// <![CDATA[
function initialize() {
var myLatlng = new google.maps.LatLng(51.2074746, 3.2263338000000203);
var mapOptions = {
zoom: 16,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var contentString = '<div id="content">'+
'<div id="siteNotice">'+
'</div>'+
'<h1 id="firstHeading" class="firstHeading">Mille fleurs</h1>'+
'<div id="bodyContent">'+
'<p>Wollestraat 33<br />8000 Brugge</p>'+
'</div>'+
'</div>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Mille Fleurs'
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
}
google.maps.event.addDomListener(window, 'load', initialize);
// ]]></script>
<div id="map-canvas" style="width: 470px; height: 350px;">&nbsp;</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment