Display transformed tile coordinates in ol.source.TileDebug
This commit is contained in:
@@ -3,8 +3,7 @@ template: example.html
|
||||
title: Canvas tiles example
|
||||
shortdesc: Renders tiles with coordinates for debugging.
|
||||
docs: >
|
||||
<p>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).</p>
|
||||
The black grid tiles are generated on the client with an HTML5 canvas. In this example, the `ol.source.TileDebug` source uses the tile grid of the `ol.source.OSM` source, so the displayed tile coordinates are the same as those for OSM tile requests.
|
||||
tags: "layers, openstreetmap, canvas"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
|
||||
@@ -7,15 +7,16 @@ goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.TileDebug');
|
||||
|
||||
|
||||
var osmSource = new ol.source.OSM();
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
source: osmSource
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.TileDebug({
|
||||
projection: 'EPSG:3857',
|
||||
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22})
|
||||
tileGrid: osmSource.getTileGrid()
|
||||
})
|
||||
})
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user