Merge pull request #219 from ahocevar/proj-defaults
New OpenLayers.Projection.defaults property. r=@tschaub,@fredj
This commit is contained in:
@@ -291,18 +291,18 @@
|
||||
t.plan(5);
|
||||
var map = new OpenLayers.Map("map", {
|
||||
getExtent: function() {return(new OpenLayers.Bounds(-180,-90,180,90));}
|
||||
}
|
||||
);
|
||||
});
|
||||
var geographic = new OpenLayers.Projection("EPSG:4326");
|
||||
|
||||
var a = new OpenLayers.Layer.WMS("dummy","http://localhost/wms", {
|
||||
layers: "a,b,c,d",
|
||||
styles: "a,b,c,d"
|
||||
});
|
||||
}, {projection: geographic});
|
||||
|
||||
var b = new OpenLayers.Layer.WMS("dummy","http://localhost/wms", {
|
||||
layers: ["a","b","c","d"],
|
||||
styles: ["a","b","c","d"]
|
||||
});
|
||||
}, {projection: geographic});
|
||||
|
||||
var c = new OpenLayers.Layer.WMS("dummy","http://localhost/wms", {
|
||||
layers: ["a","b","c","d"]
|
||||
@@ -310,13 +310,13 @@
|
||||
|
||||
var d = new OpenLayers.Layer.WMS("dummy","http://localhost/wms", {
|
||||
layers: "a,b,c,d"
|
||||
});
|
||||
}, {projection: geographic});
|
||||
|
||||
var click = new OpenLayers.Control.WMSGetFeatureInfo({
|
||||
featureType: 'type',
|
||||
featureNS: 'ns',
|
||||
layers: [a, b, c, d]
|
||||
});
|
||||
}, {projection: geographic});
|
||||
|
||||
map.addControl(click);
|
||||
|
||||
@@ -399,6 +399,7 @@
|
||||
var c = new OpenLayers.Layer.WMS(
|
||||
null, ["http://c.mirror/wms", "http://d.mirror/wms"], {layers: "c"}
|
||||
);
|
||||
map.addLayers([a, b, c]);
|
||||
|
||||
var control = new OpenLayers.Control.WMSGetFeatureInfo({
|
||||
url: "http://host/wms",
|
||||
|
||||
+2
-2
@@ -268,10 +268,10 @@
|
||||
map.destroy();
|
||||
|
||||
map = new OpenLayers.Map("map");
|
||||
layer = new OpenLayers.Layer("test", {projection: "EPSG:4326"});
|
||||
layer = new OpenLayers.Layer("test", {projection: "unknown"});
|
||||
map.addLayer(layer);
|
||||
t.eq(layer.alwaysInRange, true,
|
||||
"alwaysInRange true if only get projection.");
|
||||
"alwaysInRange true if unknown projection is set.");
|
||||
map.destroy();
|
||||
|
||||
map = new OpenLayers.Map("map");
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
|
||||
var map = new OpenLayers.Map({
|
||||
div: "map",
|
||||
maxResolution: OpenLayers.Map.prototype.maxResolution / Math.pow(2, offset)
|
||||
maxResolution: OpenLayers.Projection.defaults["EPSG:4326"].maxResolution / Math.pow(2, offset)
|
||||
});
|
||||
var layer = new OpenLayers.Layer.TMS("TMS", "", {
|
||||
layername: "basic",
|
||||
@@ -200,7 +200,7 @@
|
||||
|
||||
var map = new OpenLayers.Map({
|
||||
div: "map",
|
||||
maxResolution: OpenLayers.Map.prototype.maxResolution / Math.pow(2, offset)
|
||||
maxResolution: OpenLayers.Projection.defaults["EPSG:4326"].maxResolution / Math.pow(2, offset)
|
||||
});
|
||||
var layer = new OpenLayers.Layer.TMS("TMS", "", {
|
||||
layername: "basic",
|
||||
|
||||
@@ -388,6 +388,7 @@
|
||||
var map = new OpenLayers.Map({
|
||||
div: "map",
|
||||
maxExtent: new OpenLayers.Bounds(-185, -95, 185, 95),
|
||||
maxResolution: 1.40625,
|
||||
layers: [dummy, unconstrained, constrained],
|
||||
center: new OpenLayers.LonLat(0, 0),
|
||||
zoom: 1
|
||||
|
||||
@@ -136,7 +136,8 @@
|
||||
layer: "world",
|
||||
style: "blue_marble",
|
||||
matrixSet: "arcgis_online",
|
||||
tileSize: new OpenLayers.Size(512, 512),
|
||||
tileSize: new OpenLayers.Size(512, 512),
|
||||
maxResolution: 1.40625,
|
||||
requestEncoding: "REST"
|
||||
});
|
||||
map.addLayer(layer1);
|
||||
@@ -156,7 +157,8 @@
|
||||
layer: "world",
|
||||
style: "blue_marble",
|
||||
matrixSet: "arcgis_online",
|
||||
tileSize: new OpenLayers.Size(512, 512),
|
||||
tileSize: new OpenLayers.Size(512, 512),
|
||||
maxResolution: 1.40625,
|
||||
requestEncoding: "REST"
|
||||
});
|
||||
map.addLayer(layer1);
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
|
||||
var map = new OpenLayers.Map({
|
||||
div: "map",
|
||||
maxResolution: OpenLayers.Map.prototype.maxResolution / Math.pow(2, offset)
|
||||
maxResolution: 1.40625 / Math.pow(2, offset)
|
||||
});
|
||||
var layer = new OpenLayers.Layer.XYZ(name, url, {zoomOffset: offset});
|
||||
map.addLayer(layer);
|
||||
@@ -211,7 +211,7 @@
|
||||
|
||||
var map = new OpenLayers.Map({
|
||||
div: "map",
|
||||
maxResolution: OpenLayers.Map.prototype.maxResolution / Math.pow(2, offset)
|
||||
maxResolution: 1.40625 / Math.pow(2, offset)
|
||||
});
|
||||
var layer = new OpenLayers.Layer.XYZ(name, url, {zoomOffset: offset});
|
||||
map.addLayer(layer);
|
||||
|
||||
@@ -302,7 +302,7 @@
|
||||
function test_fromWMSLayer(t) {
|
||||
t.plan(9);
|
||||
var map = new OpenLayers.Map("map", {
|
||||
projection: "EPSG:1234"
|
||||
projection: "CRS:84"
|
||||
});
|
||||
var layer = new OpenLayers.Layer.WMS("foo", "htttp://foo/ows",
|
||||
{layers: "topp:states"}
|
||||
@@ -312,7 +312,7 @@
|
||||
t.eq(protocol.url, "htttp://foo/ows", "url taken from wms layer");
|
||||
t.eq(protocol.featurePrefix, "topp", "feature prefix correctly extracted");
|
||||
t.eq(protocol.featureType, "states", "typeName correctly extracted");
|
||||
t.eq(protocol.srsName, "EPSG:1234", "srsName set correctly");
|
||||
t.eq(protocol.srsName, "CRS:84", "srsName set correctly");
|
||||
t.eq(protocol.version, "1.1.0", "version set correctly");
|
||||
t.eq(protocol.format.geometryName, null, "format's geometryName set to null");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user