Hi

First of all, this module is just amazing.

Google Maps V3 has animation properties and I would like to use those for my website. I would like to drop markers on the map instead of just appearing it on map. Reference for this functionality is http://www.ksturnpike.com/travel_information/kta_map_weather#service_areas

I tried to find where marker is intialized and apparently the only file with code new google.maps.Marker is overlay_edit.js.
I added the line animation: google.maps.Animation.DROP, so that marker initialization looks like

var p = new google.maps.Marker({
                position: point, 
                animation: google.maps.Animation.DROP,
                map: obj.map,
                icon: Drupal.gmap.getIcon(m, obj._oe.markerseq[m]).ra
              });

However code is still not making markers drop. Is there anything I am missing? OR Am I doing anything wrong?

CommentFileSizeAuthor
#4 gmap_1930424_4_animation.patch1.57 KBjohnv

Comments

podarok’s picture

Version: 7.x-2.4-beta4 » 7.x-2.4

proper version

johnv’s picture

Title: Gmap Marker properties » How to add animation to Gmap Markers?
louis8789’s picture

If you're using the default gmap marker manager a simple line in "gmap/js/maker.js" should do the trick

line 22

marker.opts.position = new google.maps.LatLng(marker.latitude, marker.longitude);
marker.opts.map = obj.map;
marker.opts.animation = google.maps.Animation.DROP; // This should do it
johnv’s picture

Version: 7.x-2.4 » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new1.57 KB

@louis8789, thanks for the tip.

Attached patch adds this functionality to the settings of the Gmap style plugin. The value is copied automatically to "gmap/js/marker.js", so there is no need anymore to patch that file.

Some delay per marker (using setTimeout) might be a nice extra feature.

podarok’s picture

Component: User interface » gmap_plugin_style_gmapextended.inc
Assigned: Unassigned » johnv
Category: support » task
Priority: Normal » Critical
Status: Needs review » Needs work

#4 commited pushed to dev
this one needs reroll against gmapextended style

mustanggb’s picture

Issue summary: View changes

Has anyone worked out how to delay the markers until after the map has loaded?