1.0.0 • Published 3 years ago
openseadragon-wmts v1.0.0
OpenSeadragonWMTS
Adds support for displaying geo-referenced WMTS tile maps in OpenSeadragon.
See online demo.
Install
Download the latest release or grab directly from the CDN. Import into your page:
<script src="https://cdn.jsdelivr.net/npm/openseadragon-wmts@latest/dist/openseadragon-wmts.umd.cjs"></script>Or install via npm:
$ npm install openseadragon-wmtsUse
var viewer = OpenSeadragon({
id: "openseadragon",
prefixUrl: "https://cdn.jsdelivr.net/npm/openseadragon@2.4/build/openseadragon/images/"
});
// Initialize the plugin
var map = await OpenSeadragonWMTS(viewer, {
url: 'http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml'
});
// The map object provides functions to convert OSD coordinates to WGS84
var mouseTracker = new OpenSeadragon.MouseTracker({
element: viewer.container,
moveHandler: function(event) {
var viewportPoint = viewer.viewport.pointFromPixel(event.position);
var lonlat = map.viewportToLonLat(viewportPoint);
console.log(lonlat);
}
});
mouseTracker.setTracking(true);Per default, the plugin displays the first available map layer with the default style. To select a specific layer and style:
var map = await OpenSeadragon.WMTS(viewer, {
url: 'http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml',
layer: 'Orthofoto 2020',
style: 'farbe'
});API
| Method | Type | |
|---|---|---|
| imageToLonLat | x, y | Image X/Y to lon/lat |
| lonLatToImageCoordinates | lon, lat | lon/lat to image X/Y |
| lonLatToMapCoordinates | lon, lat | lon/lat to map projection |
| lonLatToViewportCoordinates | lon, lat | lon/lat to OSD viewport X/Y |
| mapToLonLat | east, north | Map projection to lon/lat |
| mapToViewportCoordinates | east, north | Map projection to OSD viewport X/Y |
| viewportToLonLat | x, y | OSD viewport X/Y to lon/lat |
| viewportToMapCoordinates | x, y | OSD viewport X/Y to map projection |
1.0.0
3 years ago
0.7.1
3 years ago
0.6.3-experimental
4 years ago
0.6.2
4 years ago
0.6.4
4 years ago
0.5.0
4 years ago
0.7.0
4 years ago
0.6.1
4 years ago
0.6.0
4 years ago
0.5.1
4 years ago
0.4.0
4 years ago
0.3.0
4 years ago
0.2.0
4 years ago
0.3.2
4 years ago
0.3.1
4 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago