javascript - mapseasy.com embed google maps with multiple locations -
i successful embedding google maps api "mapseasy.com" script.
but generator has info 1 location... need utilize map , have multiple locations.
notice: http://mesgolf.com/course-flyover.php
i add together pin... know how accomplish this?
current js is:
function loadgmaps() { var mylatlng = new google.maps.latlng(40.6094825,-73.7280392); var myoptions = { zoom: 10, center: mylatlng, disabledefaultui: true, navigationcontrol: false, maptypecontrol: false, streetviewcontrol: false, maptypeid: google.maps.maptypeid.roadmap } var map = new google.maps.map(document.getelementbyid("mygmaps"), myoptions); var marker = new google.maps.marker({ position: mylatlng, map: map, title:"lawrence yacht & country club" }); var infowindow = new google.maps.infowindow({ content: "<strong>lawrence yacht & country club</strong><br /><a href=\"https://www.youtube.com/watch?v=7u5kictb1qs\" target=\"_blank\" style=\"text-decoration:underline; color:#2a5b2a;\">view course of study flyover</a><br /><br />" }); google.maps.event.addlistener(marker, "click", function() { infowindow.open(map, marker); }); } i give long/lat illustration of location: 40.65063,-73.528508
the html looks this:
<div id="mygmaps" style="width:100%;height:100%; position:absolute;"></div>
see documentation of google maps javascript api v3 on markers
var marker2 = new google.maps.marker({ position: new google.maps.latlng(40.65063,-73.528508), map: map, title:"marker 2" }); var infowindow2 = new google.maps.infowindow({ content: "<strong>marker 2</strong><br />more information<br /><br />" }); google.maps.event.addlistener(marker2, "click", function() { infowindow2.open(map, marker2); }); working fiddle
javascript google-maps maps
No comments:
Post a Comment