Skip to content

Commit

Permalink
Provide format:tiles source param
Browse files Browse the repository at this point in the history
  • Loading branch information
dbauszus-glx committed Nov 1, 2023
1 parent 301862d commit b40892e
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions lib/layer/format/tiles.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
const sources = {
OSM: layer => new ol.source.OSM({
url: decodeURIComponent(layer.URI),
opaque: false,
transition: 0,
}),
XYZ: layer => new ol.source.OSM({
url: decodeURIComponent(layer.URI),
opaque: false,
transition: 0,
})
}

export default layer => {

layer.source ??= 'OSM'

layer.L = new ol.layer.Tile({
source: new ol.source.OSM({
url: decodeURIComponent(layer.URI),
opaque: false,
transition: 0,
}),
source: sources[layer.source](layer),
layer: layer,
zIndex: layer.style?.zIndex || 0
})
Expand Down

0 comments on commit b40892e

Please sign in to comment.