Changeset 5504
- Timestamp:
- 12/18/07 20:33:20 (1 year ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Layer/Google.js (modified) (1 diff)
- trunk/openlayers/tests/Layer/test_Google.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Layer/Google.js
r5228 r5504 160 160 setMapType: function() { 161 161 if (this.mapObject.getCenter() != null) { 162 163 // Support for custom map types. 164 if (OpenLayers.Util.indexOf(this.mapObject.getMapTypes(), 165 this.type) == -1) { 166 this.mapObject.addMapType(this.type); 167 } 168 162 169 this.mapObject.setMapType(this.type); 163 170 this.map.events.unregister("moveend", this, this.setMapType); trunk/openlayers/tests/Layer/test_Google.html
r4299 r5504 86 86 } 87 87 88 function test_Layer_Google_setMapType (t) { 89 if (validkey) { 90 t.plan(3); 91 var layer = new OpenLayers.Layer.Google('Goog Layer'); 92 layer.map = {'events':{'unregister': function() {}}}; 93 layer.loadMapObject(); 94 layer.mapObject.getCenter= function() { return true; } 95 layer.mapObject.getMapTypes = function() { return [0, 1]; } 96 layer.mapObject.addMapType = function(type) { 97 t.eq(type, 5, "new map type passed correctly."); 98 } 99 layer.mapObject.setMapType = function(arg) { 100 t.eq(arg, 5, "got map type"); 101 } 102 layer.type = 5; 103 layer.setMapType(); 104 layer.mapObject.setMapType = function(arg) { 105 t.eq(arg, 0, "got map type"); 106 } 107 layer.type = 0 108 layer.setMapType(); 109 110 } else { 111 t.plan(0); 112 t.debug_print("Google tests can't be run from " + 113 window.location.host); 114 } 115 } 116 88 117 function test_04_Layer_Google_Translation_pixel (t) { 89 118 if(validkey) {
