The mapTypeIds property expects either a string or a normal array - not an MVCArray object.
Change line 16 to: var mapTypes = new Array(); Chad Killingsworth On Mar 25, 1:48 pm, Gabriel Svennerberg <[email protected]> wrote: > I don't know if this is a bug or if I just don't understand how this > is supposed to work. I'm trying to set what mapTypes that will be > available in the mapTypeControl. > > Here's the code I'm using for defining the MapOptions object. > > // Creating a MVCArray that will contain the maptypes > // that will be available in mapTypeControl > var mapTypes = new google.maps.MVCArray(); > mapTypes.push(google.maps.MapTypeId.HYBRID); > mapTypes.push(google.maps.MapTypeId.ROADMAP); > > var options = { > zoom: 3, > center: new google.maps.LatLng(37.09, -95.71), > mapTypeId: google.maps.MapTypeId.ROADMAP, > mapTypeControl: true, > mapTypeControlOptions: { > style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, > mapTypeIds: mapTypes > } > > }; > > If I use the default mapTypeControl nothing is displayed and when I > change it to DROPDOWN_MENU it's displayed but only contains > "undefined". > > Am I doing this wrong or is it a bug in the API? > > Se the full example athttp://www.svennerberg.com/test/mapTypeIds.html > > Thanks! > Gabriel -- 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.
