[Google Maps API v3] google.maps.OverlayView() not working s expected

891 views
Skip to first unread message

redmeat

unread,
May 12, 2010, 7:17:32 AM5/12/10
to Google Maps JavaScript API v3
Yesterday my html file behaved correctly, this morning it doesn't. I
noticed the same is true of an online example (http://www.william-
map.com/20100416/1/map.htm) which is very similar to my own. If the
aforementioned link is opened in Firefox, and then open the Error
console (Tools > Error Console) and click the "All" tab.

The example prints various coordinates such as pixel coordinates when
the map is clicked. However, as of today no information is printed
(normally appears just below the map). the error displayed in the
firefox error console is

Error: overlay.projection is undefined
Source File: http://www.william-map.com/20100416/1/map.htm
Line: 44

This is the same error I receive in my application which also uses an
overlay to use the function fromLatLngToDivPixel. As I say, both my
example and the online example linked above worked yesterday, and now
they both suffer from the same error.

I looked at the changelog and can't see any changes more recent than
the 7th May 2010.

--
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 google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Susannah (Google Employee)

unread,
May 12, 2010, 1:28:33 PM5/12/10
to Google Maps JavaScript API v3
Hi redmeat,

You need to access the OverlayView as .getProjection(),
not .projection. Though this happened to work prior to yesterday's
release, it was never intended to be supported.

See OverlayView documentation here:
http://code.google.com/apis/maps/documentation/v3/reference.html#OverlayView

Thanks,
Susannah

Chad Killingsworth

unread,
May 12, 2010, 12:41:14 PM5/12/10
to Google Maps JavaScript API v3
overlay.projection should be overlay.getProjection()

The examples are wrong as well.

Chad Killingsworth
Reply all
Reply to author
Forward
0 new messages