Thank you kindly for pointing that out, my mistake.
I've fixed the code at http://www.calvert.ch/geodesix/offices.htm as
per your suggestion and it works perfectly.

I made the erroneous (but presumably forgivable) assumption that as
CreateMarker implicitly creates a MarkerShape based on the icon, it
would also do so when I later used setIcon on the marker.

Might it be worthwhile to point this out in the documentation, under
setIcon?

For those that might fall on this later, be aware that there is no
object google.maps.MarkerShape; a MarkerShape is just a regular JS
object, created like this:
        var shape = {
                "coord": [0, 0, width, height],
                "type": 'rect'
        };
(This becomes apparent when you note that MarkerShape has no
constructor.)

Thanks again and best regards,
Maurice

On Sep 23, 9:06 pm, Rossko <[email protected]> wrote:
> > The icon is originally 75 pixels wide, scaled down here. It appears
> > that Chrome (or the GoogleMaps javascript?) is using the original icon
> > size for hit testing.
>
> Yes, it is doing what you tell it to.
> Your CreateMarkers() makes a MarkerImage object , with a 75x61
> image.
> When you create actual markers, that is used as the marker icon.
> No shape is given in the marker constructor options, so markers will
> be created with 75x61 clickable shape by default.
> Later on, you call onZoomChanged(), which uses the marker's .setIcon
> method to change the image.
> That doesn't change the clickable shape, which is left at the original
> 75x61
>
> You might want to investigate the .setShape method and MarkerShape
> object

-- 
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 [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-js-api-v3?hl=en.

Reply via email to