Thanks Enoch. I now check for the property tileSize which is required for map types. (Previously I looked for the name property.)
So it seems I can use these two possibilities var mts = map.mapTypes; for (var prop in mts) { if (mts[prop].tileSize) ... and for (var prop in mts) { if (mts[prop].hasOwnProperty("tileSize")) ... On Nov 25, 11:22 am, "Enoch Lau (Google Employee)" <enoch...@google.com> wrote: > When you do: > > for (var prop in mts) { > > } > > inside the for loop, you should check: > > if (mts.hasOwnProperty(prop)) { > } > > The reason is that due to changes in how the Maps API does "inheritance" in > JS, the variable prop can take on the string value 'constructor', which is > not a map type. > > Enoch > > > > > > > > On Friday, November 23, 2012 10:07:37 PM UTC+11, Pil wrote: > > > Checked a bit closer: This happens only when using the newest Chrome > > and Firefox on Linux. > > > However, already found a workaround. Thanks. -- 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-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.