Updated
This commit is contained in:
@@ -21,10 +21,12 @@
|
||||
<tr>
|
||||
<th>DOM</th>
|
||||
<th>WebGL</th>
|
||||
<th>Canvas</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div id="domMap" class="map"></div></td>
|
||||
<td><div id="webglMap" class="map"></div></td>
|
||||
<td><div id="canvasMap" class="map"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="docs">
|
||||
|
||||
@@ -41,3 +41,10 @@ var domMap = new ol.Map({
|
||||
});
|
||||
domMap.bindTo('layers', webglMap);
|
||||
domMap.bindTo('view', webglMap);
|
||||
|
||||
var canvasMap = new ol.Map({
|
||||
renderer: ol.RendererHint.DOM,
|
||||
target: 'canvasMap'
|
||||
});
|
||||
canvasMap.bindTo('layers', webglMap);
|
||||
canvasMap.bindTo('view', webglMap);
|
||||
|
||||
@@ -3,6 +3,7 @@ goog.require('ol.Coordinate');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.control.ScaleLineUnits');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.projection');
|
||||
goog.require('ol.source.TiledWMS');
|
||||
@@ -10,22 +11,12 @@ goog.require('ol.source.TiledWMS');
|
||||
|
||||
var epsg4326 = ol.projection.getFromCode('EPSG:4326');
|
||||
|
||||
// We give the single image source a set of resolutions. This prevents the
|
||||
// source from requesting images of arbitrary resolutions.
|
||||
var projectionExtent = epsg4326.getExtent();
|
||||
var maxResolution = Math.max(
|
||||
projectionExtent.maxX - projectionExtent.minX,
|
||||
projectionExtent.maxY - projectionExtent.minY) / 256;
|
||||
var resolutions = new Array(10);
|
||||
for (var i = 0; i < 10; ++i) {
|
||||
resolutions[i] = maxResolution / Math.pow(2.0, i);
|
||||
}
|
||||
|
||||
var layers = new ol.Collection([
|
||||
new ol.layer.TileLayer({
|
||||
source: new ol.source.TiledWMS({
|
||||
url: 'http://vmap0.tiles.osgeo.org/wms/vmap0',
|
||||
crossOrigin: null,
|
||||
version: '1.1.1',
|
||||
params: {
|
||||
'LAYERS': 'basic',
|
||||
'FORMAT': 'image/jpeg'
|
||||
@@ -39,6 +30,8 @@ var map = new ol.Map({
|
||||
layers: layers,
|
||||
// The OSgeo server does not set cross origin headers, so we cannot use WebGL
|
||||
renderers: [ol.RendererHint.CANVAS, ol.RendererHint.DOM],
|
||||
scaleLineControl: true,
|
||||
scaleLineUnits: ol.control.ScaleLineUnits.DEGREES,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
projection: epsg4326,
|
||||
|
||||
@@ -1 +1 @@
|
||||
var info={"index": {"origin": {"1": 2}, "and": {"4": 1, "5": 1, "7": 1}, "layer": {"8": 1, "5": 1}, "projection": {"7": 3}, "capabilities": {"6": 1}, "ed": {"4": 1, "5": 1}, "national": {"7": 1}, "4326": {"2": 2}, "sync": {"4": 2, "5": 1}, "21781": {"7": 1}, "an": {"1": 1}, "openaerial": {"0": 1, "3": 1}, "tilelayer": {"8": 1, "3": 1, "7": 1}, "popup": {"0": 1}, "osm": {"1": 1}, "are": {"1": 2}, "mapquest": {"0": 1, "3": 1}, "1": {"7": 2}, "getcapabilities": {"6": 3}, "tilejson": {"5": 1}, "tiled": {"8": 2, "7": 2}, "webgl": {"4": 2, "5": 1}, "layers": {"1": 1, "5": 2, "7": 1}, "fullscreen": {"3": 1}, "canvas": {"1": 3, "4": 1, "5": 1}, "overlay": {"0": 1}, "wms": {"8": 3, "6": 3, "7": 3}, "demonstrates": {"0": 1}, "top": {"1": 1}, "custom": {"7": 1}, "two": {"5": 2, "7": 1}, "coordinates": {"1": 3}, "response": {"6": 1}, "note": {"1": 1}, "maps": {"4": 1, "5": 1}, "pixelmap": {"7": 1}, "black": {"1": 1}, "tile": {"8": 1, "1": 3, "3": 1, "7": 1}, "parks": {"7": 1}, "stamen": {"1": 1}, "map": {"2": 1, "3": 1}, "tiles": {"1": 2}, "elements": {"0": 3}, "that": {"1": 1}, "screen": {"3": 2}, "object": {"4": 1}, "generated": {"1": 1}, "ol3": {"1": 1}, "grid": {"1": 1}, "html5": {"1": 1}, "not": {"1": 1}, "using": {"7": 1}, "epsg4326": {"2": 1}, "on": {"1": 1}, "with": {"1": 1, "5": 1, "7": 1}, "by": {"4": 3}, "bingmaps": {"5": 1}, "a": {"8": 1, "2": 1, "3": 1, "6": 1}, "anchored": {"0": 3}, "full": {"3": 2}, "dom": {"4": 2, "5": 1}, "of": {"8": 1, "2": 1, "3": 1, "6": 1, "7": 1}, "bing": {"5": 1}, "bottom": {"1": 1}, "000": {"7": 2}, "side": {"4": 6}, "parsing": {"6": 2}, "client": {"1": 1}, "epsg": {"2": 2, "7": 1}, "the": {"1": 3, "7": 1}, "left": {"1": 2}, "example": {"0": 1, "1": 1, "2": 2, "3": 2, "4": 1, "5": 1, "6": 2, "7": 2, "8": 2}, "normalized": {"1": 1}}, "examples": [{"author": "Tom Payne", "tags": "anchored elements, overlay, popup, mapquest, openaerial", "modified": "2013-01-22T14:37:13+0100", "classes": [], "link": "anchored-elements.html", "shortdesc": "Demonstrates anchored elements.", "title": "Anchored elements example", "example": "anchored-elements.html"}, {"author": "Tom Payne", "tags": "layers, stamen, canvas", "modified": "2013-01-05T18:33:37+0100", "classes": [], "link": "canvas-tiles.html", "shortdesc": "The black grid tiles are generated on the client with an HTML5 canvas. Note that the tile coordinates are ol3 normalized tile coordinates (origin bottom left), not OSM tile coordinates (origin top left).", "title": "Canvas tiles example", "example": "canvas-tiles.html"}, {"author": "Tom Payne", "tags": "epsg4326", "modified": "2013-02-21T20:22:46+0100", "classes": [], "link": "epsg-4326.html", "shortdesc": "Example of a epsg-4326 map.", "title": "EPSG:4326 example", "example": "epsg-4326.html"}, {"author": "Frederic Junod", "tags": "fullscreen, mapquest, openaerial, tile, tilelayer", "modified": "2013-02-04T10:52:29+0100", "classes": [], "link": "full-screen.html", "shortdesc": "Example of a full-screen map.", "title": "Full-screen example", "example": "full-screen.html"}, {"author": "Tom Payne", "tags": "side-by-side, webgl, dom, sync, object", "modified": "2013-01-18T14:04:33+0100", "classes": [], "link": "side-by-side.html", "shortdesc": "Side-by-side DOM, WebGL and Canvas sync'ed maps.", "title": "Side-by-side example", "example": "side-by-side.html"}, {"author": "Frederic Junod", "tags": "layers, tilejson, bing, bingmaps", "modified": "2013-01-21T16:13:19+0100", "classes": [], "link": "two-layers.html", "shortdesc": "Sync'ed DOM, WebGL and Canvas maps with two layers.", "title": "Two-layer example", "example": "two-layers.html"}, {"author": "Bruno Binet", "tags": "wms, capabilities, getcapabilities", "modified": "2013-03-03T17:37:15+0100", "classes": [], "link": "wms-capabilities.html", "shortdesc": "Example of parsing a WMS GetCapabilities response.", "title": "WMS GetCapabilities parsing example", "example": "wms-capabilities.html"}, {"author": "ahocevar", "tags": "wms, tile, tilelayer, projection", "modified": "2012-10-29T09:33:00+0100", "classes": [], "link": "wms-custom-proj.html", "shortdesc": "Example of two tiled WMS layers (Pixelmap 1:1'000'000 and national parks) using the projection EPSG:21781.", "title": "Tiled WMS with custom projection example", "example": "wms-custom-proj.html"}, {"author": "ahocevar", "tags": "wms, tile, tilelayer", "modified": "2012-10-26T21:36:30+0200", "classes": [], "link": "wms.html", "shortdesc": "Example of a tiled WMS layer.", "title": "Tiled WMS example", "example": "wms.html"}]};
|
||||
var info={"index": {"origin": {"1": 2}, "and": {"4": 1, "5": 1, "7": 1}, "layer": {"8": 1, "5": 1}, "projection": {"7": 3}, "capabilities": {"6": 1}, "ed": {"4": 1, "5": 1}, "national": {"7": 1}, "4326": {"2": 2}, "sync": {"4": 2, "5": 1}, "21781": {"7": 1}, "an": {"1": 1}, "openaerial": {"0": 1, "3": 1}, "tilelayer": {"8": 1, "3": 1, "7": 1}, "popup": {"0": 1}, "osm": {"1": 1}, "are": {"1": 2}, "mapquest": {"0": 1, "3": 1}, "1": {"7": 2}, "getcapabilities": {"6": 3}, "tilejson": {"5": 1}, "tiled": {"8": 2, "7": 2}, "webgl": {"4": 2, "5": 1}, "layers": {"1": 1, "5": 2, "7": 1}, "fullscreen": {"3": 1}, "canvas": {"1": 3, "4": 1, "5": 1}, "overlay": {"0": 1}, "wms": {"8": 3, "6": 3, "7": 3}, "demonstrates": {"0": 1}, "top": {"1": 1}, "custom": {"7": 1}, "two": {"5": 2, "7": 1}, "coordinates": {"1": 3}, "response": {"6": 1}, "note": {"1": 1}, "maps": {"4": 1, "5": 1}, "pixelmap": {"7": 1}, "black": {"1": 1}, "tile": {"8": 1, "1": 3, "3": 1, "7": 1}, "parks": {"7": 1}, "stamen": {"1": 1}, "map": {"2": 1, "3": 1}, "tiles": {"1": 2}, "elements": {"0": 3}, "that": {"1": 1}, "screen": {"3": 2}, "object": {"4": 1}, "generated": {"1": 1}, "ol3": {"1": 1}, "grid": {"1": 1}, "html5": {"1": 1}, "not": {"1": 1}, "using": {"7": 1}, "epsg4326": {"2": 1}, "on": {"1": 1}, "with": {"1": 1, "5": 1, "7": 1}, "by": {"4": 3}, "bingmaps": {"5": 1}, "a": {"8": 1, "2": 1, "3": 1, "6": 1}, "anchored": {"0": 3}, "full": {"3": 2}, "dom": {"4": 2, "5": 1}, "of": {"8": 1, "2": 1, "3": 1, "6": 1, "7": 1}, "bing": {"5": 1}, "bottom": {"1": 1}, "000": {"7": 2}, "side": {"4": 6}, "parsing": {"6": 2}, "client": {"1": 1}, "epsg": {"2": 2, "7": 1}, "the": {"1": 3, "7": 1}, "left": {"1": 2}, "example": {"0": 1, "1": 1, "2": 2, "3": 2, "4": 1, "5": 1, "6": 2, "7": 2, "8": 2}, "normalized": {"1": 1}}, "examples": [{"author": "Tom Payne", "tags": "anchored elements, overlay, popup, mapquest, openaerial", "modified": "2013-01-22T14:37:13+0100", "classes": [], "link": "anchored-elements.html", "shortdesc": "Demonstrates anchored elements.", "title": "Anchored elements example", "example": "anchored-elements.html"}, {"author": "Tom Payne", "tags": "layers, stamen, canvas", "modified": "2013-02-06T18:06:16+0100", "classes": [], "link": "canvas-tiles.html", "shortdesc": "The black grid tiles are generated on the client with an HTML5 canvas. Note that the tile coordinates are ol3 normalized tile coordinates (origin bottom left), not OSM tile coordinates (origin top left).", "title": "Canvas tiles example", "example": "canvas-tiles.html"}, {"author": "Tom Payne", "tags": "epsg4326", "modified": "2013-02-21T20:22:46+0100", "classes": [], "link": "epsg-4326.html", "shortdesc": "Example of a epsg-4326 map.", "title": "EPSG:4326 example", "example": "epsg-4326.html"}, {"author": "Frederic Junod", "tags": "fullscreen, mapquest, openaerial, tile, tilelayer", "modified": "2013-02-04T10:52:29+0100", "classes": [], "link": "full-screen.html", "shortdesc": "Example of a full-screen map.", "title": "Full-screen example", "example": "full-screen.html"}, {"author": "Tom Payne", "tags": "side-by-side, webgl, dom, sync, object", "modified": "2013-01-18T14:04:33+0100", "classes": [], "link": "side-by-side.html", "shortdesc": "Side-by-side DOM, WebGL and Canvas sync'ed maps.", "title": "Side-by-side example", "example": "side-by-side.html"}, {"author": "Frederic Junod", "tags": "layers, tilejson, bing, bingmaps", "modified": "2013-01-21T16:13:19+0100", "classes": [], "link": "two-layers.html", "shortdesc": "Sync'ed DOM, WebGL and Canvas maps with two layers.", "title": "Two-layer example", "example": "two-layers.html"}, {"author": "Bruno Binet", "tags": "wms, capabilities, getcapabilities", "modified": "2013-03-03T17:37:15+0100", "classes": [], "link": "wms-capabilities.html", "shortdesc": "Example of parsing a WMS GetCapabilities response.", "title": "WMS GetCapabilities parsing example", "example": "wms-capabilities.html"}, {"author": "ahocevar", "tags": "wms, tile, tilelayer, projection", "modified": "2012-10-29T09:33:00+0100", "classes": [], "link": "wms-custom-proj.html", "shortdesc": "Example of two tiled WMS layers (Pixelmap 1:1'000'000 and national parks) using the projection EPSG:21781.", "title": "Tiled WMS with custom projection example", "example": "wms-custom-proj.html"}, {"author": "ahocevar", "tags": "wms, tile, tilelayer", "modified": "2012-10-26T21:36:30+0200", "classes": [], "link": "wms.html", "shortdesc": "Example of a tiled WMS layer.", "title": "Tiled WMS example", "example": "wms.html"}]};
|
||||
@@ -1 +1 @@
|
||||
<?xml version="1.0" ?><feed xmlns="http://www.w3.org/2005/Atom"><title>OpenLayers Examples</title><id>http://openlayers.github.com/ol3/master/examples/example-list.xml#2013-03-03T07:45:07Z</id><updated>2013-03-03T07:45:07Z</updated><entry><title>WMS GetCapabilities parsing example</title><tags>wms, capabilities, getcapabilities</tags><link href="http://openlayers.github.com/ol3/master/examples/wms-capabilities.html"/><summary>Example of parsing a WMS GetCapabilities response.</summary><updated>2013-03-03T17:37:15+0100</updated><author><name>Bruno Binet</name></author><id>http://openlayers.github.com/ol3/master/examples/wms-capabilities.html#2013-03-03T17:37:15+0100</id></entry><entry><title>EPSG:4326 example</title><tags>epsg4326</tags><link href="http://openlayers.github.com/ol3/master/examples/epsg-4326.html"/><summary>Example of a epsg-4326 map.</summary><updated>2013-02-21T20:22:46+0100</updated><author><name>Tom Payne</name></author><id>http://openlayers.github.com/ol3/master/examples/epsg-4326.html#2013-02-21T20:22:46+0100</id></entry><entry><title>Full-screen example</title><tags>fullscreen, mapquest, openaerial, tile, tilelayer</tags><link href="http://openlayers.github.com/ol3/master/examples/full-screen.html"/><summary>Example of a full-screen map.</summary><updated>2013-02-04T10:52:29+0100</updated><author><name>Frederic Junod</name></author><id>http://openlayers.github.com/ol3/master/examples/full-screen.html#2013-02-04T10:52:29+0100</id></entry><entry><title>Anchored elements example</title><tags>anchored elements, overlay, popup, mapquest, openaerial</tags><link href="http://openlayers.github.com/ol3/master/examples/anchored-elements.html"/><summary>Demonstrates anchored elements.</summary><updated>2013-01-22T14:37:13+0100</updated><author><name>Tom Payne</name></author><id>http://openlayers.github.com/ol3/master/examples/anchored-elements.html#2013-01-22T14:37:13+0100</id></entry><entry><title>Two-layer example</title><tags>layers, tilejson, bing, bingmaps</tags><link href="http://openlayers.github.com/ol3/master/examples/two-layers.html"/><summary>Sync'ed DOM, WebGL and Canvas maps with two layers.</summary><updated>2013-01-21T16:13:19+0100</updated><author><name>Frederic Junod</name></author><id>http://openlayers.github.com/ol3/master/examples/two-layers.html#2013-01-21T16:13:19+0100</id></entry><entry><title>Side-by-side example</title><tags>side-by-side, webgl, dom, sync, object</tags><link href="http://openlayers.github.com/ol3/master/examples/side-by-side.html"/><summary>Side-by-side DOM, WebGL and Canvas sync'ed maps.</summary><updated>2013-01-18T14:04:33+0100</updated><author><name>Tom Payne</name></author><id>http://openlayers.github.com/ol3/master/examples/side-by-side.html#2013-01-18T14:04:33+0100</id></entry><entry><title>Canvas tiles example</title><tags>layers, stamen, canvas</tags><link href="http://openlayers.github.com/ol3/master/examples/canvas-tiles.html"/><summary>The black grid tiles are generated on the client with an HTML5 canvas. Note that the tile coordinates are ol3 normalized tile coordinates (origin bottom left), not OSM tile coordinates (origin top left).</summary><updated>2013-01-05T18:33:37+0100</updated><author><name>Tom Payne</name></author><id>http://openlayers.github.com/ol3/master/examples/canvas-tiles.html#2013-01-05T18:33:37+0100</id></entry><entry><title>Tiled WMS with custom projection example</title><tags>wms, tile, tilelayer, projection</tags><link href="http://openlayers.github.com/ol3/master/examples/wms-custom-proj.html"/><summary>Example of two tiled WMS layers (Pixelmap 1:1'000'000 and national parks) using the projection EPSG:21781.</summary><updated>2012-10-29T09:33:00+0100</updated><author><name>ahocevar</name></author><id>http://openlayers.github.com/ol3/master/examples/wms-custom-proj.html#2012-10-29T09:33:00+0100</id></entry><entry><title>Tiled WMS example</title><tags>wms, tile, tilelayer</tags><link href="http://openlayers.github.com/ol3/master/examples/wms.html"/><summary>Example of a tiled WMS layer.</summary><updated>2012-10-26T21:36:30+0200</updated><author><name>ahocevar</name></author><id>http://openlayers.github.com/ol3/master/examples/wms.html#2012-10-26T21:36:30+0200</id></entry></feed>
|
||||
<?xml version="1.0" ?><feed xmlns="http://www.w3.org/2005/Atom"><title>OpenLayers Examples</title><id>http://openlayers.github.com/ol3/master/examples/example-list.xml#2013-03-05T10:08:57Z</id><updated>2013-03-05T10:08:57Z</updated><entry><title>WMS GetCapabilities parsing example</title><tags>wms, capabilities, getcapabilities</tags><link href="http://openlayers.github.com/ol3/master/examples/wms-capabilities.html"/><summary>Example of parsing a WMS GetCapabilities response.</summary><updated>2013-03-03T17:37:15+0100</updated><author><name>Bruno Binet</name></author><id>http://openlayers.github.com/ol3/master/examples/wms-capabilities.html#2013-03-03T17:37:15+0100</id></entry><entry><title>EPSG:4326 example</title><tags>epsg4326</tags><link href="http://openlayers.github.com/ol3/master/examples/epsg-4326.html"/><summary>Example of a epsg-4326 map.</summary><updated>2013-02-21T20:22:46+0100</updated><author><name>Tom Payne</name></author><id>http://openlayers.github.com/ol3/master/examples/epsg-4326.html#2013-02-21T20:22:46+0100</id></entry><entry><title>Canvas tiles example</title><tags>layers, stamen, canvas</tags><link href="http://openlayers.github.com/ol3/master/examples/canvas-tiles.html"/><summary>The black grid tiles are generated on the client with an HTML5 canvas. Note that the tile coordinates are ol3 normalized tile coordinates (origin bottom left), not OSM tile coordinates (origin top left).</summary><updated>2013-02-06T18:06:16+0100</updated><author><name>Tom Payne</name></author><id>http://openlayers.github.com/ol3/master/examples/canvas-tiles.html#2013-02-06T18:06:16+0100</id></entry><entry><title>Full-screen example</title><tags>fullscreen, mapquest, openaerial, tile, tilelayer</tags><link href="http://openlayers.github.com/ol3/master/examples/full-screen.html"/><summary>Example of a full-screen map.</summary><updated>2013-02-04T10:52:29+0100</updated><author><name>Frederic Junod</name></author><id>http://openlayers.github.com/ol3/master/examples/full-screen.html#2013-02-04T10:52:29+0100</id></entry><entry><title>Anchored elements example</title><tags>anchored elements, overlay, popup, mapquest, openaerial</tags><link href="http://openlayers.github.com/ol3/master/examples/anchored-elements.html"/><summary>Demonstrates anchored elements.</summary><updated>2013-01-22T14:37:13+0100</updated><author><name>Tom Payne</name></author><id>http://openlayers.github.com/ol3/master/examples/anchored-elements.html#2013-01-22T14:37:13+0100</id></entry><entry><title>Two-layer example</title><tags>layers, tilejson, bing, bingmaps</tags><link href="http://openlayers.github.com/ol3/master/examples/two-layers.html"/><summary>Sync'ed DOM, WebGL and Canvas maps with two layers.</summary><updated>2013-01-21T16:13:19+0100</updated><author><name>Frederic Junod</name></author><id>http://openlayers.github.com/ol3/master/examples/two-layers.html#2013-01-21T16:13:19+0100</id></entry><entry><title>Side-by-side example</title><tags>side-by-side, webgl, dom, sync, object</tags><link href="http://openlayers.github.com/ol3/master/examples/side-by-side.html"/><summary>Side-by-side DOM, WebGL and Canvas sync'ed maps.</summary><updated>2013-01-18T14:04:33+0100</updated><author><name>Tom Payne</name></author><id>http://openlayers.github.com/ol3/master/examples/side-by-side.html#2013-01-18T14:04:33+0100</id></entry><entry><title>Tiled WMS with custom projection example</title><tags>wms, tile, tilelayer, projection</tags><link href="http://openlayers.github.com/ol3/master/examples/wms-custom-proj.html"/><summary>Example of two tiled WMS layers (Pixelmap 1:1'000'000 and national parks) using the projection EPSG:21781.</summary><updated>2012-10-29T09:33:00+0100</updated><author><name>ahocevar</name></author><id>http://openlayers.github.com/ol3/master/examples/wms-custom-proj.html#2012-10-29T09:33:00+0100</id></entry><entry><title>Tiled WMS example</title><tags>wms, tile, tilelayer</tags><link href="http://openlayers.github.com/ol3/master/examples/wms.html"/><summary>Example of a tiled WMS layer.</summary><updated>2012-10-26T21:36:30+0200</updated><author><name>ahocevar</name></author><id>http://openlayers.github.com/ol3/master/examples/wms.html#2012-10-26T21:36:30+0200</id></entry></feed>
|
||||
@@ -15,6 +15,7 @@ var layer = new ol.layer.TileLayer({
|
||||
var map = new ol.Map({
|
||||
layers: new ol.Collection([layer]),
|
||||
renderers: ol.RendererHints.createFromQueryData(),
|
||||
scaleLineControl: true,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: new ol.Coordinate(0, 0),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
goog.require('ol.BingMapsStyle');
|
||||
goog.require('ol.Collection');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Map');
|
||||
@@ -14,7 +13,7 @@ var layers = new ol.Collection([
|
||||
new ol.layer.TileLayer({
|
||||
source: new ol.source.BingMaps({
|
||||
key: 'AgtFlPYDnymLEe9zJ5PCkghbNiFZE9aAtTy3mPaEnEBXqLHtFuTcKoZ-miMC3w7R',
|
||||
style: ol.BingMapsStyle.AERIAL
|
||||
style: 'Aerial'
|
||||
})
|
||||
}),
|
||||
new ol.layer.TileLayer({
|
||||
|
||||
@@ -19,8 +19,10 @@ var epsg21781 = new ol.Projection('EPSG:21781', ol.ProjectionUnits.METERS,
|
||||
new ol.Extent(485869.5728, 76443.1884, 837076.5648, 299941.7864));
|
||||
ol.projection.addProjection(epsg21781);
|
||||
|
||||
// We give the single image source a set of resolutions. This prevents the
|
||||
// source from requesting images of arbitrary resolutions.
|
||||
// We could give the single image source a set of resolutions. This prevents the
|
||||
// source from requesting images of arbitrary resolutions. To try it, uncomment
|
||||
// the block below and the resolutions option in the SingleImageWMS config.
|
||||
/*
|
||||
var projectionExtent = epsg21781.getExtent();
|
||||
var maxResolution = Math.max(projectionExtent.getWidth(),
|
||||
projectionExtent.getHeight()) / 256;
|
||||
@@ -28,6 +30,7 @@ var resolutions = new Array(10);
|
||||
for (var i = 0; i < 10; ++i) {
|
||||
resolutions[i] = maxResolution / Math.pow(2.0, i);
|
||||
}
|
||||
*/
|
||||
|
||||
var extent = new ol.Extent(420000, 30000, 900000, 350000);
|
||||
var layers = new ol.Collection([
|
||||
@@ -42,20 +45,18 @@ var layers = new ol.Collection([
|
||||
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
|
||||
'FORMAT': 'image/jpeg'
|
||||
},
|
||||
projection: epsg21781,
|
||||
extent: extent
|
||||
})
|
||||
}),
|
||||
new ol.layer.ImageLayer({
|
||||
source: new ol.source.SingleImageWMS({
|
||||
//resolutions: resolutions,
|
||||
url: 'http://wms.geo.admin.ch/',
|
||||
attributions: [new ol.Attribution(
|
||||
'© ' +
|
||||
'<a href="http://www.geo.admin.ch/internet/geoportal/en/home.html">' +
|
||||
'National parks / geo.admin.ch</a>')],
|
||||
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
|
||||
projection: epsg21781,
|
||||
resolutions: resolutions
|
||||
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'}
|
||||
})
|
||||
})
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user