diff --git a/README.md b/README.md index 5afb8fa..e738b39 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ Discover: ## OpenLayers compatibility * OL < 8: use version 0.0.8 -* OL 8 & 9: use version >= 0.1.0 +* OL 8 & 9: use version ~0.1.0 +* OL 10: use version >= 0.2.0 ## Install diff --git a/dist/openlayers-indoorequal.cjs.js b/dist/openlayers-indoorequal.cjs.js index 57c2d93..7904b73 100644 --- a/dist/openlayers-indoorequal.cjs.js +++ b/dist/openlayers-indoorequal.cjs.js @@ -82,17 +82,17 @@ function getLayer(options) { ...options }); } -function createHeatmapSource(source) { - const tilegrid = source.getTileGrid(); +function createHeatmapSource(indoorLayer) { + const tilegrid = indoorLayer.getSource().getTileGrid(); const vectorSource = new VectorSource({ loader(extent, resolution, projection, success, failure) { const refresh = () => { - const features = source.getFeaturesInExtent(extent); + const features = indoorLayer.getFeaturesInExtent(extent); vectorSource.clear(true); vectorSource.addFeatures(features); success(features); }; - source.on('tileloadend', refresh); + indoorLayer.getSource().on('tileloadend', refresh); refresh(); }, loadingstrategy: loadingstrategy.tile(tilegrid) @@ -365,7 +365,7 @@ class IndoorEqual extends BaseObject { const urlParams = this.apiKey ? `?key=${this.apiKey}` : ''; this.source = await loadSourceFromTileJSON(`${this.url}${urlParams}`); this.indoorLayer.setSource(this.source); - this.heatmapLayer.setSource(createHeatmapSource(this.source)); + this.heatmapLayer.setSource(createHeatmapSource(this.indoorLayer)); this._listenForLevels(); } _createLayers(heatmapVisible) { @@ -378,10 +378,11 @@ class IndoorEqual extends BaseObject { }); } _listenForLevels() { + const layer = this.indoorLayer; const source = this.source; const refreshLevels = debounce(() => { const extent = this.map.getView().calculateExtent(this.map.getSize()); - const features = source.getFeaturesInExtent(extent); + const features = layer.getFeaturesInExtent(extent); this.set('levels', findAllLevels(features)); }, 1000); source.on('tileloadend', () => refreshLevels()); @@ -418,7 +419,7 @@ class IndoorEqual extends BaseObject { /** * Emitted when the current level has been updated * - * @event IndoorEqual#levelchange + * @event IndoorEqual#change:level * @type {string} always emitted when the level displayed has changed */ @@ -428,3 +429,4 @@ exports.defaultStyle = defaultStyle; exports.getHeatmapLayer = getHeatmapLayer; exports.getLayer = getLayer; exports.loadSourceFromTileJSON = loadSourceFromTileJSON; +//# sourceMappingURL=openlayers-indoorequal.cjs.js.map diff --git a/dist/openlayers-indoorequal.cjs.js.map b/dist/openlayers-indoorequal.cjs.js.map new file mode 100644 index 0000000..c67df8d --- /dev/null +++ b/dist/openlayers-indoorequal.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"openlayers-indoorequal.cjs.js","sources":["../src/layer.js","../src/level_control.js","../src/defaultstyle.js","../src/levels.js","../src/indoorequal.js"],"sourcesContent":["import Feature from 'ol/Feature';\nimport HeatmapLayer from 'ol/layer/Heatmap';\nimport MVT from 'ol/format/MVT';\nimport TileGrid from 'ol/tilegrid/TileGrid';\nimport TileJSON from 'ol/source/TileJSON';\nimport VectorSource from 'ol/source/Vector';\nimport VectorTileLayer from 'ol/layer/VectorTile';\nimport VectorTileSource from 'ol/source/VectorTile';\nimport { fromLonLat } from 'ol/proj';\nimport { tile } from 'ol/loadingstrategy';\n\nconst MIN_ZOOM_INDOOR = 17;\nconst MAX_ZOOM_HEATMAP = MIN_ZOOM_INDOOR;\n\nfunction extentFromTileJSON(tileJSON) {\n const bounds = tileJSON.bounds;\n if (bounds) {\n const ll = fromLonLat([bounds[0], bounds[1]]);\n const tr = fromLonLat([bounds[2], bounds[3]]);\n return [ll[0], ll[1], tr[0], tr[1]];\n }\n}\n\nconst defaultResolutions = (function () {\n const resolutions = [];\n for (let res = 78271.51696402048; resolutions.length <= 24; res /= 2) {\n resolutions.push(res);\n }\n return resolutions;\n})();\n\nfunction createSourceFromTileJSON(tilejson) {\n const tileJSONDoc = tilejson.getTileJSON();\n const tiles = Array.isArray(tileJSONDoc.tiles)\n ? tileJSONDoc.tiles\n : [tileJSONDoc.tiles];\n const tileGrid = tilejson.getTileGrid();\n const extent = extentFromTileJSON(tileJSONDoc);\n const minZoom = tileJSONDoc.minzoom;\n const maxZoom = tileJSONDoc.maxzoom;\n return new VectorTileSource({\n attributions: tilejson.getAttributions(),\n format: new MVT({\n featureClass: Feature,\n }),\n tileGrid: new TileGrid({\n origin: tileGrid.getOrigin(0),\n extent: extent || tileGrid.getExtent(),\n minZoom: minZoom,\n resolutions: defaultResolutions.slice(0, maxZoom + 1),\n tileSize: 512,\n }),\n urls: tiles,\n });\n}\n\nfunction loadTileJSON(url) {\n return new Promise((resolve, reject) => {\n const tilejson = new TileJSON({ url });\n tilejson.on('change', function () {\n const state = tilejson.getState();\n if (state === 'ready') {\n resolve(tilejson);\n }\n });\n if (tilejson.getState() === 'ready') {\n tilejson.changed();\n }\n });\n}\n\nexport async function loadSourceFromTileJSON(url) {\n const tilejson = await loadTileJSON(url);\n return createSourceFromTileJSON(tilejson);\n}\n\nexport function getLayer(options) {\n return new VectorTileLayer({\n declutter: true,\n ...options,\n });\n}\n\nexport function createHeatmapSource(indoorLayer) {\n const tilegrid = indoorLayer.getSource().getTileGrid();\n const vectorSource = new VectorSource({\n loader(extent, resolution, projection, success, failure) {\n const refresh = () => {\n const features = indoorLayer.getFeaturesInExtent(extent);\n vectorSource.clear(true);\n vectorSource.addFeatures(features);\n success(features);\n }\n indoorLayer.getSource().on('tileloadend', refresh);\n refresh();\n },\n loadingstrategy: tile(tilegrid)\n });\n return vectorSource;\n}\n\nexport function getHeatmapLayer(options) {\n return new HeatmapLayer({\n maxZoom: MAX_ZOOM_HEATMAP,\n gradient: [\n 'rgba(102, 103, 173, 0)',\n 'rgba(102, 103, 173, 0.2)',\n 'rgba(102, 103, 173, 0.7)'\n ],\n ...options,\n });\n}\n","import { Control } from 'ol/control';\n\n/**\n * A control to display the available levels\n * @param {IndoorEqual} indoorEqual the IndoorEqual instance\n * @param {Object} options\n * @param {string} [options.target] Specify a target if you want the control to be rendered outside of the map's viewport.\n * @return {LevelControl} `this`\n */\nexport default class LevelControl extends Control {\n constructor(indoorEqual, options = {}) {\n const element = document.createElement('div');\n element.className = 'level-control ol-unselectable ol-control';\n super({\n element,\n target: options.target,\n });\n\n this.indoorEqual = indoorEqual;\n this._renderNewLevels();\n this.indoorEqual.on('change:levels', this._renderNewLevels.bind(this));\n this.indoorEqual.on('change:level', this._renderNewLevels.bind(this));\n }\n\n _renderNewLevels() {\n this.element.innerHTML = '';\n const currentLevel = this.indoorEqual.get('level');\n this.indoorEqual.get('levels').forEach((level) => {\n const button = document.createElement('button');\n if (currentLevel === level) {\n button.classList.add('level-control-active');\n }\n button.textContent = level;\n button.addEventListener('click', () => {\n this.indoorEqual.set('level', level);\n })\n this.element.appendChild(button);\n });\n }\n}\n","import { Fill, Stroke, Text, Icon, Style } from 'ol/style';\n\nfunction areaLayer(feature, resolution) {\n const properties = feature.getProperties();\n if (properties.class === 'level') {\n return;\n }\n let color = '#fdfcfa';\n if (properties.access && ['no', 'private'].includes(properties.access)) {\n color = '#F2F1F0';\n } else if (properties.is_poi && properties.class !== 'corridor') {\n color = '#D4EDFF';\n } else if (properties.class === 'room') {\n color = '#fefee2';\n }\n\n let stroke;\n\n if (['area', 'corridor', 'platform'].includes(properties.class)) {\n stroke = new Stroke({\n color: '#bfbfbf',\n width: 1\n });\n }\n if (properties.class === 'column') {\n color = '#bfbfbf';\n }\n if (['room', 'wall'].includes(properties.class)) {\n stroke = new Stroke({\n color: 'gray',\n width: 2\n })\n }\n\n return new Style({\n fill: new Fill({ color }),\n stroke,\n });\n}\n\nfunction transportationLayer(feature, resolution) {\n return new Style({\n stroke: new Stroke({\n color: 'gray',\n width: 2,\n lineDash: [4, 7]\n })\n });\n}\n\nfunction areanameLayer(feature, resolution) {\n return new Style({\n text: new Text({\n font: '13px Noto Sans Regular, sans-serif',\n text: feature.getProperties().name,\n fill: new Fill({ color: '#666' }),\n stroke: new Stroke({\n color: 'white',\n width: 1\n })\n }),\n });\n}\n\nfunction poiLayer(feature, resolution, map, sprite) {\n const properties = feature.getProperties();\n const zoom = map.getView().getZoomForResolution(resolution);\n if (zoom < 19 && ['waste_basket', 'information', 'vending_machine'].includes(properties.class)) {\n return;\n }\n\n let icon;\n if (sprite) {\n const iconDef = sprite.json['indoorequal-'+ properties.subclass] || sprite.json['indoorequal-'+ properties.class];\n\n if (iconDef) {\n icon = new Icon({\n img: sprite.png,\n size: [iconDef.width, iconDef.height],\n offset: [iconDef.x, iconDef.y],\n });\n }\n }\n\n return new Style({\n text: new Text({\n font: '11px Noto Sans Regular, sans-serif',\n text: properties.name,\n fill: new Fill({ color: '#666' }),\n offsetY: 18,\n stroke: new Stroke({\n color: 'white',\n width: 1\n })\n }),\n image: icon,\n });\n}\n\nfunction loadAsImage(spriteImageUrl) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.crossOrigin = 'anonymous';\n img.onload = function () {\n img.onload = null;\n resolve(img);\n };\n img.onerror = reject;\n img.src = spriteImageUrl;\n });\n}\n\nasync function loadSprite(basePath) {\n const spriteScale = window.devicePixelRatio >= 1.5 ? 0.5 : 1;\n const sizeFactor = spriteScale == 0.5 ? '@2x' : '';\n let spriteUrl = basePath + sizeFactor + '.json';\n\n const spriteJSON = await (await fetch(spriteUrl, {credentials: 'same-origin'})).json();\n const spritePNG = await loadAsImage(basePath + sizeFactor + '.png', {credentials: 'same-origin'});\n\n return { json: spriteJSON, png: spritePNG };\n}\n\nexport default function defaultStyle(map, layer, spriteBaseUrl) {\n let sprite = null;\n if (spriteBaseUrl) {\n loadSprite(spriteBaseUrl)\n .then((spriteData) => {\n layer.changed();\n sprite = spriteData;\n });\n }\n\n return function(feature, resolution) {\n const properties = feature.getProperties();\n if (properties.layer === 'area') {\n return areaLayer(feature, resolution);\n }\n if (properties.layer === 'transportation') {\n return transportationLayer(feature, resolution);\n }\n if (properties.layer === 'area_name') {\n return areanameLayer(feature, resolution);\n }\n if (properties.layer === 'poi') {\n return poiLayer(feature, resolution, map, sprite);\n }\n }\n};\n","export default function findAllLevels(features) {\n const levels = [];\n for (let i = 0; i < features.length; i++) {\n const feature = features[i];\n const properties = feature.getProperties();\n if (properties.layer !== 'area' || properties.class === 'level') {\n continue;\n }\n const level = properties.level;\n if (!levels.includes(level)) {\n levels.push(level);\n }\n }\n return levels.sort((a, b) => a - b).reverse();\n}\n","import BaseObject from 'ol/Object';\nimport debounce from 'debounce';\n\nimport { loadSourceFromTileJSON, getLayer, getHeatmapLayer, createHeatmapSource } from './layer';\nimport findAllLevels from './levels';\nimport defaultStyle from './defaultstyle';\n\n/**\n * Load the indoor= source and layers in your map.\n * @param {Object} map the OpenLayers instance of the map\n * @param {Object} options\n * @param {boolean} [options.defaultStyle] False to not set the default style. Default true.\n * @param {string} [options.spriteBaseUrl] The base url of the sprite (without .json or .png). If not set, no sprite will be used in the default style.\n * @param {string} [options.url] Override the default tiles URL (https://tiles.indoorequal.org/).\n * @param {string} [options.apiKey] The API key if you use the default tile URL (get your free key at [indoorequal.com](https://indoorequal.com)).\n * @param {boolean} [options.heatmap] Should the heatmap layer be visible at start (true : visible, false : hidden). Defaults to true/visible.\n * @fires change:levels\n * @fires change:level\n * @return {IndoorEqual} `this`\n */\nexport default class IndoorEqual extends BaseObject {\n constructor(map, options = {}) {\n const defaultOpts = { url: 'https://tiles.indoorequal.org/', defaultStyle: true, spriteBaseUrl: null, heatmap: true };\n const opts = { ...defaultOpts, ...options };\n if (opts.url === defaultOpts.url && !opts.apiKey) {\n throw 'You must register your apiKey at https://indoorequal.com before and set it as apiKey param.';\n }\n super({ levels: [], level: '0' });\n\n this.map = map;\n this.url = opts.url;\n this.apiKey = opts.apiKey;\n\n this._createLayers(opts.heatmap);\n this._loadSource();\n this.styleFunction = opts.defaultStyle ? defaultStyle(this.map, this.indoorLayer, opts.spriteBaseUrl) : null;\n this._changeLayerOnLevelChange();\n this._setLayerStyle();\n this._resetLevelOnLevelsChange();\n }\n\n /**\n * Set the style for displayed features. This function takes a feature and resolution and returns an array of styles. If set to null, the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. Call setStyle() without arguments to reset to the default style. See module:ol/style for information on the default style.\n * @param {function} styleFunction the style function\n */\n setStyle(styleFunction) {\n this.styleFunction = styleFunction;\n }\n\n /**\n * Change the heatmap layer visibility\n * @param {boolean} visible True to make it visible, false to hide it\n */\n setHeatmapVisible(visible) {\n this.heatmapLayer.setVisible(visible);\n }\n\n async _loadSource() {\n const urlParams = this.apiKey ? `?key=${this.apiKey}` : '';\n this.source = await loadSourceFromTileJSON(`${this.url}${urlParams}`);\n\n this.indoorLayer.setSource(this.source);\n this.heatmapLayer.setSource(createHeatmapSource(this.indoorLayer));\n this._listenForLevels();\n }\n\n _createLayers(heatmapVisible) {\n this.indoorLayer = getLayer();\n this.heatmapLayer = getHeatmapLayer({ visible: heatmapVisible });\n [this.indoorLayer, this.heatmapLayer].forEach((layer) => {\n this.map.addLayer(layer);\n });\n }\n\n _listenForLevels() {\n const layer = this.indoorLayer;\n const source = this.source;\n\n const refreshLevels = debounce(() => {\n const extent = this.map.getView().calculateExtent(this.map.getSize());\n const features = layer.getFeaturesInExtent(extent);\n this.set('levels', findAllLevels(features));\n }, 1000);\n\n source.on('tileloadend', () => refreshLevels());\n this.map.getView().on('change:center', () => refreshLevels());\n }\n\n _changeLayerOnLevelChange() {\n this.on('change:level', () => {\n this.indoorLayer.changed();\n });\n }\n\n _setLayerStyle() {\n this.indoorLayer.setStyle((feature, resolution) => {\n if (feature.getProperties().level === this.get('level')) {\n return this.styleFunction && this.styleFunction(feature, resolution);\n }\n });\n }\n\n _resetLevelOnLevelsChange() {\n this.on('change:levels', () => {\n if (!this.get('levels').includes(this.get('level'))) {\n this.set('level', '0');\n }\n });\n }\n}\n\n/**\n * Emitted when the list of available levels has been updated\n *\n * @event IndoorEqual#change:levels\n * @type {Array}\n */\n\n/**\n * Emitted when the current level has been updated\n *\n * @event IndoorEqual#change:level\n * @type {string} always emitted when the level displayed has changed\n */\n"],"names":["MIN_ZOOM_INDOOR","MAX_ZOOM_HEATMAP","extentFromTileJSON","tileJSON","bounds","ll","fromLonLat","tr","defaultResolutions","resolutions","res","length","push","createSourceFromTileJSON","tilejson","tileJSONDoc","getTileJSON","tiles","Array","isArray","tileGrid","getTileGrid","extent","minZoom","minzoom","maxZoom","maxzoom","VectorTileSource","attributions","getAttributions","format","MVT","featureClass","Feature","TileGrid","origin","getOrigin","getExtent","slice","tileSize","urls","loadTileJSON","url","Promise","resolve","reject","TileJSON","on","state","getState","changed","loadSourceFromTileJSON","getLayer","options","VectorTileLayer","declutter","createHeatmapSource","indoorLayer","tilegrid","getSource","vectorSource","VectorSource","loader","resolution","projection","success","failure","refresh","features","getFeaturesInExtent","clear","addFeatures","loadingstrategy","tile","getHeatmapLayer","HeatmapLayer","gradient","LevelControl","Control","constructor","indoorEqual","element","document","createElement","className","target","_renderNewLevels","bind","innerHTML","currentLevel","get","forEach","level","button","classList","add","textContent","addEventListener","set","appendChild","areaLayer","feature","properties","getProperties","class","color","access","includes","is_poi","stroke","Stroke","width","Style","fill","Fill","transportationLayer","lineDash","areanameLayer","text","Text","font","name","poiLayer","map","sprite","zoom","getView","getZoomForResolution","icon","iconDef","json","subclass","Icon","img","png","size","height","offset","x","y","offsetY","image","loadAsImage","spriteImageUrl","Image","crossOrigin","onload","onerror","src","loadSprite","basePath","spriteScale","window","devicePixelRatio","sizeFactor","spriteUrl","spriteJSON","fetch","credentials","spritePNG","defaultStyle","layer","spriteBaseUrl","then","spriteData","findAllLevels","levels","i","sort","a","b","reverse","IndoorEqual","BaseObject","defaultOpts","heatmap","opts","apiKey","_createLayers","_loadSource","styleFunction","_changeLayerOnLevelChange","_setLayerStyle","_resetLevelOnLevelsChange","setStyle","setHeatmapVisible","visible","heatmapLayer","setVisible","urlParams","source","setSource","_listenForLevels","heatmapVisible","addLayer","refreshLevels","debounce","calculateExtent","getSize"],"mappings":";;;;;;;;;;;;;;;;;;;AAWA,MAAMA,eAAe,GAAG,EAAE,CAAA;AAC1B,MAAMC,gBAAgB,GAAGD,eAAe,CAAA;AAExC,SAASE,kBAAkBA,CA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js index 5101f09..76764de 100644 --- a/dist/openlayers-indoorequal.esm.js +++ b/dist/openlayers-indoorequal.esm.js @@ -78,17 +78,17 @@ function getLayer(options) { ...options }); } -function createHeatmapSource(source) { - const tilegrid = source.getTileGrid(); +function createHeatmapSource(indoorLayer) { + const tilegrid = indoorLayer.getSource().getTileGrid(); const vectorSource = new VectorSource({ loader(extent, resolution, projection, success, failure) { const refresh = () => { - const features = source.getFeaturesInExtent(extent); + const features = indoorLayer.getFeaturesInExtent(extent); vectorSource.clear(true); vectorSource.addFeatures(features); success(features); }; - source.on('tileloadend', refresh); + indoorLayer.getSource().on('tileloadend', refresh); refresh(); }, loadingstrategy: tile(tilegrid) @@ -361,7 +361,7 @@ class IndoorEqual extends BaseObject { const urlParams = this.apiKey ? `?key=${this.apiKey}` : ''; this.source = await loadSourceFromTileJSON(`${this.url}${urlParams}`); this.indoorLayer.setSource(this.source); - this.heatmapLayer.setSource(createHeatmapSource(this.source)); + this.heatmapLayer.setSource(createHeatmapSource(this.indoorLayer)); this._listenForLevels(); } _createLayers(heatmapVisible) { @@ -374,10 +374,11 @@ class IndoorEqual extends BaseObject { }); } _listenForLevels() { + const layer = this.indoorLayer; const source = this.source; const refreshLevels = debounce(() => { const extent = this.map.getView().calculateExtent(this.map.getSize()); - const features = source.getFeaturesInExtent(extent); + const features = layer.getFeaturesInExtent(extent); this.set('levels', findAllLevels(features)); }, 1000); source.on('tileloadend', () => refreshLevels()); @@ -414,8 +415,9 @@ class IndoorEqual extends BaseObject { /** * Emitted when the current level has been updated * - * @event IndoorEqual#levelchange + * @event IndoorEqual#change:level * @type {string} always emitted when the level displayed has changed */ export { LevelControl, IndoorEqual as default, defaultStyle, getHeatmapLayer, getLayer, loadSourceFromTileJSON }; +//# sourceMappingURL=openlayers-indoorequal.esm.js.map diff --git a/dist/openlayers-indoorequal.esm.js.map b/dist/openlayers-indoorequal.esm.js.map new file mode 100644 index 0000000..45e08e4 --- /dev/null +++ b/dist/openlayers-indoorequal.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"openlayers-indoorequal.esm.js","sources":["../src/layer.js","../src/level_control.js","../src/defaultstyle.js","../src/levels.js","../src/indoorequal.js"],"sourcesContent":["import Feature from 'ol/Feature';\nimport HeatmapLayer from 'ol/layer/Heatmap';\nimport MVT from 'ol/format/MVT';\nimport TileGrid from 'ol/tilegrid/TileGrid';\nimport TileJSON from 'ol/source/TileJSON';\nimport VectorSource from 'ol/source/Vector';\nimport VectorTileLayer from 'ol/layer/VectorTile';\nimport VectorTileSource from 'ol/source/VectorTile';\nimport { fromLonLat } from 'ol/proj';\nimport { tile } from 'ol/loadingstrategy';\n\nconst MIN_ZOOM_INDOOR = 17;\nconst MAX_ZOOM_HEATMAP = MIN_ZOOM_INDOOR;\n\nfunction extentFromTileJSON(tileJSON) {\n const bounds = tileJSON.bounds;\n if (bounds) {\n const ll = fromLonLat([bounds[0], bounds[1]]);\n const tr = fromLonLat([bounds[2], bounds[3]]);\n return [ll[0], ll[1], tr[0], tr[1]];\n }\n}\n\nconst defaultResolutions = (function () {\n const resolutions = [];\n for (let res = 78271.51696402048; resolutions.length <= 24; res /= 2) {\n resolutions.push(res);\n }\n return resolutions;\n})();\n\nfunction createSourceFromTileJSON(tilejson) {\n const tileJSONDoc = tilejson.getTileJSON();\n const tiles = Array.isArray(tileJSONDoc.tiles)\n ? tileJSONDoc.tiles\n : [tileJSONDoc.tiles];\n const tileGrid = tilejson.getTileGrid();\n const extent = extentFromTileJSON(tileJSONDoc);\n const minZoom = tileJSONDoc.minzoom;\n const maxZoom = tileJSONDoc.maxzoom;\n return new VectorTileSource({\n attributions: tilejson.getAttributions(),\n format: new MVT({\n featureClass: Feature,\n }),\n tileGrid: new TileGrid({\n origin: tileGrid.getOrigin(0),\n extent: extent || tileGrid.getExtent(),\n minZoom: minZoom,\n resolutions: defaultResolutions.slice(0, maxZoom + 1),\n tileSize: 512,\n }),\n urls: tiles,\n });\n}\n\nfunction loadTileJSON(url) {\n return new Promise((resolve, reject) => {\n const tilejson = new TileJSON({ url });\n tilejson.on('change', function () {\n const state = tilejson.getState();\n if (state === 'ready') {\n resolve(tilejson);\n }\n });\n if (tilejson.getState() === 'ready') {\n tilejson.changed();\n }\n });\n}\n\nexport async function loadSourceFromTileJSON(url) {\n const tilejson = await loadTileJSON(url);\n return createSourceFromTileJSON(tilejson);\n}\n\nexport function getLayer(options) {\n return new VectorTileLayer({\n declutter: true,\n ...options,\n });\n}\n\nexport function createHeatmapSource(indoorLayer) {\n const tilegrid = indoorLayer.getSource().getTileGrid();\n const vectorSource = new VectorSource({\n loader(extent, resolution, projection, success, failure) {\n const refresh = () => {\n const features = indoorLayer.getFeaturesInExtent(extent);\n vectorSource.clear(true);\n vectorSource.addFeatures(features);\n success(features);\n }\n indoorLayer.getSource().on('tileloadend', refresh);\n refresh();\n },\n loadingstrategy: tile(tilegrid)\n });\n return vectorSource;\n}\n\nexport function getHeatmapLayer(options) {\n return new HeatmapLayer({\n maxZoom: MAX_ZOOM_HEATMAP,\n gradient: [\n 'rgba(102, 103, 173, 0)',\n 'rgba(102, 103, 173, 0.2)',\n 'rgba(102, 103, 173, 0.7)'\n ],\n ...options,\n });\n}\n","import { Control } from 'ol/control';\n\n/**\n * A control to display the available levels\n * @param {IndoorEqual} indoorEqual the IndoorEqual instance\n * @param {Object} options\n * @param {string} [options.target] Specify a target if you want the control to be rendered outside of the map's viewport.\n * @return {LevelControl} `this`\n */\nexport default class LevelControl extends Control {\n constructor(indoorEqual, options = {}) {\n const element = document.createElement('div');\n element.className = 'level-control ol-unselectable ol-control';\n super({\n element,\n target: options.target,\n });\n\n this.indoorEqual = indoorEqual;\n this._renderNewLevels();\n this.indoorEqual.on('change:levels', this._renderNewLevels.bind(this));\n this.indoorEqual.on('change:level', this._renderNewLevels.bind(this));\n }\n\n _renderNewLevels() {\n this.element.innerHTML = '';\n const currentLevel = this.indoorEqual.get('level');\n this.indoorEqual.get('levels').forEach((level) => {\n const button = document.createElement('button');\n if (currentLevel === level) {\n button.classList.add('level-control-active');\n }\n button.textContent = level;\n button.addEventListener('click', () => {\n this.indoorEqual.set('level', level);\n })\n this.element.appendChild(button);\n });\n }\n}\n","import { Fill, Stroke, Text, Icon, Style } from 'ol/style';\n\nfunction areaLayer(feature, resolution) {\n const properties = feature.getProperties();\n if (properties.class === 'level') {\n return;\n }\n let color = '#fdfcfa';\n if (properties.access && ['no', 'private'].includes(properties.access)) {\n color = '#F2F1F0';\n } else if (properties.is_poi && properties.class !== 'corridor') {\n color = '#D4EDFF';\n } else if (properties.class === 'room') {\n color = '#fefee2';\n }\n\n let stroke;\n\n if (['area', 'corridor', 'platform'].includes(properties.class)) {\n stroke = new Stroke({\n color: '#bfbfbf',\n width: 1\n });\n }\n if (properties.class === 'column') {\n color = '#bfbfbf';\n }\n if (['room', 'wall'].includes(properties.class)) {\n stroke = new Stroke({\n color: 'gray',\n width: 2\n })\n }\n\n return new Style({\n fill: new Fill({ color }),\n stroke,\n });\n}\n\nfunction transportationLayer(feature, resolution) {\n return new Style({\n stroke: new Stroke({\n color: 'gray',\n width: 2,\n lineDash: [4, 7]\n })\n });\n}\n\nfunction areanameLayer(feature, resolution) {\n return new Style({\n text: new Text({\n font: '13px Noto Sans Regular, sans-serif',\n text: feature.getProperties().name,\n fill: new Fill({ color: '#666' }),\n stroke: new Stroke({\n color: 'white',\n width: 1\n })\n }),\n });\n}\n\nfunction poiLayer(feature, resolution, map, sprite) {\n const properties = feature.getProperties();\n const zoom = map.getView().getZoomForResolution(resolution);\n if (zoom < 19 && ['waste_basket', 'information', 'vending_machine'].includes(properties.class)) {\n return;\n }\n\n let icon;\n if (sprite) {\n const iconDef = sprite.json['indoorequal-'+ properties.subclass] || sprite.json['indoorequal-'+ properties.class];\n\n if (iconDef) {\n icon = new Icon({\n img: sprite.png,\n size: [iconDef.width, iconDef.height],\n offset: [iconDef.x, iconDef.y],\n });\n }\n }\n\n return new Style({\n text: new Text({\n font: '11px Noto Sans Regular, sans-serif',\n text: properties.name,\n fill: new Fill({ color: '#666' }),\n offsetY: 18,\n stroke: new Stroke({\n color: 'white',\n width: 1\n })\n }),\n image: icon,\n });\n}\n\nfunction loadAsImage(spriteImageUrl) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.crossOrigin = 'anonymous';\n img.onload = function () {\n img.onload = null;\n resolve(img);\n };\n img.onerror = reject;\n img.src = spriteImageUrl;\n });\n}\n\nasync function loadSprite(basePath) {\n const spriteScale = window.devicePixelRatio >= 1.5 ? 0.5 : 1;\n const sizeFactor = spriteScale == 0.5 ? '@2x' : '';\n let spriteUrl = basePath + sizeFactor + '.json';\n\n const spriteJSON = await (await fetch(spriteUrl, {credentials: 'same-origin'})).json();\n const spritePNG = await loadAsImage(basePath + sizeFactor + '.png', {credentials: 'same-origin'});\n\n return { json: spriteJSON, png: spritePNG };\n}\n\nexport default function defaultStyle(map, layer, spriteBaseUrl) {\n let sprite = null;\n if (spriteBaseUrl) {\n loadSprite(spriteBaseUrl)\n .then((spriteData) => {\n layer.changed();\n sprite = spriteData;\n });\n }\n\n return function(feature, resolution) {\n const properties = feature.getProperties();\n if (properties.layer === 'area') {\n return areaLayer(feature, resolution);\n }\n if (properties.layer === 'transportation') {\n return transportationLayer(feature, resolution);\n }\n if (properties.layer === 'area_name') {\n return areanameLayer(feature, resolution);\n }\n if (properties.layer === 'poi') {\n return poiLayer(feature, resolution, map, sprite);\n }\n }\n};\n","export default function findAllLevels(features) {\n const levels = [];\n for (let i = 0; i < features.length; i++) {\n const feature = features[i];\n const properties = feature.getProperties();\n if (properties.layer !== 'area' || properties.class === 'level') {\n continue;\n }\n const level = properties.level;\n if (!levels.includes(level)) {\n levels.push(level);\n }\n }\n return levels.sort((a, b) => a - b).reverse();\n}\n","import BaseObject from 'ol/Object';\nimport debounce from 'debounce';\n\nimport { loadSourceFromTileJSON, getLayer, getHeatmapLayer, createHeatmapSource } from './layer';\nimport findAllLevels from './levels';\nimport defaultStyle from './defaultstyle';\n\n/**\n * Load the indoor= source and layers in your map.\n * @param {Object} map the OpenLayers instance of the map\n * @param {Object} options\n * @param {boolean} [options.defaultStyle] False to not set the default style. Default true.\n * @param {string} [options.spriteBaseUrl] The base url of the sprite (without .json or .png). If not set, no sprite will be used in the default style.\n * @param {string} [options.url] Override the default tiles URL (https://tiles.indoorequal.org/).\n * @param {string} [options.apiKey] The API key if you use the default tile URL (get your free key at [indoorequal.com](https://indoorequal.com)).\n * @param {boolean} [options.heatmap] Should the heatmap layer be visible at start (true : visible, false : hidden). Defaults to true/visible.\n * @fires change:levels\n * @fires change:level\n * @return {IndoorEqual} `this`\n */\nexport default class IndoorEqual extends BaseObject {\n constructor(map, options = {}) {\n const defaultOpts = { url: 'https://tiles.indoorequal.org/', defaultStyle: true, spriteBaseUrl: null, heatmap: true };\n const opts = { ...defaultOpts, ...options };\n if (opts.url === defaultOpts.url && !opts.apiKey) {\n throw 'You must register your apiKey at https://indoorequal.com before and set it as apiKey param.';\n }\n super({ levels: [], level: '0' });\n\n this.map = map;\n this.url = opts.url;\n this.apiKey = opts.apiKey;\n\n this._createLayers(opts.heatmap);\n this._loadSource();\n this.styleFunction = opts.defaultStyle ? defaultStyle(this.map, this.indoorLayer, opts.spriteBaseUrl) : null;\n this._changeLayerOnLevelChange();\n this._setLayerStyle();\n this._resetLevelOnLevelsChange();\n }\n\n /**\n * Set the style for displayed features. This function takes a feature and resolution and returns an array of styles. If set to null, the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. Call setStyle() without arguments to reset to the default style. See module:ol/style for information on the default style.\n * @param {function} styleFunction the style function\n */\n setStyle(styleFunction) {\n this.styleFunction = styleFunction;\n }\n\n /**\n * Change the heatmap layer visibility\n * @param {boolean} visible True to make it visible, false to hide it\n */\n setHeatmapVisible(visible) {\n this.heatmapLayer.setVisible(visible);\n }\n\n async _loadSource() {\n const urlParams = this.apiKey ? `?key=${this.apiKey}` : '';\n this.source = await loadSourceFromTileJSON(`${this.url}${urlParams}`);\n\n this.indoorLayer.setSource(this.source);\n this.heatmapLayer.setSource(createHeatmapSource(this.indoorLayer));\n this._listenForLevels();\n }\n\n _createLayers(heatmapVisible) {\n this.indoorLayer = getLayer();\n this.heatmapLayer = getHeatmapLayer({ visible: heatmapVisible });\n [this.indoorLayer, this.heatmapLayer].forEach((layer) => {\n this.map.addLayer(layer);\n });\n }\n\n _listenForLevels() {\n const layer = this.indoorLayer;\n const source = this.source;\n\n const refreshLevels = debounce(() => {\n const extent = this.map.getView().calculateExtent(this.map.getSize());\n const features = layer.getFeaturesInExtent(extent);\n this.set('levels', findAllLevels(features));\n }, 1000);\n\n source.on('tileloadend', () => refreshLevels());\n this.map.getView().on('change:center', () => refreshLevels());\n }\n\n _changeLayerOnLevelChange() {\n this.on('change:level', () => {\n this.indoorLayer.changed();\n });\n }\n\n _setLayerStyle() {\n this.indoorLayer.setStyle((feature, resolution) => {\n if (feature.getProperties().level === this.get('level')) {\n return this.styleFunction && this.styleFunction(feature, resolution);\n }\n });\n }\n\n _resetLevelOnLevelsChange() {\n this.on('change:levels', () => {\n if (!this.get('levels').includes(this.get('level'))) {\n this.set('level', '0');\n }\n });\n }\n}\n\n/**\n * Emitted when the list of available levels has been updated\n *\n * @event IndoorEqual#change:levels\n * @type {Array}\n */\n\n/**\n * Emitted when the current level has been updated\n *\n * @event IndoorEqual#change:level\n * @type {string} always emitted when the level displayed has changed\n */\n"],"names":["MIN_ZOOM_INDOOR","MAX_ZOOM_HEATMAP","extentFromTileJSON","tileJSON","bounds","ll","fromLonLat","tr","defaultResolutions","resolutions","res","length","push","createSourceFromTileJSON","tilejson","tileJSONDoc","getTileJSON","tiles","Array","isArray","tileGrid","getTileGrid","extent","minZoom","minzoom","maxZoom","maxzoom","VectorTileSource","attributions","getAttributions","format","MVT","featureClass","Feature","TileGrid","origin","getOrigin","getExtent","slice","tileSize","urls","loadTileJSON","url","Promise","resolve","reject","TileJSON","on","state","getState","changed","loadSourceFromTileJSON","getLayer","options","VectorTileLayer","declutter","createHeatmapSource","indoorLayer","tilegrid","getSource","vectorSource","VectorSource","loader","resolution","projection","success","failure","refresh","features","getFeaturesInExtent","clear","addFeatures","loadingstrategy","tile","getHeatmapLayer","HeatmapLayer","gradient","LevelControl","Control","constructor","indoorEqual","element","document","createElement","className","target","_renderNewLevels","bind","innerHTML","currentLevel","get","forEach","level","button","classList","add","textContent","addEventListener","set","appendChild","areaLayer","feature","properties","getProperties","class","color","access","includes","is_poi","stroke","Stroke","width","Style","fill","Fill","transportationLayer","lineDash","areanameLayer","text","Text","font","name","poiLayer","map","sprite","zoom","getView","getZoomForResolution","icon","iconDef","json","subclass","Icon","img","png","size","height","offset","x","y","offsetY","image","loadAsImage","spriteImageUrl","Image","crossOrigin","onload","onerror","src","loadSprite","basePath","spriteScale","window","devicePixelRatio","sizeFactor","spriteUrl","spriteJSON","fetch","credentials","spritePNG","defaultStyle","layer","spriteBaseUrl","then","spriteData","findAllLevels","levels","i","sort","a","b","reverse","IndoorEqual","BaseObject","defaultOpts","heatmap","opts","apiKey","_createLayers","_loadSource","styleFunction","_changeLayerOnLevelChange","_setLayerStyle","_resetLevelOnLevelsChange","setStyle","setHeatmapVisible","visible","heatmapLayer","setVisible","urlParams","source","setSource","_listenForLevels","heatmapVisible","addLayer","refreshLevels","debounce","calculateExtent","getSize"],"mappings":";;;;;;;;;;;;;;;AAWA,MAAMA,eAAe,GAAG,EAAE,CAAA;AAC1B,MAAMC,gBAAgB,GAAGD,eAAe,CAAA;AAExC,SAASE,kBAAkBA,CAACC,QAAQ,EAAE;AACpC,EAAA,MAAMC,MAAM,GAAGD,QAAQ,CAACC,MAAM,CAAA;AAC9B,EAAA,IAAIA,MAAM,EAAE;AACV,IAAA,MAAMC,EAAE,GAAGC,UAAU,CAAC,CAACF,MAAM,CAAC,CAAC,CAAC,EAAEA,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC7C,IAAA,MAAMG,EAAE,GAAGD,UAAU,CAAC,CAACF,MAAM,CAAC,CAAC,CAAC,EAAEA,MAAM,CAA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AW,CAACP,OAAO,EAAE,CAAA;AAC5B,KAAC,CAAC,CAAA;AACJ,GAAA;AAEAoI,EAAAA,cAAcA,GAAG;IACf,IAAI,CAAC7H,WAAW,CAAC+H,QAAQ,CAAC,CAACnF,OAAO,EAAEtC,UAAU,KAAK;AACjD,MAAA,IAAIsC,OAAO,CAACE,aAAa,EAAE,CAACX,KAAK,KAAK,IAAI,CAACF,GAAG,CAAC,OAAO,CAAC,EAAE;QACvD,OAAO,IAAI,CAAC0F,aAAa,IAAI,IAAI,CAACA,aAAa,CAAC/E,OAAO,EAAEtC,UAAU,CAAC,CAAA;AACtE,OAAA;AACF,KAAC,CAAC,CAAA;AACJ,GAAA;AAEAwH,EAAAA,yBAAyBA,GAAG;AAC1B,IAAA,IAAI,CAACxI,EAAE,CAAC,eAAe,EAAE,MAAM;AAC7B,MAAA,IAAI,CAAC,IAAI,CAAC2C,GAAG,CAAC,QAAQ,CAAC,CAACiB,QAAQ,CAAC,IAAI,CAACjB,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE;AACnD,QAAA,IAAI,CAACQ,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AACxB,OAAA;AACF,KAAC,CAAC,CAAA;AACJ,GAAA;AACF,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;"} \ No newline at end of file diff --git a/dist/openlayers-indoorequal.umd.min.js b/dist/openlayers-indoorequal.umd.min.js index 47db848..ade5010 100644 --- a/dist/openlayers-indoorequal.umd.min.js +++ b/dist/openlayers-indoorequal.umd.min.js @@ -1 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ol/Feature"),require("ol/layer/Heatmap"),require("ol/format/MVT"),require("ol/tilegrid/TileGrid"),require("ol/source/TileJSON"),require("ol/source/Vector"),require("ol/layer/VectorTile"),require("ol/source/VectorTile"),require("ol/proj"),require("ol/loadingstrategy"),require("ol/control"),require("ol/style"),require("ol/Object")):"function"==typeof define&&define.amd?define(["exports","ol/Feature","ol/layer/Heatmap","ol/format/MVT","ol/tilegrid/TileGrid","ol/source/TileJSON","ol/source/Vector","ol/layer/VectorTile","ol/source/VectorTile","ol/proj","ol/loadingstrategy","ol/control","ol/style","ol/Object"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).IndoorEqual={},e.ol.Feature,e.ol.layer.Heatmap,e.ol.format.MVT,e.ol.tilegrid.TileGrid,e.ol.source.TileJSON,e.ol.source.Vector,e.ol.layer.VectorTile,e.ol.source.VectorTile,e.ol.proj,e.ol.loadingstrategy,e.ol.control,e.ol.style,e.ol.Object)}(this,(function(e,t,o,r,n,i,l,s,a,c,u,d,h,f){"use strict";const y=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function g(e){const o=e.getTileJSON(),i=Array.isArray(o.tiles)?o.tiles:[o.tiles],l=e.getTileGrid(),s=function(e){const t=e.bounds;if(t){const e=c.fromLonLat([t[0],t[1]]),o=c.fromLonLat([t[2],t[3]]);return[e[0],e[1],o[0],o[1]]}}(o),u=o.minzoom,d=o.maxzoom;return new a({attributions:e.getAttributions(),format:new r({featureClass:t}),tileGrid:new n({origin:l.getOrigin(0),extent:s||l.getExtent(),minZoom:u,resolutions:y.slice(0,d+1),tileSize:512}),urls:i})}async function p(e){const t=await function(e){return new Promise(((t,o)=>{const r=new i({url:e});r.on("change",(function(){"ready"===r.getState()&&t(r)})),"ready"===r.getState()&&r.changed()}))}(e);return g(t)}function m(e){return new s({declutter:!0,...e})}function w(e){return new o({maxZoom:17,gradient:["rgba(102, 103, 173, 0)","rgba(102, 103, 173, 0.2)","rgba(102, 103, 173, 0.7)"],...e})}class v extends d.Control{constructor(e,t={}){const o=document.createElement("div");o.className="level-control ol-unselectable ol-control",super({element:o,target:t.target}),this.indoorEqual=e,this._renderNewLevels(),this.indoorEqual.on("change:levels",this._renderNewLevels.bind(this)),this.indoorEqual.on("change:level",this._renderNewLevels.bind(this))}_renderNewLevels(){this.element.innerHTML="";const e=this.indoorEqual.get("level");this.indoorEqual.get("levels").forEach((t=>{const o=document.createElement("button");e===t&&o.classList.add("level-control-active"),o.textContent=t,o.addEventListener("click",(()=>{this.indoorEqual.set("level",t)})),this.element.appendChild(o)}))}}async function L(e){const t=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"";let o=e+t+".json";var r;return{json:await(await fetch(o,{credentials:"same-origin"})).json(),png:await(r=e+t+".png",new Promise(((e,t)=>{const o=new Image;o.crossOrigin="anonymous",o.onload=function(){o.onload=null,e(o)},o.onerror=t,o.src=r})))}}function b(e,t,o){let r=null;return o&&L(o).then((e=>{t.changed(),r=e})),function(t,o){const n=t.getProperties();return"area"===n.layer?function(e,t){const o=e.getProperties();if("level"===o.class)return;let r,n="#fdfcfa";return o.access&&["no","private"].includes(o.access)?n="#F2F1F0":o.is_poi&&"corridor"!==o.class?n="#D4EDFF":"room"===o.class&&(n="#fefee2"),["area","corridor","platform"].includes(o.class)&&(r=new h.Stroke({color:"#bfbfbf",width:1})),"column"===o.class&&(n="#bfbfbf"),["room","wall"].includes(o.class)&&(r=new h.Stroke({color:"gray",width:2})),new h.Style({fill:new h.Fill({color:n}),stroke:r})}(t):"transportation"===n.layer?new h.Style({stroke:new h.Stroke({color:"gray",width:2,lineDash:[4,7]})}):"area_name"===n.layer?function(e,t){return new h.Style({text:new h.Text({font:"13px Noto Sans Regular, sans-serif",text:e.getProperties().name,fill:new h.Fill({color:"#666"}),stroke:new h.Stroke({color:"white",width:1})})})}(t):"poi"===n.layer?function(e,t,o,r){const n=e.getProperties();if(o.getView().getZoomForResolution(t)<19&&["waste_basket","information","vending_machine"].includes(n.class))return;let i;if(r){const e=r.json["indoorequal-"+n.subclass]||r.json["indoorequal-"+n.class];e&&(i=new h.Icon({img:r.png,size:[e.width,e.height],offset:[e.x,e.y]}))}return new h.Style({text:new h.Text({font:"11px Noto Sans Regular, sans-serif",text:n.name,fill:new h.Fill({color:"#666"}),offsetY:18,stroke:new h.Stroke({color:"white",width:1})}),image:i})}(t,o,e,r):void 0}}function S(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x={exports:{}};function T(e,t=100,o={}){if("function"!=typeof e)throw new TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`);if(t<0)throw new RangeError("`wait` must not be negative.");const{immediate:r}="boolean"==typeof o?{immediate:o}:o;let n,i,l,s,a;function c(){const o=Date.now()-s;if(o=0)l=setTimeout(c,t-o);else if(l=void 0,!r){const t=n,o=i;n=void 0,i=void 0,a=e.apply(t,o)}}const u=function(...o){if(n&&this!==n)throw new Error("Debounced method called with different contexts.");n=this,i=o,s=Date.now();const u=r&&!l;if(l||(l=setTimeout(c,t)),u){const t=n,o=i;n=void 0,i=void 0,a=e.apply(t,o)}return a};return u.clear=()=>{l&&(clearTimeout(l),l=void 0)},u.flush=()=>{if(!l)return;const t=n,o=i;n=void 0,i=void 0,a=e.apply(t,o),clearTimeout(l),l=void 0},u}x.exports.debounce=T,x.exports=T;var q=S(x.exports);e.LevelControl=v,e.default=class extends f{constructor(e,t={}){const o={url:"https://tiles.indoorequal.org/",defaultStyle:!0,spriteBaseUrl:null,heatmap:!0},r={...o,...t};if(r.url===o.url&&!r.apiKey)throw"You must register your apiKey at https://indoorequal.com before and set it as apiKey param.";super({levels:[],level:"0"}),this.map=e,this.url=r.url,this.apiKey=r.apiKey,this._createLayers(r.heatmap),this._loadSource(),this.styleFunction=r.defaultStyle?b(this.map,this.indoorLayer,r.spriteBaseUrl):null,this._changeLayerOnLevelChange(),this._setLayerStyle(),this._resetLevelOnLevelsChange()}setStyle(e){this.styleFunction=e}setHeatmapVisible(e){this.heatmapLayer.setVisible(e)}async _loadSource(){const e=this.apiKey?`?key=${this.apiKey}`:"";this.source=await p(`${this.url}${e}`),this.indoorLayer.setSource(this.source),this.heatmapLayer.setSource(function(e){const t=e.getTileGrid(),o=new l({loader(t,r,n,i,l){const s=()=>{const r=e.getFeaturesInExtent(t);o.clear(!0),o.addFeatures(r),i(r)};e.on("tileloadend",s),s()},loadingstrategy:u.tile(t)});return o}(this.source)),this._listenForLevels()}_createLayers(e){this.indoorLayer=m(),this.heatmapLayer=w({visible:e}),[this.indoorLayer,this.heatmapLayer].forEach((e=>{this.map.addLayer(e)}))}_listenForLevels(){const e=this.source,t=q((()=>{const t=this.map.getView().calculateExtent(this.map.getSize()),o=e.getFeaturesInExtent(t);this.set("levels",function(e){const t=[];for(let o=0;oe-t)).reverse()}(o))}),1e3);e.on("tileloadend",(()=>t())),this.map.getView().on("change:center",(()=>t()))}_changeLayerOnLevelChange(){this.on("change:level",(()=>{this.indoorLayer.changed()}))}_setLayerStyle(){this.indoorLayer.setStyle(((e,t)=>{if(e.getProperties().level===this.get("level"))return this.styleFunction&&this.styleFunction(e,t)}))}_resetLevelOnLevelsChange(){this.on("change:levels",(()=>{this.get("levels").includes(this.get("level"))||this.set("level","0")}))}},e.defaultStyle=b,e.getHeatmapLayer=w,e.getLayer=m,e.loadSourceFromTileJSON=p,Object.defineProperty(e,"__esModule",{value:!0})})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ol/Feature"),require("ol/layer/Heatmap"),require("ol/format/MVT"),require("ol/tilegrid/TileGrid"),require("ol/source/TileJSON"),require("ol/source/Vector"),require("ol/layer/VectorTile"),require("ol/source/VectorTile"),require("ol/proj"),require("ol/loadingstrategy"),require("ol/control"),require("ol/style"),require("ol/Object")):"function"==typeof define&&define.amd?define(["exports","ol/Feature","ol/layer/Heatmap","ol/format/MVT","ol/tilegrid/TileGrid","ol/source/TileJSON","ol/source/Vector","ol/layer/VectorTile","ol/source/VectorTile","ol/proj","ol/loadingstrategy","ol/control","ol/style","ol/Object"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).IndoorEqual={},e.ol.Feature,e.ol.layer.Heatmap,e.ol.format.MVT,e.ol.tilegrid.TileGrid,e.ol.source.TileJSON,e.ol.source.Vector,e.ol.layer.VectorTile,e.ol.source.VectorTile,e.ol.proj,e.ol.loadingstrategy,e.ol.control,e.ol.style,e.ol.Object)}(this,(function(e,t,o,r,n,i,l,s,a,c,u,d,h,f){"use strict";const g=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function y(e){const o=e.getTileJSON(),i=Array.isArray(o.tiles)?o.tiles:[o.tiles],l=e.getTileGrid(),s=function(e){const t=e.bounds;if(t){const e=c.fromLonLat([t[0],t[1]]),o=c.fromLonLat([t[2],t[3]]);return[e[0],e[1],o[0],o[1]]}}(o),u=o.minzoom,d=o.maxzoom;return new a({attributions:e.getAttributions(),format:new r({featureClass:t}),tileGrid:new n({origin:l.getOrigin(0),extent:s||l.getExtent(),minZoom:u,resolutions:g.slice(0,d+1),tileSize:512}),urls:i})}async function p(e){const t=await function(e){return new Promise(((t,o)=>{const r=new i({url:e});r.on("change",(function(){"ready"===r.getState()&&t(r)})),"ready"===r.getState()&&r.changed()}))}(e);return y(t)}function m(e){return new s({declutter:!0,...e})}function w(e){return new o({maxZoom:17,gradient:["rgba(102, 103, 173, 0)","rgba(102, 103, 173, 0.2)","rgba(102, 103, 173, 0.7)"],...e})}class v extends d.Control{constructor(e,t={}){const o=document.createElement("div");o.className="level-control ol-unselectable ol-control",super({element:o,target:t.target}),this.indoorEqual=e,this._renderNewLevels(),this.indoorEqual.on("change:levels",this._renderNewLevels.bind(this)),this.indoorEqual.on("change:level",this._renderNewLevels.bind(this))}_renderNewLevels(){this.element.innerHTML="";const e=this.indoorEqual.get("level");this.indoorEqual.get("levels").forEach((t=>{const o=document.createElement("button");e===t&&o.classList.add("level-control-active"),o.textContent=t,o.addEventListener("click",(()=>{this.indoorEqual.set("level",t)})),this.element.appendChild(o)}))}}async function L(e){const t=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"";let o=e+t+".json";var r;return{json:await(await fetch(o,{credentials:"same-origin"})).json(),png:await(r=e+t+".png",new Promise(((e,t)=>{const o=new Image;o.crossOrigin="anonymous",o.onload=function(){o.onload=null,e(o)},o.onerror=t,o.src=r})))}}function b(e,t,o){let r=null;return o&&L(o).then((e=>{t.changed(),r=e})),function(t,o){const n=t.getProperties();return"area"===n.layer?function(e){const t=e.getProperties();if("level"===t.class)return;let o,r="#fdfcfa";return t.access&&["no","private"].includes(t.access)?r="#F2F1F0":t.is_poi&&"corridor"!==t.class?r="#D4EDFF":"room"===t.class&&(r="#fefee2"),["area","corridor","platform"].includes(t.class)&&(o=new h.Stroke({color:"#bfbfbf",width:1})),"column"===t.class&&(r="#bfbfbf"),["room","wall"].includes(t.class)&&(o=new h.Stroke({color:"gray",width:2})),new h.Style({fill:new h.Fill({color:r}),stroke:o})}(t):"transportation"===n.layer?new h.Style({stroke:new h.Stroke({color:"gray",width:2,lineDash:[4,7]})}):"area_name"===n.layer?function(e){return new h.Style({text:new h.Text({font:"13px Noto Sans Regular, sans-serif",text:e.getProperties().name,fill:new h.Fill({color:"#666"}),stroke:new h.Stroke({color:"white",width:1})})})}(t):"poi"===n.layer?function(e,t,o,r){const n=e.getProperties();if(o.getView().getZoomForResolution(t)<19&&["waste_basket","information","vending_machine"].includes(n.class))return;let i;if(r){const e=r.json["indoorequal-"+n.subclass]||r.json["indoorequal-"+n.class];e&&(i=new h.Icon({img:r.png,size:[e.width,e.height],offset:[e.x,e.y]}))}return new h.Style({text:new h.Text({font:"11px Noto Sans Regular, sans-serif",text:n.name,fill:new h.Fill({color:"#666"}),offsetY:18,stroke:new h.Stroke({color:"white",width:1})}),image:i})}(t,o,e,r):void 0}}function S(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x={exports:{}};function T(e,t=100,o={}){if("function"!=typeof e)throw new TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`);if(t<0)throw new RangeError("`wait` must not be negative.");const{immediate:r}="boolean"==typeof o?{immediate:o}:o;let n,i,l,s,a;function c(){const t=n,o=i;return n=void 0,i=void 0,a=e.apply(t,o),a}function u(){const e=Date.now()-s;e=0?l=setTimeout(u,t-e):(l=void 0,r||(a=c()))}const d=function(...e){if(n&&this!==n)throw new Error("Debounced method called with different contexts.");n=this,i=e,s=Date.now();const o=r&&!l;return l||(l=setTimeout(u,t)),o&&(a=c()),a};return d.clear=()=>{l&&(clearTimeout(l),l=void 0)},d.flush=()=>{l&&d.trigger()},d.trigger=()=>{a=c(),d.clear()},d}x.exports.debounce=T,x.exports=T;var q=S(x.exports);e.LevelControl=v,e.default=class extends f{constructor(e,t={}){const o={url:"https://tiles.indoorequal.org/",defaultStyle:!0,spriteBaseUrl:null,heatmap:!0},r={...o,...t};if(r.url===o.url&&!r.apiKey)throw"You must register your apiKey at https://indoorequal.com before and set it as apiKey param.";super({levels:[],level:"0"}),this.map=e,this.url=r.url,this.apiKey=r.apiKey,this._createLayers(r.heatmap),this._loadSource(),this.styleFunction=r.defaultStyle?b(this.map,this.indoorLayer,r.spriteBaseUrl):null,this._changeLayerOnLevelChange(),this._setLayerStyle(),this._resetLevelOnLevelsChange()}setStyle(e){this.styleFunction=e}setHeatmapVisible(e){this.heatmapLayer.setVisible(e)}async _loadSource(){const e=this.apiKey?`?key=${this.apiKey}`:"";this.source=await p(`${this.url}${e}`),this.indoorLayer.setSource(this.source),this.heatmapLayer.setSource(function(e){const t=e.getSource().getTileGrid(),o=new l({loader(t,r,n,i,l){const s=()=>{const r=e.getFeaturesInExtent(t);o.clear(!0),o.addFeatures(r),i(r)};e.getSource().on("tileloadend",s),s()},loadingstrategy:u.tile(t)});return o}(this.indoorLayer)),this._listenForLevels()}_createLayers(e){this.indoorLayer=m(),this.heatmapLayer=w({visible:e}),[this.indoorLayer,this.heatmapLayer].forEach((e=>{this.map.addLayer(e)}))}_listenForLevels(){const e=this.indoorLayer,t=this.source,o=q((()=>{const t=this.map.getView().calculateExtent(this.map.getSize()),o=e.getFeaturesInExtent(t);this.set("levels",function(e){const t=[];for(let o=0;oe-t)).reverse()}(o))}),1e3);t.on("tileloadend",(()=>o())),this.map.getView().on("change:center",(()=>o()))}_changeLayerOnLevelChange(){this.on("change:level",(()=>{this.indoorLayer.changed()}))}_setLayerStyle(){this.indoorLayer.setStyle(((e,t)=>{if(e.getProperties().level===this.get("level"))return this.styleFunction&&this.styleFunction(e,t)}))}_resetLevelOnLevelsChange(){this.on("change:levels",(()=>{this.get("levels").includes(this.get("level"))||this.set("level","0")}))}},e.defaultStyle=b,e.getHeatmapLayer=w,e.getLayer=m,e.loadSourceFromTileJSON=p,Object.defineProperty(e,"__esModule",{value:!0})})); +//# sourceMappingURL=openlayers-indoorequal.umd.min.js.map diff --git a/dist/openlayers-indoorequal.umd.min.js.map b/dist/openlayers-indoorequal.umd.min.js.map new file mode 100644 index 0000000..4e2ec5c --- /dev/null +++ b/dist/openlayers-indoorequal.umd.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"openlayers-indoorequal.umd.min.js","sources":["../src/layer.js","../src/level_control.js","../src/defaultstyle.js","../node_modules/debounce/index.js","../src/indoorequal.js","../src/levels.js"],"sourcesContent":["import Feature from 'ol/Feature';\nimport HeatmapLayer from 'ol/layer/Heatmap';\nimport MVT from 'ol/format/MVT';\nimport TileGrid from 'ol/tilegrid/TileGrid';\nimport TileJSON from 'ol/source/TileJSON';\nimport VectorSource from 'ol/source/Vector';\nimport VectorTileLayer from 'ol/layer/VectorTile';\nimport VectorTileSource from 'ol/source/VectorTile';\nimport { fromLonLat } from 'ol/proj';\nimport { tile } from 'ol/loadingstrategy';\n\nconst MIN_ZOOM_INDOOR = 17;\nconst MAX_ZOOM_HEATMAP = MIN_ZOOM_INDOOR;\n\nfunction extentFromTileJSON(tileJSON) {\n const bounds = tileJSON.bounds;\n if (bounds) {\n const ll = fromLonLat([bounds[0], bounds[1]]);\n const tr = fromLonLat([bounds[2], bounds[3]]);\n return [ll[0], ll[1], tr[0], tr[1]];\n }\n}\n\nconst defaultResolutions = (function () {\n const resolutions = [];\n for (let res = 78271.51696402048; resolutions.length <= 24; res /= 2) {\n resolutions.push(res);\n }\n return resolutions;\n})();\n\nfunction createSourceFromTileJSON(tilejson) {\n const tileJSONDoc = tilejson.getTileJSON();\n const tiles = Array.isArray(tileJSONDoc.tiles)\n ? tileJSONDoc.tiles\n : [tileJSONDoc.tiles];\n const tileGrid = tilejson.getTileGrid();\n const extent = extentFromTileJSON(tileJSONDoc);\n const minZoom = tileJSONDoc.minzoom;\n const maxZoom = tileJSONDoc.maxzoom;\n return new VectorTileSource({\n attributions: tilejson.getAttributions(),\n format: new MVT({\n featureClass: Feature,\n }),\n tileGrid: new TileGrid({\n origin: tileGrid.getOrigin(0),\n extent: extent || tileGrid.getExtent(),\n minZoom: minZoom,\n resolutions: defaultResolutions.slice(0, maxZoom + 1),\n tileSize: 512,\n }),\n urls: tiles,\n });\n}\n\nfunction loadTileJSON(url) {\n return new Promise((resolve, reject) => {\n const tilejson = new TileJSON({ url });\n tilejson.on('change', function () {\n const state = tilejson.getState();\n if (state === 'ready') {\n resolve(tilejson);\n }\n });\n if (tilejson.getState() === 'ready') {\n tilejson.changed();\n }\n });\n}\n\nexport async function loadSourceFromTileJSON(url) {\n const tilejson = await loadTileJSON(url);\n return createSourceFromTileJSON(tilejson);\n}\n\nexport function getLayer(options) {\n return new VectorTileLayer({\n declutter: true,\n ...options,\n });\n}\n\nexport function createHeatmapSource(indoorLayer) {\n const tilegrid = indoorLayer.getSource().getTileGrid();\n const vectorSource = new VectorSource({\n loader(extent, resolution, projection, success, failure) {\n const refresh = () => {\n const features = indoorLayer.getFeaturesInExtent(extent);\n vectorSource.clear(true);\n vectorSource.addFeatures(features);\n success(features);\n }\n indoorLayer.getSource().on('tileloadend', refresh);\n refresh();\n },\n loadingstrategy: tile(tilegrid)\n });\n return vectorSource;\n}\n\nexport function getHeatmapLayer(options) {\n return new HeatmapLayer({\n maxZoom: MAX_ZOOM_HEATMAP,\n gradient: [\n 'rgba(102, 103, 173, 0)',\n 'rgba(102, 103, 173, 0.2)',\n 'rgba(102, 103, 173, 0.7)'\n ],\n ...options,\n });\n}\n","import { Control } from 'ol/control';\n\n/**\n * A control to display the available levels\n * @param {IndoorEqual} indoorEqual the IndoorEqual instance\n * @param {Object} options\n * @param {string} [options.target] Specify a target if you want the control to be rendered outside of the map's viewport.\n * @return {LevelControl} `this`\n */\nexport default class LevelControl extends Control {\n constructor(indoorEqual, options = {}) {\n const element = document.createElement('div');\n element.className = 'level-control ol-unselectable ol-control';\n super({\n element,\n target: options.target,\n });\n\n this.indoorEqual = indoorEqual;\n this._renderNewLevels();\n this.indoorEqual.on('change:levels', this._renderNewLevels.bind(this));\n this.indoorEqual.on('change:level', this._renderNewLevels.bind(this));\n }\n\n _renderNewLevels() {\n this.element.innerHTML = '';\n const currentLevel = this.indoorEqual.get('level');\n this.indoorEqual.get('levels').forEach((level) => {\n const button = document.createElement('button');\n if (currentLevel === level) {\n button.classList.add('level-control-active');\n }\n button.textContent = level;\n button.addEventListener('click', () => {\n this.indoorEqual.set('level', level);\n })\n this.element.appendChild(button);\n });\n }\n}\n","import { Fill, Stroke, Text, Icon, Style } from 'ol/style';\n\nfunction areaLayer(feature, resolution) {\n const properties = feature.getProperties();\n if (properties.class === 'level') {\n return;\n }\n let color = '#fdfcfa';\n if (properties.access && ['no', 'private'].includes(properties.access)) {\n color = '#F2F1F0';\n } else if (properties.is_poi && properties.class !== 'corridor') {\n color = '#D4EDFF';\n } else if (properties.class === 'room') {\n color = '#fefee2';\n }\n\n let stroke;\n\n if (['area', 'corridor', 'platform'].includes(properties.class)) {\n stroke = new Stroke({\n color: '#bfbfbf',\n width: 1\n });\n }\n if (properties.class === 'column') {\n color = '#bfbfbf';\n }\n if (['room', 'wall'].includes(properties.class)) {\n stroke = new Stroke({\n color: 'gray',\n width: 2\n })\n }\n\n return new Style({\n fill: new Fill({ color }),\n stroke,\n });\n}\n\nfunction transportationLayer(feature, resolution) {\n return new Style({\n stroke: new Stroke({\n color: 'gray',\n width: 2,\n lineDash: [4, 7]\n })\n });\n}\n\nfunction areanameLayer(feature, resolution) {\n return new Style({\n text: new Text({\n font: '13px Noto Sans Regular, sans-serif',\n text: feature.getProperties().name,\n fill: new Fill({ color: '#666' }),\n stroke: new Stroke({\n color: 'white',\n width: 1\n })\n }),\n });\n}\n\nfunction poiLayer(feature, resolution, map, sprite) {\n const properties = feature.getProperties();\n const zoom = map.getView().getZoomForResolution(resolution);\n if (zoom < 19 && ['waste_basket', 'information', 'vending_machine'].includes(properties.class)) {\n return;\n }\n\n let icon;\n if (sprite) {\n const iconDef = sprite.json['indoorequal-'+ properties.subclass] || sprite.json['indoorequal-'+ properties.class];\n\n if (iconDef) {\n icon = new Icon({\n img: sprite.png,\n size: [iconDef.width, iconDef.height],\n offset: [iconDef.x, iconDef.y],\n });\n }\n }\n\n return new Style({\n text: new Text({\n font: '11px Noto Sans Regular, sans-serif',\n text: properties.name,\n fill: new Fill({ color: '#666' }),\n offsetY: 18,\n stroke: new Stroke({\n color: 'white',\n width: 1\n })\n }),\n image: icon,\n });\n}\n\nfunction loadAsImage(spriteImageUrl) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.crossOrigin = 'anonymous';\n img.onload = function () {\n img.onload = null;\n resolve(img);\n };\n img.onerror = reject;\n img.src = spriteImageUrl;\n });\n}\n\nasync function loadSprite(basePath) {\n const spriteScale = window.devicePixelRatio >= 1.5 ? 0.5 : 1;\n const sizeFactor = spriteScale == 0.5 ? '@2x' : '';\n let spriteUrl = basePath + sizeFactor + '.json';\n\n const spriteJSON = await (await fetch(spriteUrl, {credentials: 'same-origin'})).json();\n const spritePNG = await loadAsImage(basePath + sizeFactor + '.png', {credentials: 'same-origin'});\n\n return { json: spriteJSON, png: spritePNG };\n}\n\nexport default function defaultStyle(map, layer, spriteBaseUrl) {\n let sprite = null;\n if (spriteBaseUrl) {\n loadSprite(spriteBaseUrl)\n .then((spriteData) => {\n layer.changed();\n sprite = spriteData;\n });\n }\n\n return function(feature, resolution) {\n const properties = feature.getProperties();\n if (properties.layer === 'area') {\n return areaLayer(feature, resolution);\n }\n if (properties.layer === 'transportation') {\n return transportationLayer(feature, resolution);\n }\n if (properties.layer === 'area_name') {\n return areanameLayer(feature, resolution);\n }\n if (properties.layer === 'poi') {\n return poiLayer(feature, resolution, map, sprite);\n }\n }\n};\n","function debounce(function_, wait = 100, options = {}) {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError(`Expected the first parameter to be a function, got \\`${typeof function_}\\`.`);\n\t}\n\n\tif (wait < 0) {\n\t\tthrow new RangeError('`wait` must not be negative.');\n\t}\n\n\t// TODO: Deprecate the boolean parameter at some point.\n\tconst {immediate} = typeof options === 'boolean' ? {immediate: options} : options;\n\n\tlet storedContext;\n\tlet storedArguments;\n\tlet timeoutId;\n\tlet timestamp;\n\tlet result;\n\n\tfunction run() {\n\t\tconst callContext = storedContext;\n\t\tconst callArguments = storedArguments;\n\t\tstoredContext = undefined;\n\t\tstoredArguments = undefined;\n\t\tresult = function_.apply(callContext, callArguments);\n\t\treturn result;\n\t}\n\n\tfunction later() {\n\t\tconst last = Date.now() - timestamp;\n\n\t\tif (last < wait && last >= 0) {\n\t\t\ttimeoutId = setTimeout(later, wait - last);\n\t\t} else {\n\t\t\ttimeoutId = undefined;\n\n\t\t\tif (!immediate) {\n\t\t\t\tresult = run();\n\t\t\t}\n\t\t}\n\t}\n\n\tconst debounced = function (...arguments_) {\n\t\tif (storedContext && this !== storedContext) {\n\t\t\tthrow new Error('Debounced method called with different contexts.');\n\t\t}\n\n\t\tstoredContext = this; // eslint-disable-line unicorn/no-this-assignment\n\t\tstoredArguments = arguments_;\n\t\ttimestamp = Date.now();\n\n\t\tconst callNow = immediate && !timeoutId;\n\n\t\tif (!timeoutId) {\n\t\t\ttimeoutId = setTimeout(later, wait);\n\t\t}\n\n\t\tif (callNow) {\n\t\t\tresult = run();\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tdebounced.clear = () => {\n\t\tif (!timeoutId) {\n\t\t\treturn;\n\t\t}\n\n\t\tclearTimeout(timeoutId);\n\t\ttimeoutId = undefined;\n\t};\n\n\tdebounced.flush = () => {\n\t\tif (!timeoutId) {\n\t\t\treturn;\n\t\t}\n\n\t\tdebounced.trigger();\n\t};\n\n\tdebounced.trigger = () => {\n\t\tresult = run();\n\n\t\tdebounced.clear();\n\t};\n\n\treturn debounced;\n}\n\n// Adds compatibility for ES modules\nmodule.exports.debounce = debounce;\n\nmodule.exports = debounce;\n","import BaseObject from 'ol/Object';\nimport debounce from 'debounce';\n\nimport { loadSourceFromTileJSON, getLayer, getHeatmapLayer, createHeatmapSource } from './layer';\nimport findAllLevels from './levels';\nimport defaultStyle from './defaultstyle';\n\n/**\n * Load the indoor= source and layers in your map.\n * @param {Object} map the OpenLayers instance of the map\n * @param {Object} options\n * @param {boolean} [options.defaultStyle] False to not set the default style. Default true.\n * @param {string} [options.spriteBaseUrl] The base url of the sprite (without .json or .png). If not set, no sprite will be used in the default style.\n * @param {string} [options.url] Override the default tiles URL (https://tiles.indoorequal.org/).\n * @param {string} [options.apiKey] The API key if you use the default tile URL (get your free key at [indoorequal.com](https://indoorequal.com)).\n * @param {boolean} [options.heatmap] Should the heatmap layer be visible at start (true : visible, false : hidden). Defaults to true/visible.\n * @fires change:levels\n * @fires change:level\n * @return {IndoorEqual} `this`\n */\nexport default class IndoorEqual extends BaseObject {\n constructor(map, options = {}) {\n const defaultOpts = { url: 'https://tiles.indoorequal.org/', defaultStyle: true, spriteBaseUrl: null, heatmap: true };\n const opts = { ...defaultOpts, ...options };\n if (opts.url === defaultOpts.url && !opts.apiKey) {\n throw 'You must register your apiKey at https://indoorequal.com before and set it as apiKey param.';\n }\n super({ levels: [], level: '0' });\n\n this.map = map;\n this.url = opts.url;\n this.apiKey = opts.apiKey;\n\n this._createLayers(opts.heatmap);\n this._loadSource();\n this.styleFunction = opts.defaultStyle ? defaultStyle(this.map, this.indoorLayer, opts.spriteBaseUrl) : null;\n this._changeLayerOnLevelChange();\n this._setLayerStyle();\n this._resetLevelOnLevelsChange();\n }\n\n /**\n * Set the style for displayed features. This function takes a feature and resolution and returns an array of styles. If set to null, the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. Call setStyle() without arguments to reset to the default style. See module:ol/style for information on the default style.\n * @param {function} styleFunction the style function\n */\n setStyle(styleFunction) {\n this.styleFunction = styleFunction;\n }\n\n /**\n * Change the heatmap layer visibility\n * @param {boolean} visible True to make it visible, false to hide it\n */\n setHeatmapVisible(visible) {\n this.heatmapLayer.setVisible(visible);\n }\n\n async _loadSource() {\n const urlParams = this.apiKey ? `?key=${this.apiKey}` : '';\n this.source = await loadSourceFromTileJSON(`${this.url}${urlParams}`);\n\n this.indoorLayer.setSource(this.source);\n this.heatmapLayer.setSource(createHeatmapSource(this.indoorLayer));\n this._listenForLevels();\n }\n\n _createLayers(heatmapVisible) {\n this.indoorLayer = getLayer();\n this.heatmapLayer = getHeatmapLayer({ visible: heatmapVisible });\n [this.indoorLayer, this.heatmapLayer].forEach((layer) => {\n this.map.addLayer(layer);\n });\n }\n\n _listenForLevels() {\n const layer = this.indoorLayer;\n const source = this.source;\n\n const refreshLevels = debounce(() => {\n const extent = this.map.getView().calculateExtent(this.map.getSize());\n const features = layer.getFeaturesInExtent(extent);\n this.set('levels', findAllLevels(features));\n }, 1000);\n\n source.on('tileloadend', () => refreshLevels());\n this.map.getView().on('change:center', () => refreshLevels());\n }\n\n _changeLayerOnLevelChange() {\n this.on('change:level', () => {\n this.indoorLayer.changed();\n });\n }\n\n _setLayerStyle() {\n this.indoorLayer.setStyle((feature, resolution) => {\n if (feature.getProperties().level === this.get('level')) {\n return this.styleFunction && this.styleFunction(feature, resolution);\n }\n });\n }\n\n _resetLevelOnLevelsChange() {\n this.on('change:levels', () => {\n if (!this.get('levels').includes(this.get('level'))) {\n this.set('level', '0');\n }\n });\n }\n}\n\n/**\n * Emitted when the list of available levels has been updated\n *\n * @event IndoorEqual#change:levels\n * @type {Array}\n */\n\n/**\n * Emitted when the current level has been updated\n *\n * @event IndoorEqual#change:level\n * @type {string} always emitted when the level displayed has changed\n */\n","export default function findAllLevels(features) {\n const levels = [];\n for (let i = 0; i < features.length; i++) {\n const feature = features[i];\n const properties = feature.getProperties();\n if (properties.layer !== 'area' || properties.class === 'level') {\n continue;\n }\n const level = properties.level;\n if (!levels.includes(level)) {\n levels.push(level);\n }\n }\n return levels.sort((a, b) => a - b).reverse();\n}\n"],"names":["defaultResolutions","resolutions","res","length","push","createSourceFromTileJSON","tilejson","tileJSONDoc","getTileJSON","tiles","Array","isArray","tileGrid","getTileGrid","extent","tileJSON","bounds","ll","fromLonLat","tr","extentFromTileJSON","minZoom","minzoom","maxZoom","maxzoom","VectorTileSource","attributions","getAttributions","format","MVT","featureClass","Feature","TileGrid","origin","getOrigin","getExtent","slice","tileSize","urls","async","loadSourceFromTileJSON","url","Promise","resolve","reject","TileJSON","on","getState","changed","loadTileJSON","getLayer","options","VectorTileLayer","declutter","getHeatmapLayer","HeatmapLayer","gradient","LevelControl","Control","constructor","indoorEqual","element","document","createElement","className","super","target","this","_renderNewLevels","bind","innerHTML","currentLevel","get","forEach","level","button","classList","add","textContent","addEventListener","set","appendChild","loadSprite","basePath","sizeFactor","window","devicePixelRatio","spriteUrl","spriteImageUrl","json","fetch","credentials","png","img","Image","crossOrigin","onload","onerror","src","defaultStyle","map","layer","spriteBaseUrl","sprite","then","spriteData","feature","resolution","properties","getProperties","class","stroke","color","access","includes","is_poi","Stroke","width","Style","fill","Fill","areaLayer","lineDash","text","Text","font","name","areanameLayer","getView","getZoomForResolution","icon","iconDef","subclass","Icon","size","height","offset","x","y","offsetY","image","poiLayer","debounce","function_","wait","TypeError","RangeError","immediate","storedContext","storedArguments","timeoutId","timestamp","result","run","callContext","callArguments","undefined","apply","later","last","Date","now","setTimeout","debounced","arguments_","Error","callNow","clear","clearTimeout","flush","trigger","debounceModule","exports","module","BaseObject","defaultOpts","heatmap","opts","apiKey","levels","_createLayers","_loadSource","styleFunction","indoorLayer","_changeLayerOnLevelChange","_setLayerStyle","_resetLevelOnLevelsChange","setStyle","setHeatmapVisible","visible","heatmapLayer","setVisible","urlParams","source","setSource","tilegrid","getSource","vectorSource","VectorSource","loader","projection","success","failure","refresh","features","getFeaturesInExtent","addFeatures","loadingstrategy","tile","createHeatmapSource","_listenForLevels","heatmapVisible","addLayer","refreshLevels","calculateExtent","getSize","i","sort","a","b","reverse","findAllLevels"],"mappings":"+hCAuBA,MAAMA,EAAsB,WAC1B,MAAMC,EAAc,GACpB,IAAK,IAAIC,EAAM,kBAAmBD,EAAYE,QAAU,GAAID,GAAO,EACjED,EAAYG,KAAKF,GAEnB,OAAOD,CACT,CAN4B,GAQ5B,SAASI,EAAyBC,GAChC,MAAMC,EAAcD,EAASE,cACvBC,EAAQC,MAAMC,QAAQJ,EAAYE,OAChCF,EAAYE,MACZ,CAACF,EAAYE,OACfG,EAAWN,EAASO,cACpBC,EAvBR,SAA4BC,GAC1B,MAAMC,EAASD,EAASC,OACxB,GAAIA,EAAQ,CACV,MAAMC,EAAKC,EAAUA,WAAC,CAACF,EAAO,GAAIA,EAAO,KACnCG,EAAKD,EAAUA,WAAC,CAACF,EAAO,GAAIA,EAAO,KACzC,MAAO,CAACC,EAAG,GAAIA,EAAG,GAAIE,EAAG,GAAIA,EAAG,GAClC,CACF,CAgBiBC,CAAmBb,GAC5Bc,EAAUd,EAAYe,QACtBC,EAAUhB,EAAYiB,QAC5B,OAAO,IAAIC,EAAiB,CAC1BC,aAAcpB,EAASqB,kBACvBC,OAAQ,IAAIC,EAAI,CACdC,aAAcC,IAEhBnB,SAAU,IAAIoB,EAAS,CACrBC,OAAQrB,EAASsB,UAAU,GAC3BpB,OAAQA,GAAUF,EAASuB,YAC3Bd,QAASA,EACTpB,YAAaD,EAAmBoC,MAAM,EAAGb,EAAU,GACnDc,SAAU,MAEZC,KAAM7B,GAEV,CAiBO8B,eAAeC,EAAuBC,GAC3C,MAAMnC,QAhBR,SAAsBmC,GACpB,OAAO,IAAIC,SAAQ,CAACC,EAASC,KAC3B,MAAMtC,EAAW,IAAIuC,EAAS,CAAEJ,QACh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ImH,WACrDX,EAAWvG,EAAMwG,oBAAoB/L,GAC3CqD,KAAKa,IAAI,SCjFA,SAAuB4H,GACpC,MAAMzB,EAAS,GACf,IAAK,IAAIqC,EAAI,EAAGA,EAAIZ,EAASzM,OAAQqN,IAAK,CACxC,MACM5G,EADUgG,EAASY,GACE3G,gBAC3B,GAAyB,SAArBD,EAAWP,OAAyC,UAArBO,EAAWE,MAC5C,SAEF,MAAMpC,EAAQkC,EAAWlC,MACpByG,EAAOjE,SAASxC,IACnByG,EAAO/K,KAAKsE,EAEhB,CACA,OAAOyG,EAAOsC,MAAK,CAACC,EAAGC,IAAMD,EAAIC,IAAGC,SACtC,CDmEyBC,CAAcjB,GAAU,GAC1C,KAEHX,EAAOnJ,GAAG,eAAe,IAAMuK,MAC/BlJ,KAAKiC,IAAI4B,UAAUlF,GAAG,iBAAiB,IAAMuK,KAC/C,CAEA7B,yBAAAA,GACErH,KAAKrB,GAAG,gBAAgB,KACtBqB,KAAKoH,YAAYvI,SAAS,GAE9B,CAEAyI,cAAAA,GACEtH,KAAKoH,YAAYI,UAAS,CAACjF,EAASC,KAClC,GAAID,EAAQG,gBAAgBnC,QAAUP,KAAKK,IAAI,SAC7C,OAAOL,KAAKmH,eAAiBnH,KAAKmH,cAAc5E,EAASC,EAC3D,GAEJ,CAEA+E,yBAAAA,GACEvH,KAAKrB,GAAG,iBAAiB,KAClBqB,KAAKK,IAAI,UAAU0C,SAAS/C,KAAKK,IAAI,WACxCL,KAAKa,IAAI,QAAS,IACpB,GAEJ","x_google_ignoreList":[3]} \ No newline at end of file diff --git a/package.json b/package.json index dc58a1d..4edb004 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openlayers-indoorequal", - "version": "0.1.3", + "version": "0.2.0-rc1", "description": "Integrate indoor= into your OpenLayers map.", "repository": "https://github.com/indoorequal/openlayers-indoorequal", "author": "François de Metz",