mapTypeControlOptions bug

75 views
Skip to first unread message

Gabriel Svennerberg

unread,
Jun 23, 2009, 4:36:16 AM6/23/09
to Google Maps JavaScript API v3
I've dabbled some with the properties of the map object and found that
the mapTypeControlOptions doesn't seem to work. No matter what I set
it to it seem to have the default behavior.

See an example of this at http://www.svennerberg.com/examples/google_maps_3/mapTypeControlOptions.html

Is anyone else experiencing this same problem?

pamela (Google Employee)

unread,
Jun 23, 2009, 9:19:25 AM6/23/09
to google-map...@googlegroups.com
Hey Gabriel-

Looks like a bug. Does it work if you disable the default UI?

- pamela

Gabriel Svennerberg

unread,
Jun 23, 2009, 9:28:50 AM6/23/09
to Google Maps JavaScript API v3
No, I've tried that and it didn't work either.

pamela fox

unread,
Jun 23, 2009, 9:29:24 AM6/23/09
to google-map...@googlegroups.com
Okay, please file a bug in the issue tracker.

Andronicus Riyono

unread,
Jun 23, 2009, 9:34:32 AM6/23/09
to google-map...@googlegroups.com
> I've dabbled some with the properties of the map object and found that
> the mapTypeControlOptions doesn't seem to work. No matter what I set
> it to it seem to have the default behavior.

seems that you should pass an object with style property:

mapTypeControlOptions: {style:
google.maps.MapTypeControlStyle.DROPDOWN_MENU},

found at: http://code.google.com/apis/maps/documentation/v3/examples/control-options.html

Regards,
Nick

--
---------------------------------------------
There's nothing impossible for an open mind
---------------------------------------------

pamela (Google Employee)

unread,
Jun 23, 2009, 9:35:52 AM6/23/09
to google-map...@googlegroups.com
Thanks, Nick, good catch. I think I'll head to sleep now. :)

- pamela

Gabriel Svennerberg

unread,
Jun 23, 2009, 10:01:29 AM6/23/09
to Google Maps JavaScript API v3
Aha, that makes sense and work. Thanks for the clarification.

I see now in the documentation what confused me. mapTypeId is passed
like:

'mapTypeId: google.maps.MapTypeId.ROADMAP

while mapTypeControlOptions, scaleControlOptions and
navigationControlOptions are passed in a different way even though
they otherwise look similar.

I think that the last three are implemented the right way and
mapTypeId kind of wrong. Anyway, to avoid confusion maybe they should
all work the same way, one way or the other.

Gabriel Svennerberg

unread,
Jun 23, 2009, 10:08:25 AM6/23/09
to Google Maps JavaScript API v3
Me again. Forget what I just wrote about making them all work the same
way.

I see now that everything works just fine, just the way it should.
It's me being somewhat confused. Sorry!

Thanks for you help!

Best regards,
Gabriel

pcsg

unread,
Jun 23, 2009, 4:49:53 PM6/23/09
to Google Maps JavaScript API v3
hey, btw

I can not change the mapTypeControl if the map object initialized

map.setOptions( {
mapTypeControlOptions: {
style:
google.maps.MapTypeControlStyle.DROPDOWN_MENU
}
} );


is this a bug or should be,

thx

Greeting mor

Gabriel Svennerberg

unread,
Jun 24, 2009, 1:09:55 AM6/24/09
to Google Maps JavaScript API v3
I have also noticed that setOptions() doesn't work on all properties.
I've done some testing, and here's the result:

Properties it works with

draggable
keyboardShortcuts
center
zoom
mapTypeId

Properties it doesn't work with

backgroundColor
draggableCursor
draggingCursor
disableDefaultUI
mapTypeControl
mapTypeControlOptions
scaleControl
scaleControlOptions
navigationControls
navigationControlOptions

Properties I couldn't test

noClear
noResize


Among these I also can't get draggableCursor and draggingCursor to
work upon initialization.

Cheers,
Gabriel

pcsg

unread,
Jun 24, 2009, 8:38:42 AM6/24/09
to Google Maps JavaScript API v3

the same results in my tests


On Jun 24, 7:09 am, Gabriel Svennerberg <gabr...@svennerberg.com>
wrote:

Gabriel Svennerberg

unread,
Jun 26, 2009, 3:03:34 AM6/26/09
to Google Maps JavaScript API v3
Question to the API team:

How is setOptions() supposed to work. Are the above mentioned
shortcomings bugs or isn't the method supposed to be able to change
all of the properties?

pamela (Google Employee)

unread,
Jun 30, 2009, 6:27:57 PM6/30/09
to google-map...@googlegroups.com
I've confirmed that those options are not having an effect after
initialization. It may be that some properties will be
"initialization-only", in which case we'll need to indicate that in
the reference. But I think there are certainly a good number of those
that should be settable after initialization as well. I'll discuss
with the team.

- pamela
Reply all
Reply to author
Forward
0 new messages