> "markerOptions = { icon:tinyIcon };"
> Is where i tell the api to use that marker.
>
> Here is the problem, since i have more then one, how do i tell it to
> use a new one?
Seperate the objects in your mind.
a GIcon is a complete marker template for use as a marker.
It has a number of properties, including the image source.
You can make a number of different GIcons, and give them different
names;
var tinyIcon = new GIcon();
var hugeIcon = new GIcon();
and their properties can all different or just some different - like
say, the image source.
As an aside, often it's better to create a new GIcon based upon the
default icon, rather than a completely empty one. That avoids
forgetting to give it any of the obscure properties.
something = new GIcon(G_DEFAULT_ICON);
Then you go on to set the properties you want to change as before
(size,image etc)
When you create GMarkers, you must tell them which GIcon to use ; if
you don't tell it any it'll use the default red lollipop with a black
spot.
That's what the {icon: } option is doing.
Any number of GMarkers can all share the same GIcon ; a number of
others can use a different GIcon : etc.
So whatever 'thing' you will be using to decide which icon to use for
each marker, needs to set the markerOptions
if (sometest)
markerOptions = {icon : myblueicon}
else
markerOptions = {icon : myredicon}
http://econym.org.uk/gmap/example_custom.htm
> Is there a way for me to restrict the user from scrolling to map to
> far from 'where the action is'?
http://econym.org.uk/gmap/range.htm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---