api - How to display markers in groundOverlay map? -
i can manage display image overlay on map. new problem occurs - can't add marker on it. googled while no luck. tried search , mimic example on documentation , nothing appears right.
here's code :
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script> function initialize() { var newark = new google.maps.latlng(xx.xxxxx,xx.xxxxx); var imagebounds = new google.maps.latlngbounds( new google.maps.latlng(xx.xxxxx,xx.xxxxx),//sw new google.maps.latlng(xx.xxxxx,xx.xxxxx)//ne ); var mapoptions = { zoom: 20, center: newark, maptypeid: google.maps.maptypeid.roadmap } var map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); var oldmap = new google.maps.groundoverlay( 'images/floor_plan_trans_rotated.gif', imagebounds); oldmap.setmap(map); } /*markers*/ var contentstring = '<div id="content">'+ '<div id="sitenotice">'+ '</div>'+ '<h1 id="firstheading" class="firstheading">uluru</h1>'+ '<div id="bodycontent">'+ '<p><b>uluru</b>, referred <b>ayers rock</b>, large ' + 'sandstone rock formation in southern part of '+ 'northern territory, central australia. lies 335 km (208 mi) '+ 'south west of nearest large town, alice springs; 450 km '+ </p>'+ '<p>attribution: uluru, <a href="http://en.wikipedia.org/w/index.php?title=uluru&oldid=297882194">'+ 'http://en.wikipedia.org/w/index.php?title=uluru</a> '+ '(last visited june 22, 2009).</p>'+ '</div>'+ '</div>'; var infowindow = new google.maps.infowindow({ content: contentstring, maxwidth: 400 }); var marker = new google.maps.marker({ position: newark, map: map, title: 'uluru (ayers rock)' }); google.maps.event.addlistener(marker, 'click', function() { infowindow.open(map,marker); }); } /*markers*/ google.maps.event.adddomlistener(window, 'load', initialize); </script> <div id="map-canvas"></div>
for code above. map not display unless delete lines between /markers/.
please suggest. regards,
isn't there } above first /markers/ on code ? or maybe i'm sleepy....
i'm doing similar , working, groundoverlay , marker on same map
Comments
Post a Comment