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