Merge pull request #1675 from bartvde/wmts-example-fix
WMTS example is broken (r=@twpayne)
This commit is contained in:
@@ -11,12 +11,12 @@ goog.require('ol.tilegrid.WMTS');
|
|||||||
var projection = ol.proj.get('EPSG:900913');
|
var projection = ol.proj.get('EPSG:900913');
|
||||||
var projectionExtent = projection.getExtent();
|
var projectionExtent = projection.getExtent();
|
||||||
var size = ol.extent.getWidth(projectionExtent) / 256;
|
var size = ol.extent.getWidth(projectionExtent) / 256;
|
||||||
var resolutions = new Array(26);
|
var resolutions = new Array(18);
|
||||||
var matrixIds = new Array(26);
|
var matrixIds = new Array(18);
|
||||||
for (var z = 0; z < 26; ++z) {
|
for (var z = 0; z < 18; ++z) {
|
||||||
// generate resolutions and matrixIds arrays for this WMTS
|
// generate resolutions and matrixIds arrays for this WMTS
|
||||||
resolutions[z] = size / Math.pow(2, z);
|
resolutions[z] = size / Math.pow(2, z);
|
||||||
matrixIds[z] = 'EPSG:900913:' + z;
|
matrixIds[z] = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
@@ -26,26 +26,28 @@ var map = new ol.Map({
|
|||||||
opacity: 0.7
|
opacity: 0.7
|
||||||
}),
|
}),
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
|
opacity: 0.7,
|
||||||
source: new ol.source.WMTS({
|
source: new ol.source.WMTS({
|
||||||
url: 'http://v2.suite.opengeo.org/geoserver/gwc/service/wmts/',
|
url: 'http://demo-apollo.geospatial.intergraph.com/erdas-iws/ogc/wmts/',
|
||||||
layer: 'medford:buildings',
|
layer: 'sampleiws_images_geodetic_worldgeodemo.ecw',
|
||||||
matrixSet: 'EPSG:900913',
|
matrixSet: 'ogc:1.0:googlemapscompatible',
|
||||||
format: 'image/png',
|
format: 'image/jpeg',
|
||||||
projection: projection,
|
projection: projection,
|
||||||
tileGrid: new ol.tilegrid.WMTS({
|
tileGrid: new ol.tilegrid.WMTS({
|
||||||
origin: ol.extent.getTopLeft(projectionExtent),
|
origin: ol.extent.getTopLeft(projectionExtent),
|
||||||
resolutions: resolutions,
|
resolutions: resolutions,
|
||||||
matrixIds: matrixIds
|
matrixIds: matrixIds
|
||||||
}),
|
}),
|
||||||
style: '_null',
|
extent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34],
|
||||||
extent: [-13682835, 5204068, -13667473, 5221690]
|
style: 'default'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: 'canvas',
|
renderer: 'canvas',
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View2D({
|
view: new ol.View2D({
|
||||||
center: [-13677832, 5213272],
|
center: [0, 0],
|
||||||
zoom: 13
|
zoom: 0,
|
||||||
|
maxResolution: resolutions[1]
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user