Nice!
Here is the code (the JS script is not loaded in the <head> tag
anymore) :
google.setOnLoadCallback(getJs);
function getJs() {
var script = document.createElement("script");
script.src = "http://gmaps-utility-library.googlecode.com/svn/
trunk/markermanager/1.1/src/markermanager.js";
// Firefox
script.onload = initMap;
// IE
script.onreadystatechange = function() {
if (/loaded|complete/.test(this.readyState)) {
initMap();
}
}
document.body.appendChild(script);
}
function initMap()
{
if(google.maps.BrowserIsCompatible())
{
map = new
google.maps.Map2(document.getElementById('map'));
...
}
}
Now I can use the "MarkerManager" with its functions like
"removeMarker" (the GMarkerManager does not have this function...)
Best regards,
Vincent
On 29 mar, 15:24, Rossko <[email protected]> wrote:
> > But I don't know where to call the getJs() to load both two scripts
> > (AJAX api
> > and marker manager)
>
> You could create a chain.
> This function of yours -
> function init()
> {
> google.load("maps", "2");
> google.setOnLoadCallback(initMap);
> }
> loads the maps API, and when it has been loaded, calls initMap().
> You could change that so that the OnLoadCallback called Pamela's
> getJs() instead, to load the MarkerManager.
> google.setOnLoadCallback(getJs);
> Obviously you'd need to change getJs() so that it loads the script you
> want.
> Next, you'd also need to alter getJs() so that after the script you
> want has been loaded, it calls the next thing you want to happen in
> the chain - in this case initMap() I suppose.
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-api?hl=en.