How do create drop shadow for custom map marker icon?

6,004 views
Skip to first unread message

mp-

unread,
Dec 14, 2010, 1:31:55 PM12/14/10
to Google Maps JavaScript API v3
I'm using the new functionality of Animation (bouncing) found in
Google Maps JavaScript API v3.

http://code.google.com/apis/maps/documentation/javascript/overlays.html#MarkerAnimations

In the examples in the linked code above, the default map marker icons
have a dropshadow show on the map during the bounce.

I'm using a custom map marker icon that is a PNG.

Question: How do I create a dropshadow for my custom map marker icon
that will also be shown when doing the Animation (bounce) effect?

mp-

unread,
Dec 14, 2010, 1:35:09 PM12/14/10
to google-map...@googlegroups.com
Here is an example using the default map marker icon. 


How do I do this using a custom map marker icon that also has a drop shadow.

CroNiX

unread,
Dec 14, 2010, 1:36:13 PM12/14/10
to Google Maps JavaScript API v3
There is a shadow property for markers.
http://code.google.com/apis/maps/documentation/javascript/reference.html#MarkerOptions

On Dec 14, 10:31 am, mp- <miche...@gmail.com> wrote:
> I'm using the new functionality of Animation (bouncing) found in
> Google Maps JavaScript API v3.
>
> http://code.google.com/apis/maps/documentation/javascript/overlays.ht...

Stephan Bardubitzki

unread,
Dec 14, 2010, 1:44:18 PM12/14/10
to google-map...@googlegroups.com
Try this to create shadows for custom markers, works great:



--
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.


mp-

unread,
Dec 14, 2010, 1:45:22 PM12/14/10
to google-map...@googlegroups.com
Doesn't work.

My code below, that does show the "bounce" but not the "shadow"

--------

var marker = new google.maps.Marker({
position: point,
map:       com.example.MAP,
draggable: false,
animation: google.maps.Animation.DROP,
});

------

Any ideas why the shadow isn't working? Especially given that the animation is in fact working.

mp-

unread,
Dec 14, 2010, 1:54:47 PM12/14/10
to google-map...@googlegroups.com
Hmm, strange. I got it to work here in my example code:


But not in my real/actual code

Rossko

unread,
Dec 14, 2010, 5:46:21 PM12/14/10
to Google Maps JavaScript API v3
> shadow: 'http://cdn.example/images/shadow.png'
>
> Any ideas why the shadow isn't working?

Doesn't seem to be an image at that url
Reply all
Reply to author
Forward
0 new messages