Merge branch 'upstream-master' into deprecated.js

This commit is contained in:
fredj
2011-11-18 12:14:45 +01:00
7 changed files with 76 additions and 21 deletions
+3 -3
View File
@@ -131,7 +131,7 @@
var url = "http://octo.metacarta.com/cgi-bin/mapserv";
layer = new OpenLayers.Layer.WMS(name, url, params, {'wrapDateLine':true,encodeBBOX:true, buffer: 2});
var m = new OpenLayers.Map('map');
var m = new OpenLayers.Map('map', {adjustZoom: function(z) {return z;}});
m.addLayer(layer);
m.zoomToMaxExtent();
t.eq(layer.grid[3][0].url, "http://octo.metacarta.com/cgi-bin/mapserv?MAP=%2Fmapdata%2Fvmap_wms.map&LAYERS=basic&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A4326&BBOX=0%2C-90%2C180%2C90&WIDTH=256&HEIGHT=256", "cell [3][0] is wrapped around the world.");
@@ -147,7 +147,7 @@
"http://www.openlayers.org/world/index.php",
{g: "satellite", map: "world"},
{wrapDateLine: true, buffer: 2} );
var m = new OpenLayers.Map('map');
var m = new OpenLayers.Map('map', {adjustZoom: function(z) {return z;}});
m.addLayer(layer);
m.zoomToMaxExtent();
t.eq(layer.grid[0][0].url, "http://www.openlayers.org/world/index.php?g=satellite&map=world&i=jpeg&t=-1280&l=0&s=221471921.25", "grid[0][0] kamap is okay");
@@ -165,7 +165,7 @@
"prov_bound,fedlimit,rail,road,popplace",
transparent: "true", format: "image/png"},
{wrapDateLine: true, reproject: false,encodeBBOX:true, buffer:2});
var m = new OpenLayers.Map('map');
var m = new OpenLayers.Map('map', {adjustZoom: function(z) {return z;}});
m.addLayers([baselayer,layer]);
m.zoomToMaxExtent();
t.eq(layer.grid[0][0].url, "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?LAYERS=bathymetry%2Cland_fn%2Cpark%2Cdrain_fn%2Cdrainage%2Cprov_bound%2Cfedlimit%2Crail%2Croad%2Cpopplace&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A4326&BBOX=0%2C450%2C180%2C630&WIDTH=256&HEIGHT=256", "grid[0][0] wms overlay is okay");
+17
View File
@@ -1967,6 +1967,23 @@
t.eq(map.layerContainerDiv.style.top, '0px', 'layer container top correct');
}
function test_adjustZoom(t) {
t.plan(3);
var map = new OpenLayers.Map({
div: 'map',
layers: [
new OpenLayers.Layer('name', {
isBaseLayer: true,
wrapDateLine: true
})
]
});
map.zoomToMaxExtent();
t.ok(map.getResolution() <= map.getMaxExtent().getWidth() / map.getSize().w, "wrapDateLine map not wider than world");
t.eq(map.adjustZoom(9), 9, "valid zoom maintained");
t.eq(map.adjustZoom(1), 2, "zoom adjusted to not exceed world width");
}
</script>
</head>
+7 -1
View File
@@ -16,7 +16,13 @@
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
map.zoomToExtent(new OpenLayers.Bounds(-94.617035,33.010025,-89.645401,36.492752));
map.addLayer(new OpenLayers.Layer.GML("GML", "arkansas.rss", {format: OpenLayers.Format.GeoRSS}));
map.addLayer(new OpenLayers.Layer.Vector("arkansas", {
protocol: new OpenLayers.Protocol.HTTP({
url: "arkansas.rss",
format: new OpenLayers.Format.GeoRSS()
}),
strategies: [new OpenLayers.Strategy.Fixed()]
}));
}
</script>
</head>