ca0v / gmaps-utility-library-dev

Automatically exported from code.google.com/p/gmaps-utility-library-dev
0 stars 0 forks source link

MarkerManager and DragZoom control no work in google map ajax API. #65

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
hi,

I had use google ajax api to load google map.
however, it is not work with Marker manager and dragZoomControl.

i think this is due to when load the load sequence of both API (both
library assume something there..but no until google map api is load).

my solution is to included the google map api with is not ajax and the ajax
one. (i need to use ajax library also.)

but the only issue is it will load the same library twice.
(http://maps.google.com/intl/en_ALL/mapfiles/126d/maps2.api/main.js) which
can slow down the load of the page.

any idea ?

kiwi
----
happy hacking !

Original issue reported on code.google.com by kiwio...@gmail.com on 12 Sep 2008 at 6:51

GoogleCodeExporter commented 8 years ago
This is related to this issue:
http://code.google.com/p/gmaps-utility-library-dev/issues/detail?id=34

Randy has written a dynamic loader in a branch in the library that you can 
check out. 
The basic solution is to use dynamic script creation to load in the libraries, 
after 
the Maps API has loaded in, and to not use them until they've been loaded in 
(using 
script.onreadystate or script.onload callbacks).

Original comment by pamela.fox on 13 Sep 2008 at 5:43

GoogleCodeExporter commented 8 years ago
hi, thx for reply.

are  you mean the dynamic loading in google map api ? 

I not sure if it can load Marker manger or dragzoom control. (i think to make 
this
both work if u ajax to load map api, the map api still need to load into 
browser b4
this 2 library.. 

any idea ?

kiwi
----
happy hacking !

Original comment by kiwio...@gmail.com on 14 Sep 2008 at 12:55

GoogleCodeExporter commented 8 years ago
You can use a function like this to load in a extension script and know when 
it's done:

function getJs() {
  var script = document.createElement("script");
  script.src = "http://imagine-it.org/google/slideshowcontrol.js";

  // Firefox
  script.onload = loadMap;

  // IE
  script.onreadystatechange = function() {
    if (/loaded|complete/.test(this.readyState)) {
      loadMap();
    }
  }

document.body.appendChild(script);
}

Original comment by pamela.fox on 26 Sep 2008 at 12:54