How to add animation for the markers?

96 views
Skip to first unread message

chao

unread,
Aug 8, 2012, 6:25:56 PM8/8/12
to timemap-d...@googlegroups.com
Hi Nick,
      Here me again... is there a way to add animation to the makers like 
       

goole.maps.event.addListener(item,'click', toggle);

function toggle(){
if(item.getAnimation()!=null){
item.setAnimation(null);
}else{
item.setAnimation(google.maps.Animation.BOUNCE);
}
I try to add in the timemap.js  line 1939 (around)
   
   placemark.click.addHandler(function() {
            item.openInfoWindow();
          /*  if ( placemark.item.getAnimation() != null) {
    placemark.item.setAnimation(null);
   
    else {
      placemark.item.setAnimation(google.maps.Animation.BOUNCE);
  }*/
        });

this give me an error that the object doesn't have method getAnimation, Does the placemark.item is not  Google marker object?
or is there any other way of doing this ?




}

Nick Rabinowitz

unread,
Sep 2, 2012, 6:44:21 PM9/2/12
to chao...@adaramedia.com, timemap-d...@googlegroups.com
That's correct. "items" here are TimeMapItem instances (see  http://timemap.googlecode.com/svn/tags/2.0.1/docs/symbols/TimeMapItem.html ) - basically a wrapper for the actual placemarks and their corresponding timeline Event objects. Furthermore, since TimeMap 2.0, multiple map providers are supported through the Mapstraction library, so item.placemark is actually an object from the Mapstraction library (usually mxn.Marker). To access the Google Maps marker from an item, you need to use:

var gMarker = item.getNativePlacemark();

then you should be able to do the animation as you've tried it, using gMarker.setAnimation().

-Nick

--
You received this message because you are subscribed to the Google Groups "Timemap.js Development" group.
To view this discussion on the web visit https://groups.google.com/d/msg/timemap-development/-/MgFDgLyABVEJ.
To post to this group, send email to timemap-d...@googlegroups.com.
To unsubscribe from this group, send email to timemap-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/timemap-development?hl=en.

Reply all
Reply to author
Forward
0 new messages