Making it possible to use a custom SRS identifier for spherical mercator layers. r=bartvde (closes #2665)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10384 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2010-06-08 21:37:33 +00:00
parent d0a2edbebd
commit 71482163cf
4 changed files with 124 additions and 1 deletions

View File

@@ -319,6 +319,38 @@
window.location.host);
}
}
function test_sphericalMercator(t) {
t.plan(4);
var map, layer;
map = new OpenLayers.Map("map");
layer = new OpenLayers.Layer.Google();
map.addLayer(layer);
t.ok(!layer.sphericalMercator, "sphericalMercator false by default");
t.eq(map.getProjection(), "EPSG:4326", "4326 by default without sphericalMercator");
map.destroy();
map = new OpenLayers.Map("map");
layer = new OpenLayers.Layer.Google(null, {
sphericalMercator: true
});
map.addLayer(layer);
t.eq(map.getProjection(), "EPSG:900913", "900913 by default with sphericalMercator");
map.destroy();
map = new OpenLayers.Map("map");
layer = new OpenLayers.Layer.Google(null, {
sphericalMercator: true,
projection: "EPSG:102113"
});
map.addLayer(layer);
t.eq(map.getProjection(), "EPSG:102113", "custom code respected with sphericalMercator");
map.destroy();
}
</script>
</head>