Allow selection of Marker Animation

Created on 21 March 2023, over 1 year ago
Updated 27 April 2023, over 1 year ago

While working on a project which used the google_map_field to display location information on a Google map, one of the requirements was to allow the user to select a different animation on a field value basis.

Work based on similar ticket, for example #1930424: How to add animation to Gmap Markers? .

Documentation on Google Maps:
https://developers.google.com/maps/documentation/javascript/examples/mar...

Everything seems to boil down to the instantiation of the Marker, at:
https://git.drupalcode.org/project/google_map_field/-/blob/2.0.x/js/goog...

where we would be adding a line to call a different animation.

All that combined with providing a back-end for users to select which animation to use for a given map.
 

Any feedback, advice, help or suggestions would be greatly appreciated.
Thanks in advance.

Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇫🇷France dydave

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dydave
  • Status changed to Needs review over 1 year ago
  • 🇫🇷France dydave

    Quick follow-up on this ticket:

    Please find attached corresponding patch:
    3349401-2-google_map_field-add-marker-animation.patch

    Which pretty much replicates what the marker icon does, except it adds a dropdown field with 3 values: None, Drop and Bounce, which are the only 3 available animations at the moment.

    Any feedback, advice, reviews or testing would be greatly appreciated.
    Thanks in advance.

  • 🇵🇱Poland bronismateusz

    Not working for me:
    SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_map_marker_animation' in 'where clause': SELECT 1 AS "expression" FROM "node_revision__field_map" "t" WHERE ("field_map_name" IS NOT NULL) OR ("field_map_lat" IS NOT NULL) OR ("field_map_lon" IS NOT NULL) OR ("field_map_zoom" IS NOT NULL) OR ("field_map_type" IS NOT NULL) OR ("field_map_width" IS NOT NULL) OR ("field_map_height" IS NOT NULL) OR ("field_map_marker" IS NOT NULL) OR ("field_map_traffic" IS NOT NULL) OR ("field_map_marker_icon" IS NOT NULL) OR ("field_map_marker_animation" IS NOT NULL) OR ("field_map_controls" IS NOT NULL) OR ("field_map_infowindow" IS NOT NULL) LIMIT 1 OFFSET 0; Array ( )

  • 🇫🇷France dydave

    Hi @bronisMateusz,

    Thanks a lot for your prompt feedback and for testing the patch.

    Re #3:
    Did you try running database updates after applying the patch?
    Could you please try applying the patch, then flushing the cache and running DB updates?
    `drush cr`, `drush updb`, after applying the patch.

    We hope we were able to answer your question, but feel free to let us know if you encounter more issues while testing the patch or have more questions or comments on the suggested patch or any aspects of this ticket in general, we would surely be glad to help.
    Thanks again very much for your help testing and reviewing the patch.

Production build 0.71.5 2024