guilhermegm / google-maps-utility-library-v3

Automatically exported from code.google.com/p/google-maps-utility-library-v3
Apache License 2.0
0 stars 0 forks source link

Custom map types disappear #133

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add a custom map type to your map, e.g. "OSM" (OpenStreetMap), and include 
it in a map as described in the Google Maps API Tutorial.

Expected result:
The "Earth" type appears on the side of "OSM".

Actual result:
The "Earth" type appears while the "OSM" type disappears.

Version: current?

Browser / Operating System:
Any

Additional comments:
[Enter any additional comments about the bug here.]

*********************************************************
Tip: Star this issue (next to title) to receive notifications of status
changes against this issue, also used as a gauge for how many people are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by alessand...@gmail.com on 3 Oct 2011 at 4:46

GoogleCodeExporter commented 9 years ago
I temporarily solved this way (don't know if it is the best one)

/* 
 * Do not reset the mapTypeIds (you may have custom), just push the new one in.
 */

var mapTypeIds = map.mapTypeControlOptions.mapTypeIds;
mapTypeIds.push(GoogleEarth.MAP_TYPE_ID);

var options = /** @type {google.maps.MapTypeControlOptions} */
({
    mapTypeControlOptions : {
        mapTypeIds : mapTypeIds
    }
});

map.setOptions(options);

Original comment by alessand...@gmail.com on 4 Oct 2011 at 2:20