Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting marker animation modes #197

Closed
WillDonohoe opened this issue Sep 1, 2015 · 1 comment
Closed

Setting marker animation modes #197

WillDonohoe opened this issue Sep 1, 2015 · 1 comment

Comments

@WillDonohoe
Copy link

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

@WillDonohoe WillDonohoe changed the title Setting the marker animation modes Setting marker animation modes Sep 1, 2015
@ebidel
Copy link
Contributor

ebidel commented Sep 1, 2015

Right now, I think you'd have to loop over the marker elements and set:

markerEl.marker.setAnimation(google.maps.Animation.DROP);

If you want to propose a PR that adds an animation property, that might be a good addition.

@ebidel ebidel closed this as completed in 42b4158 Sep 25, 2015
ebidel added a commit that referenced this issue Sep 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants