YnJin1010 / 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

In GoogleEarth.prototype.addEarthMapType the Users custom mapTypes are removed. #258

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Class-googleearth

In GoogleEarth.prototype.addEarthMapType the Users custom mapTypes are removed. 
See code below.

 var options = /** @type {google.maps.MapTypeControlOptions} */({
   mapTypeControlOptions: {
     mapTypeIds: [google.maps.MapTypeId.ROADMAP,
                  google.maps.MapTypeId.SATELLITE,
                  GoogleEarth.MAP_TYPE_ID]
   }
 });
 map.setOptions(options);

What steps will reproduce the problem?
1. Register your own map types before creating the GoogleEarth instance.

Expected result:
Earth map type included at the end of the maptypeslist

Actual result:
only the the maptypes in
 [google.maps.MapTypeId.ROADMAP,
                  google.maps.MapTypeId.SATELLITE,
                  GoogleEarth.MAP_TYPE_ID]

Additional comments:
Why not just push the new maptype?
My patch to fix this issue.

Index: googleearth.js
===================================================================
--- googleearth.js  (revisão 434)
+++ googleearth.js  (cópia de trabalho)
@@ -129,17 +129,8 @@
   });

   map.mapTypes.set(GoogleEarth.MAP_TYPE_ID, earthMapType);
+  map.mapTypeControlOptions.mapTypeIds.push(GoogleEarth.MAP_TYPE_ID); 

-  var options = /** @type {google.maps.MapTypeControlOptions} */({
-    mapTypeControlOptions: {
-      mapTypeIds: [google.maps.MapTypeId.ROADMAP,
-                   google.maps.MapTypeId.SATELLITE,
-                   GoogleEarth.MAP_TYPE_ID]
-    }
-  });
-
-  map.setOptions(options);
-
   var that = this;
   google.maps.event.addListener(map, 'maptypeid_changed', function() {
     that.mapTypeChanged_();

Original issue reported on code.google.com by Heitor.Z...@gmail.com on 22 May 2013 at 2:55