Skip to content

Setting marker animation modes #197

@WillDonohoe

Description

@WillDonohoe

Hi guys,

I'm looking to add a drop animation (google.maps.Animation.DROP) when a new pin is created using the google-map-marker element:

<google-map id="map" latitude="{{lat}}" longitude="{{lng}}" zoom="{{zoom}}">
  <template is="dom-repeat" items="{{points}}">
    <google-map-marker id="{{item.id}}" click-events latitude="{{item.lat}}" longitude="{{item.lng}}"></google-map-marker>
  </template>
</google-map>

I can't find a way to change the animation type without creating the marker programmatically using new google.maps.Marker().

var marker = new google.maps.Marker({
  map: this.$.map.map,
  position: {
    lat: lat,
    lng: lng
  },
  animation: google.maps.Animation.DROP
});

This solution adds a lot more complexity to my application though.

What would be your recommended solution for adding animations to markers?

Many thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions