On Dec 1, 11:19 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to put different coloured markers on a map ...
>
>    http://rentopotamus.co.uk/map.php
>
> If I just use:
>
>    var marker1 = new GMarker(point);
>
> , it's fine, but when I use:
>
>    var marker<?= $x ?> = new GMarker(point,
> {clickable:true,icon:iconYellow});
>
> , then clicking the marker throws up an error: 'b has no properties'.
> iconYellow has previous been defined like so:
>
>    var yellowIcon = new GIcon();
>    yellowIcon.image = "/images/markeryellow.png";
>    yellowIcon.iconSize = new GSize(20, 34);
>    yellowIcon.iconAnchor = new GPoint(9, 34);

If you want to open an infoWindow on a custom marker, the
infoWindowAnchor property is required:
http://code.google.com/apis/maps/documentation/reference.html#GIcon

  -- Larry

>
> This is the addListener code that I'm using:
>
> GEvent.addListener(marker1, "click", function()
> { marker1.openInfoWindowHtml("blah blah blah");
>
> });
>
> The coloured markers do show on the page, so I assume I'm loading the
> icons correctly. If I don't set a custom icon, the markers can be
> clicked without any error
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to