Question

I just discovered the library MarkerManager and I'm trying to use it for my map.

Basically, here is the part which is not working:

google.maps.event.addDomListener(window, 'load', initialize);

//-- Function called when the body is loaded --//
function initialize() {
var myOptions = {
    minZoom: 12,
    mapTypeId: google.maps.MapTypeId.ROADMAP
};
    map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);

    var bounds = new google.maps.LatLngBounds(new google.maps.LatLng(48.81,2.249), new google.maps.LatLng(48.903,2.416));
    map.fitBounds(bounds);


    mmng = new MarkerManager(map);

    google.maps.event.addListener(mmng, 'loaded', function() {
        var marker = new google.maps.Marker({
    position: initial_center,
    icon: "img/m1.png",
    title: "GO"
    });

    mmng.addMarkers(new Array(marker));
    alert("test1");
    mmng.refresh();
    alert("test2");
});

I get the alert "test1" but not the "test2" and the code after that is not executed...

Looks like the refresh methode won't work... Do you have any explaination ?

Thomas

EDIT: Ok it's solved it was just that the Markermanager library was not loaded yet when I used it... :)

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top