Hello, I'm using a simple js script which loads a map and then every 3
seconds it places 2 markers always in the same positions.
Now the script works but after a certain amount of minutes it becomes quite
impossible to navigate the map cause it seems that the map is beginning to
freeze...
And the more time passes away the worst the situation becomes, cause the map
gets quite totally frozen.
I can't understand where is the problem.
Here's the function I start onloading :
function place() {
var myLatlng = new google.maps.LatLng(41.893056, 12.482778);
var myLatlng2 = new google.maps.LatLng(43.893056, 13.482778);
var myOptions = {
zoom: 8,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new
google.maps.Map(document.getElementById("map_canvas"),myOptions);
var id = setInterval(temp, 3*1000);
function temp() {
var marker = new google.maps.Marker({position: myLatlng,
title:"Home sweet home!"});
var marker2 = new google.maps.Marker({position: myLatlng2,
title:"Home sweet home 2!"});
marker.setMap(map);
marker2.setMap(map);
}
}
Is this problem normal? How can i solve it?
Thanks in advance for the help.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.