user6493966
user6493966

Reputation: 73

how to create google maps custom marker which has an animating gif

I want to create a google map marker which has an animating gif.I know google maps has 2 animation drop and bounce.I want to create one except those.Is is possible to do this. Could you lead a way?

Thanks in advance.

Upvotes: 0

Views: 806

Answers (1)

Ivan Jovović
Ivan Jovović

Reputation: 5298

Per docs, in google.maps.MarkerOptions you can pass optimized: false if you want to use gif as marker icon:

optimized Type: boolean

Optimization renders many markers as a single static element. Optimized rendering is enabled by default. Disable optimized rendering for animated GIFs or PNGs, or when each marker must be rendered as a separate DOM element (advanced usage only).

var marker = new google.maps.Marker(
{
    position: myLatLng,
    map: map,
    optimized: false,
    icon: "http://preloaders.net/preloaders/489/Classic%20map%20marker-32.gif"
});

JS fiddle: http://jsfiddle.net/T78Hd/138/

Upvotes: 1

Related Questions