It took me a few ticks to figure this out myself (had checked here
first). Anyways, it seems, to me, that the documentation for scaling
an icon is backwards:
"...To scale the image, whether sprited or not, set the value of
scaledSize to the size of the whole image and set size, origin and
anchor in scaled values..."
I never got this to work properly, but if I do the opposite, set Size
to the actual size ans scaledSize to the on map size, everything works
as I expect. Example where var m is a google.maps.Marker
var image = new google.maps.MarkerImage(
//Path to the image
'styles/images/default.png',
//Image size
new google.maps.Size(32,32),
//Origin, leave 0,0 if not a sprite image
new google.maps.Point(0,0),
//anchor, leave 0,32 if not a sprite image
new google.maps.Point(0, 32),
//The size the image appears on the map
new google.maps.Size(16,16)
);
m.setIcon(image);
Well, I hope this helps with the mini map and with others trying to
scale their icons.
--
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.