Dynamic Marker Image Rotation

689 views
Skip to first unread message

Matt

unread,
Aug 17, 2010, 1:49:44 AM8/17/10
to Google Maps JavaScript API v3
Hello,

I have implemented a rotating polygon that has a marker placed at each
vertex. Each marker has a custom image specified (using the
MarkerImage class). I'm looking for the best approach to dynamically
rotating each marker's image by some angle theta (as the polygon is
rotated).

One way to accomplish this would be to create a sprite image
containing the image rotated each degree, create an array
MarkerImages, and set the marker's icon to the appropriate MarkerImage
for the angle.

Any other suggestions?

Thanks,
Matt

Ben Appleton

unread,
Aug 17, 2010, 2:10:45 AM8/17/10
to google-map...@googlegroups.com
Spriting should work. Another alternative is transforms. Webkit
browsers (Safari, Chrome, iPhone/iPad) and FF3.5+ have css transforms
which are quite fast. In IE you may be able to use the VML "matrix"
transform to achieve this effect. However you'd need to write a
custom OverlayView to use these effects, so I'd start with spriting
and see how it looks.

- Ben

> --
> You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
> To post to this group, send email to google-map...@googlegroups.com.
> To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages