i’ve tried using google maps marker manager, but i seem to be hitting a brick wall everytime, i follow the tutorials on how to create markermanager on google documentation, but it seems nothing is working for me, is it a problem in how my code is written? running out of ideas here, at the moment i have set ONE marker to drop down on the map based on latlng.
can someone please try like implementing the tutorial code and find a working solution for me? its driving me mad.
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<div id="map_canvas" style="width:500px; height:500px;"></div>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
@*<script src="../../Scripts/markermanager.js" type="text/javascript"></script>*@
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP // map view, can be set to satellite, street, roadview, aerialview
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({
position: latlng,
map: map,
animation: google.maps.Animation.DROP,
title: "Uluru (Ayers Rock)"
});
marker.setMap(map);
}
$(document).ready(function () {
initialize();
});
</script>
Here is an example to get you started:
Notice that when creating a marker, I did not specify
map: mapormarker.setMap(map). Instead, the markers are added to the marker manager which in turn adds them to the map when you callmarkermanager.refresh().Also note that I’ve added all markers on the zoom level
0. Ideally you should load few markers on lower zoom levels and more markers on higher zoom levels.