You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Maps JavaScript API v3
Hi,
Is it possible to specifiy a css class name for a Marker which can be
used for the icon displayed on the map rather than defining a
MarkerImage class?
I have a sprite containing the icons I require for various markers and
class names in a css file which defines each icon in terms of where
the image is located in the sprite file.
I hope this makes sense!
Thanks,
Rob
Pil
unread,
Nov 29, 2010, 9:38:10 AM11/29/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Maps JavaScript API v3
You can do that by using an API markerImage:
var g = google.maps;
var image = new g.MarkerImage("sprite-icons.png",
new g.Size(20, 34),
new g.Point(0, 34), <-- this are the sprite coords
new g.Point(10, 34));
parky128
unread,
Nov 29, 2010, 9:52:44 AM11/29/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Maps JavaScript API v3
Yes but as per my question, I dont want to use the MarkerImage class,
I want to know if I can specify a css class name against a Marker
object where it will retrieve the image to use.
peanut
unread,
Dec 1, 2010, 9:00:31 AM12/1/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-map...@googlegroups.com
You may be able to use Marc Ridey's Label class to do what you want.
You can basically bind the label to a marker and add the label to the map with or without the marker. I have successfully used this with css classes. None of the css classes had images tho.