how to access Drupal.gmap methods

View: New views
3 Messages — Rating Filter:   Alert me  

how to access Drupal.gmap methods

by Hans Langouche-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there,

I'm using the drupal gmap module to display some maps and markers.  Now
I want to extend the functionality with some ajax stuff and I'm having
difficulties understanding the javascript Drupal.gmap object.

I figured out how to access the google maps object:
var m = Drupal.gmap.getMap('yourmapid');
googleobject = m.map

Now when looking at the code, I see there are some interesting marker
functions defined already in marker.js (and gmap_markers.js).  My
question is how to access these functions as I always get a not defined
error.

m.addmarker(...);
or
m.clearmarkers();

throw above error.

Tnx,

HnLn

Re: how to access Drupal.gmap methods

by ufukbay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Tue, Oct 13, 2009 at 1:37 PM, Hans Langouche <hans.langouche@...> wrote:
Hi there,

I'm using the drupal gmap module to display some maps and markers.  Now I want to extend the functionality with some ajax stuff and I'm having difficulties understanding the javascript Drupal.gmap object.

I figured out how to access the google maps object:
var m = Drupal.gmap.getMap('yourmapid');
googleobject = m.map

Now when looking at the code, I see there are some interesting marker functions defined already in marker.js (and gmap_markers.js).  My question is how to access these functions as I always get a not defined error.

m.addmarker(...);
or
m.clearmarkers();

throw above error.

Tnx,

HnLn


try map.change('EVENT', -1, data);
e.g. mapchange('addmarker', -1, markerObject);
-1 means execute all addmarker hooks of the map.

Re: how to access Drupal.gmap methods

by Hans Langouche-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tnx, that did the trick :-), was wondering how to execute all those hooks.

HnLn

ufuk bayburt wrote:


On Tue, Oct 13, 2009 at 1:37 PM, Hans Langouche <hans.langouche@...> wrote:
Hi there,

I'm using the drupal gmap module to display some maps and markers.  Now I want to extend the functionality with some ajax stuff and I'm having difficulties understanding the javascript Drupal.gmap object.

I figured out how to access the google maps object:
var m = Drupal.gmap.getMap('yourmapid');
googleobject = m.map

Now when looking at the code, I see there are some interesting marker functions defined already in marker.js (and gmap_markers.js).  My question is how to access these functions as I always get a not defined error.

m.addmarker(...);
or
m.clearmarkers();

throw above error.

Tnx,

HnLn


try map.change('EVENT', -1, data);
e.g. mapchange('addmarker', -1, markerObject);
-1 means execute all addmarker hooks of the map.