Updating WMS url.

And while we're at it, use the nicer single argument map constructor so we can reduce the overall amount of code.
This commit is contained in:
ahocevar
2011-11-30 17:32:20 +01:00
parent 5011fb8b96
commit d418369e93

View File

@@ -2,28 +2,28 @@ var map;
OpenLayers.ProxyHost = "proxy.cgi?url=";
function init() {
map = new OpenLayers.Map("map");
var base = new OpenLayers.Layer.WMS("OpenLayers WMS",
"http://tilecache.osgeo.org/wms-c/Basic.py",
{layers: "basic"}
);
map.addLayer(base);
// allow testing of specific renderers via "?renderer=Canvas", etc
var renderer = OpenLayers.Util.getParameters(window.location.href).renderer;
renderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;
var wfs = new OpenLayers.Layer.Vector("States", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: "http://demo.opengeo.org/geoserver/wfs",
featureType: "states",
featureNS: "http://www.openplans.org/topp"
}),
renderers: renderer
map = new OpenLayers.Map({
div: "map",
layers: [
new OpenLayers.Layer.WMS("OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{layers: "basic"}
),
new OpenLayers.Layer.Vector("States", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: "http://demo.opengeo.org/geoserver/wfs",
featureType: "states",
featureNS: "http://www.openplans.org/topp"
}),
renderers: renderer
})
],
center: [-95.8506355, 37.163851],
zoom: 3
});
map.addLayer(wfs);
map.zoomToExtent(new OpenLayers.Bounds(-140.4, 25.1, -44.4, 50.5));
}