Hello!
I am writing fix which will allow to hide\show groups of markers like here http://www.fisgonia.com/
I already push to JS map configuration marker category setting:
$newmarker['category'] = 'cat_0';
in gmap_location.module
What look for is the best method + some example how to write function within existing gmap.js file which will hide\show groups of markers and which can be called from drupal page, which contains map.
Thank you!
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | gmap_markertypes.module.txt | 728 bytes | thtas |
| #2 | gmap_markertypes.js_.txt | 2.04 KB | thtas |
Comments
Comment #1
zanhsieh commentedHi,
I think it would be better if:
1. gmap addon module installed and gmap_markerlist has been turn on
2. take a close look gmap_markerlist.js
The workflow on http://www.fisgonia.com could be simplified to:
1. When a marker has been created, push to a key pair 2d array.
2. When toggling on and off, it call (marker instance).show() or (marker instance).hide(), depends on (marker instance).isHidden().
So supposed you have gmap_markerlist installed and enabled, change gmap_markerlist.js line 21 from:
obj.change('clickmarker', -1, marker);
to
//obj.change('clickmarker', -1, marker);
(marker.marker.isHidden())?(marker.marker.show()):(marker.marker.hide());
When you click the users on list, they will disappear and re-appear. So if you would like to change the position of the list, change G_ANCHOR_TOP_RIGHT.
I also work on this issue but my scope is difference with yours. My problem is: How to go along with other third party marker managers? http://www.fisgonia.com and other official example from google do not detect / handle the marker references (the one they push in to an array) out of current viewing map, which means, from my understanding, either their performance will be slow (load all markers at once) or they will have memory leak (no out-of-scope marker deletion implementation).
Comment #2
thtas commentedI have achieved the same thing by making modifications to the gmap_markers module.
Firstly i added the marker type to each marker based on the marker nid,
then in the javascript i added a function to toggle all markers of a particular type.
Also instead of creating a marker list of each marker, it just creates a marker list of each marker type.
code attached.
It's by no means pretty, but it seems to work.
Comment #3
johnvClosing this very old issue. Please reopen if it is still valid.