ol 10.7.1 → 10.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Collection.d.ts +1 -3
- package/Collection.d.ts.map +1 -1
- package/Feature.d.ts +6 -15
- package/Feature.d.ts.map +1 -1
- package/Feature.js +3 -6
- package/Geolocation.d.ts +1 -3
- package/Geolocation.d.ts.map +1 -1
- package/ImageTile.d.ts +2 -12
- package/ImageTile.d.ts.map +1 -1
- package/ImageTile.js +5 -32
- package/Map.d.ts +7 -27
- package/Map.d.ts.map +1 -1
- package/Map.js +3 -29
- package/Object.d.ts +18 -15
- package/Object.d.ts.map +1 -1
- package/Object.js +6 -9
- package/Overlay.d.ts +1 -3
- package/Overlay.d.ts.map +1 -1
- package/VectorRenderTile.d.ts +0 -4
- package/VectorRenderTile.d.ts.map +1 -1
- package/VectorRenderTile.js +0 -2
- package/View.d.ts +1 -40
- package/View.d.ts.map +1 -1
- package/View.js +0 -94
- package/colorlike.js +8 -4
- package/control/Control.d.ts +1 -3
- package/control/Control.d.ts.map +1 -1
- package/control/OverviewMap.d.ts +1 -5
- package/control/OverviewMap.d.ts.map +1 -1
- package/coordinate.d.ts +0 -8
- package/coordinate.d.ts.map +1 -1
- package/coordinate.js +1 -31
- package/dist/ol.d.ts +0 -24
- package/dist/ol.d.ts.map +1 -1
- package/dist/ol.js +1 -1
- package/dist/ol.js.map +1 -1
- package/dom.d.ts +0 -15
- package/dom.d.ts.map +1 -1
- package/dom.js +0 -6
- package/featureloader.d.ts +2 -6
- package/featureloader.d.ts.map +1 -1
- package/format/EsriJSON.d.ts +1 -3
- package/format/EsriJSON.d.ts.map +1 -1
- package/format/Feature.d.ts +1 -3
- package/format/Feature.d.ts.map +1 -1
- package/format/GeoJSON.d.ts +2 -6
- package/format/GeoJSON.d.ts.map +1 -1
- package/format/JSONFeature.d.ts +1 -3
- package/format/JSONFeature.d.ts.map +1 -1
- package/format/KML.d.ts +0 -9
- package/format/KML.d.ts.map +1 -1
- package/format/KML.js +0 -7
- package/format/TextFeature.d.ts +1 -3
- package/format/TextFeature.d.ts.map +1 -1
- package/format/TopoJSON.d.ts +1 -3
- package/format/TopoJSON.d.ts.map +1 -1
- package/format/WKB.d.ts +1 -3
- package/format/WKB.d.ts.map +1 -1
- package/format/XMLFeature.d.ts +1 -3
- package/format/XMLFeature.d.ts.map +1 -1
- package/geom/Geometry.d.ts +1 -3
- package/geom/Geometry.d.ts.map +1 -1
- package/interaction/DragAndDrop.d.ts +2 -6
- package/interaction/DragAndDrop.d.ts.map +1 -1
- package/interaction/Draw.d.ts +3 -9
- package/interaction/Draw.d.ts.map +1 -1
- package/interaction/Interaction.d.ts +1 -3
- package/interaction/Interaction.d.ts.map +1 -1
- package/interaction/Link.js +2 -2
- package/interaction/Modify.d.ts +28 -76
- package/interaction/Modify.d.ts.map +1 -1
- package/interaction/Modify.js +54 -248
- package/interaction/Select.d.ts +18 -10
- package/interaction/Select.d.ts.map +1 -1
- package/interaction/Select.js +89 -54
- package/interaction/Snap.d.ts +12 -18
- package/interaction/Snap.d.ts.map +1 -1
- package/interaction/Translate.d.ts +2 -6
- package/interaction/Translate.d.ts.map +1 -1
- package/layer/Base.d.ts +8 -19
- package/layer/Base.d.ts.map +1 -1
- package/layer/Base.js +3 -6
- package/layer/BaseImage.d.ts +1 -3
- package/layer/BaseImage.d.ts.map +1 -1
- package/layer/BaseTile.d.ts +1 -3
- package/layer/BaseTile.d.ts.map +1 -1
- package/layer/BaseVector.d.ts +1 -3
- package/layer/BaseVector.d.ts.map +1 -1
- package/layer/Flow.d.ts +2 -2
- package/layer/Graticule.d.ts +1 -5
- package/layer/Graticule.d.ts.map +1 -1
- package/layer/Group.d.ts +2 -8
- package/layer/Group.d.ts.map +1 -1
- package/layer/Heatmap.d.ts +2 -23
- package/layer/Heatmap.d.ts.map +1 -1
- package/layer/Heatmap.js +0 -29
- package/layer/Layer.d.ts +8 -17
- package/layer/Layer.d.ts.map +1 -1
- package/layer/Layer.js +2 -5
- package/layer/Tile.d.ts +1 -1
- package/layer/Vector.d.ts +2 -2
- package/layer/Vector.d.ts.map +1 -1
- package/layer/VectorImage.d.ts +2 -2
- package/layer/VectorImage.d.ts.map +1 -1
- package/layer/VectorTile.d.ts +2 -2
- package/layer/VectorTile.d.ts.map +1 -1
- package/layer/WebGLPoints.d.ts +1 -3
- package/layer/WebGLPoints.d.ts.map +1 -1
- package/layer/WebGLTile.d.ts +3 -3
- package/layer/WebGLTile.d.ts.map +1 -1
- package/layer/WebGLVector.d.ts +2 -4
- package/layer/WebGLVector.d.ts.map +1 -1
- package/layer/WebGLVectorTile.d.ts +2 -2
- package/layer/WebGLVectorTile.d.ts.map +1 -1
- package/package.json +3 -4
- package/proj/proj4.d.ts +6 -43
- package/proj/proj4.d.ts.map +1 -1
- package/proj/proj4.js +28 -89
- package/proj.js +2 -2
- package/render/canvas/Builder.d.ts.map +1 -1
- package/render/canvas/Builder.js +1 -8
- package/render/canvas/Executor.d.ts.map +1 -1
- package/render/canvas/Executor.js +3 -49
- package/render/canvas/ExecutorGroup.d.ts.map +1 -1
- package/render/canvas/ExecutorGroup.js +5 -41
- package/render/canvas/Immediate.d.ts +0 -2
- package/render/canvas/Immediate.d.ts.map +1 -1
- package/render/canvas/Immediate.js +4 -28
- package/render/canvas/LineStringBuilder.d.ts +0 -1
- package/render/canvas/LineStringBuilder.d.ts.map +1 -1
- package/render/canvas/LineStringBuilder.js +5 -15
- package/render/canvas/PolygonBuilder.d.ts +0 -2
- package/render/canvas/PolygonBuilder.d.ts.map +1 -1
- package/render/canvas/PolygonBuilder.js +6 -72
- package/render/canvas/style.d.ts.map +1 -1
- package/render/canvas/style.js +37 -118
- package/render/canvas.d.ts +2 -22
- package/render/canvas.d.ts.map +1 -1
- package/render/canvas.js +0 -9
- package/render/webgl/bufferUtil.d.ts.map +1 -1
- package/render/webgl/bufferUtil.js +31 -1
- package/renderer/Composite.js +4 -4
- package/renderer/canvas/ImageLayer.d.ts +1 -6
- package/renderer/canvas/ImageLayer.d.ts.map +1 -1
- package/renderer/canvas/ImageLayer.js +0 -14
- package/renderer/canvas/TileLayer.d.ts +1 -1
- package/renderer/canvas/VectorLayer.d.ts +1 -8
- package/renderer/canvas/VectorLayer.d.ts.map +1 -1
- package/renderer/canvas/VectorLayer.js +14 -55
- package/renderer/canvas/VectorTileLayer.d.ts +1 -1
- package/renderer/canvas/VectorTileLayer.d.ts.map +1 -1
- package/renderer/canvas/VectorTileLayer.js +0 -2
- package/renderer/webgl/TileLayerBase.js +1 -1
- package/reproj/Tile.d.ts +2 -7
- package/reproj/Tile.d.ts.map +1 -1
- package/reproj/Tile.js +6 -12
- package/source/Cluster.d.ts +2 -8
- package/source/Cluster.d.ts.map +1 -1
- package/source/DataTile.d.ts +0 -15
- package/source/DataTile.d.ts.map +1 -1
- package/source/DataTile.js +0 -9
- package/source/GeoTIFF.d.ts +2 -7
- package/source/GeoTIFF.d.ts.map +1 -1
- package/source/GeoTIFF.js +10 -15
- package/source/ImageArcGISRest.d.ts +0 -10
- package/source/ImageArcGISRest.d.ts.map +1 -1
- package/source/ImageArcGISRest.js +0 -8
- package/source/ImageMapGuide.d.ts +0 -10
- package/source/ImageMapGuide.d.ts.map +1 -1
- package/source/ImageMapGuide.js +0 -8
- package/source/ImageStatic.d.ts +0 -5
- package/source/ImageStatic.d.ts.map +1 -1
- package/source/ImageStatic.js +0 -2
- package/source/ImageTile.d.ts +1 -5
- package/source/ImageTile.d.ts.map +1 -1
- package/source/ImageTile.js +0 -5
- package/source/ImageWMS.d.ts +0 -10
- package/source/ImageWMS.d.ts.map +1 -1
- package/source/ImageWMS.js +0 -10
- package/source/OGCMapTile.d.ts +0 -5
- package/source/OGCMapTile.d.ts.map +1 -1
- package/source/OGCMapTile.js +0 -2
- package/source/OSM.d.ts +0 -5
- package/source/OSM.d.ts.map +1 -1
- package/source/OSM.js +19 -5
- package/source/SentinelHub.d.ts +0 -1
- package/source/SentinelHub.d.ts.map +1 -1
- package/source/SentinelHub.js +0 -5
- package/source/Source.d.ts +1 -3
- package/source/Source.d.ts.map +1 -1
- package/source/TileArcGISRest.d.ts +1 -6
- package/source/TileArcGISRest.d.ts.map +1 -1
- package/source/TileArcGISRest.js +0 -2
- package/source/TileDebug.d.ts +1 -1
- package/source/TileImage.d.ts +0 -10
- package/source/TileImage.d.ts.map +1 -1
- package/source/TileImage.js +3 -16
- package/source/TileWMS.d.ts +1 -1
- package/source/UrlTile.d.ts +1 -1
- package/source/Vector.d.ts +8 -18
- package/source/Vector.d.ts.map +1 -1
- package/source/Vector.js +3 -3
- package/source/WMTS.d.ts +0 -5
- package/source/WMTS.d.ts.map +1 -1
- package/source/WMTS.js +0 -2
- package/source/XYZ.d.ts +0 -5
- package/source/XYZ.d.ts.map +1 -1
- package/source/XYZ.js +0 -2
- package/source/Zoomify.d.ts +2 -7
- package/source/Zoomify.d.ts.map +1 -1
- package/source/Zoomify.js +3 -5
- package/source/arcgisRest.d.ts +0 -5
- package/source/arcgisRest.d.ts.map +1 -1
- package/source/arcgisRest.js +0 -5
- package/source/mapguide.d.ts +0 -4
- package/source/mapguide.d.ts.map +1 -1
- package/source/mapguide.js +0 -5
- package/source/mapserver.d.ts +1 -5
- package/source/mapserver.d.ts.map +1 -1
- package/source/mapserver.js +0 -4
- package/source/ogcTileUtil.d.ts +12 -20
- package/source/ogcTileUtil.d.ts.map +1 -1
- package/source/ogcTileUtil.js +15 -27
- package/source/static.d.ts +0 -5
- package/source/static.d.ts.map +1 -1
- package/source/static.js +0 -4
- package/source/wms.d.ts +0 -5
- package/source/wms.d.ts.map +1 -1
- package/source/wms.js +0 -5
- package/style/Circle.d.ts +14 -0
- package/style/Circle.d.ts.map +1 -1
- package/style/Circle.js +11 -0
- package/style/Fill.js +1 -1
- package/style/Icon.d.ts +0 -19
- package/style/Icon.d.ts.map +1 -1
- package/style/Icon.js +2 -55
- package/style/IconImage.d.ts +5 -14
- package/style/IconImage.d.ts.map +1 -1
- package/style/IconImage.js +18 -28
- package/style/IconImageCache.d.ts +8 -4
- package/style/IconImageCache.d.ts.map +1 -1
- package/style/IconImageCache.js +13 -11
- package/style/RegularShape.d.ts +0 -12
- package/style/RegularShape.d.ts.map +1 -1
- package/style/RegularShape.js +4 -36
- package/style/Stroke.d.ts +0 -25
- package/style/Stroke.d.ts.map +1 -1
- package/style/Stroke.js +0 -28
- package/style/Style.d.ts +1 -1
- package/style/flat.d.ts +2 -2
- package/style/flat.js +1 -1
- package/tilegrid/TileGrid.d.ts +0 -5
- package/tilegrid/TileGrid.d.ts.map +1 -1
- package/tilegrid/TileGrid.js +0 -8
- package/util.js +1 -1
- package/worker/webgl.js +1 -1
- package/geom/flat/lineoffset.d.ts +0 -45
- package/geom/flat/lineoffset.d.ts.map +0 -1
- package/geom/flat/lineoffset.js +0 -173
- package/source/GeoZarr.d.ts +0 -163
- package/source/GeoZarr.d.ts.map +0 -1
- package/source/GeoZarr.js +0 -472
- package/source/OGCMap.d.ts +0 -180
- package/source/OGCMap.d.ts.map +0 -1
- package/source/OGCMap.js +0 -227
- package/source/ogcMapUtil.d.ts +0 -88
- package/source/ogcMapUtil.d.ts.map +0 -1
- package/source/ogcMapUtil.js +0 -121
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ogcTileUtil.d.ts","sourceRoot":"","sources":["ogcTileUtil.js"],"names":[],"mappings":"AAoGA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,6DAJW,MAAM,eACN,KAAK,CAAC,MAAM,CAAC,GACZ,MAAM,CA6BjB;AAED;;;;;GAKG;AACH,6CALW,KAAK,CAAC,IAAI,CAAC,cACX,MAAM,gBACN,KAAK,CAAC,MAAM,CAAC,GACZ,MAAM,CAiCjB;AAED;;;;;;GAMG;AACH,gDANW,KAAK,CAAC,IAAI,CAAC,cACX,MAAM,wBACN,KAAK,CAAC,MAAM,CAAC,gBACb,KAAK,CAAC,MAAM,CAAC,GACZ,MAAM,CAsDjB;
|
|
1
|
+
{"version":3,"file":"ogcTileUtil.d.ts","sourceRoot":"","sources":["ogcTileUtil.js"],"names":[],"mappings":"AAoGA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,6DAJW,MAAM,eACN,KAAK,CAAC,MAAM,CAAC,GACZ,MAAM,CA6BjB;AAED;;;;;GAKG;AACH,6CALW,KAAK,CAAC,IAAI,CAAC,cACX,MAAM,gBACN,KAAK,CAAC,MAAM,CAAC,GACZ,MAAM,CAiCjB;AAED;;;;;;GAMG;AACH,gDANW,KAAK,CAAC,IAAI,CAAC,cACX,MAAM,wBACN,KAAK,CAAC,MAAM,CAAC,gBACb,KAAK,CAAC,MAAM,CAAC,GACZ,MAAM,CAsDjB;AA0OD;;;GAGG;AACH,2CAHW,UAAU,GACT,OAAO,CAAC,WAAW,CAAC,CAM/B;;;;;iBAtYa,MAAM;;;;gBACN,OAAO,uBAAuB,EAAE,OAAO;;;;UACvC,OAAO,yBAAyB,EAAE,OAAO;;;;iBACzC,OAAO,YAAY,EAAE,WAAW;;;;;;SAKhC,MAAM;;;;eACN,MAAM;;;;;;;;gBAEN,OAAO,uBAAuB,EAAE,OAAO;;;;;;;;;;uBAlGxC,KAAK,GAAG,QAAQ;6BAIhB,SAAS,GAAG,YAAY;;;;;cAKvB,QAAQ;;;;;;;;;;;;;;;;WAIR,KAAK,CAAC,IAAI,CAAC;;;;;;SAKX,MAAM;;;;UACN,MAAM;;;;UACN,MAAM;;;;;;gBAKN,MAAM;;;;gBACN,MAAM;;;;gBACN,MAAM;;;;gBACN,MAAM;;;;gBACN,MAAM;;;;;;QAKN,MAAM;;;;SACN,MAAM,GAAC,MAAM,GAAC,MAAM,GAAC,kBAAkB;;;;;;;;kBAEvC,KAAK,CAAC,UAAU,CAAC;;;;;;SAKjB,MAAM;;;;;;;;;;;;;;;;;;QAeN,MAAM;;;;cACN,MAAM;;;;mBACN,KAAK,CAAC,MAAM,CAAC;;;;;;;;iBAEb,MAAM;;;;kBACN,MAAM;;;;eACN,MAAM;;;;gBACN,MAAM"}
|
package/source/ogcTileUtil.js
CHANGED
|
@@ -6,7 +6,7 @@ import {error as logError} from '../console.js';
|
|
|
6
6
|
import {getIntersection as intersectExtents} from '../extent.js';
|
|
7
7
|
import {getJSON, resolveUrl} from '../net.js';
|
|
8
8
|
import {get as getProjection} from '../proj.js';
|
|
9
|
-
import TileGrid from '../tilegrid/
|
|
9
|
+
import TileGrid from '../tilegrid/TileGrid.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* See https://ogcapi.ogc.org/tiles/.
|
|
@@ -100,18 +100,18 @@ const knownVectorMediaTypes = {
|
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* @typedef {Object} TileSetInfo
|
|
103
|
-
* @property {string}
|
|
103
|
+
* @property {string} urlTemplate The tile URL template.
|
|
104
104
|
* @property {import("../proj/Projection.js").default} projection The source projection.
|
|
105
|
-
* @property {import("../tilegrid/
|
|
106
|
-
* @property {import("../Tile.js").UrlFunction}
|
|
105
|
+
* @property {import("../tilegrid/TileGrid.js").default} grid The tile grid.
|
|
106
|
+
* @property {import("../Tile.js").UrlFunction} urlFunction The tile URL function.
|
|
107
107
|
*/
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* @typedef {Object} SourceInfo
|
|
111
|
-
* @property {string}
|
|
112
|
-
* @property {string}
|
|
111
|
+
* @property {string} url The tile set URL.
|
|
112
|
+
* @property {string} mediaType The preferred tile media type.
|
|
113
113
|
* @property {Array<string>} [supportedMediaTypes] The supported media types.
|
|
114
|
-
* @property {import("../proj/Projection.js").default}
|
|
114
|
+
* @property {import("../proj/Projection.js").default} projection The source projection.
|
|
115
115
|
* @property {Object} [context] Optional context for constructing the URL.
|
|
116
116
|
* @property {Array<string>} [collections] Optional collections to append the URL with.
|
|
117
117
|
*/
|
|
@@ -253,11 +253,11 @@ export function getVectorTileUrlTemplate(
|
|
|
253
253
|
/**
|
|
254
254
|
* @param {SourceInfo} sourceInfo The source info.
|
|
255
255
|
* @param {TileMatrixSet} tileMatrixSet Tile matrix set.
|
|
256
|
-
* @param {string}
|
|
256
|
+
* @param {string} tileUrlTemplate Tile URL template.
|
|
257
257
|
* @param {Array<TileMatrixSetLimit>} [tileMatrixSetLimits] Tile matrix set limits.
|
|
258
258
|
* @return {TileSetInfo} Tile set info.
|
|
259
259
|
*/
|
|
260
|
-
|
|
260
|
+
function parseTileMatrixSet(
|
|
261
261
|
sourceInfo,
|
|
262
262
|
tileMatrixSet,
|
|
263
263
|
tileUrlTemplate,
|
|
@@ -283,9 +283,7 @@ export function parseTileMatrixSet(
|
|
|
283
283
|
: projection.getAxisOrientation();
|
|
284
284
|
const backwards = !axisOrientation.startsWith('en');
|
|
285
285
|
|
|
286
|
-
const matrices = tileMatrixSet.tileMatrices
|
|
287
|
-
return b.cellSize - a.cellSize;
|
|
288
|
-
});
|
|
286
|
+
const matrices = tileMatrixSet.tileMatrices;
|
|
289
287
|
|
|
290
288
|
/**
|
|
291
289
|
* @type {Object<string, TileMatrix>}
|
|
@@ -310,9 +308,7 @@ export function parseTileMatrixSet(
|
|
|
310
308
|
for (let i = 0; i < tileMatrixSetLimits.length; ++i) {
|
|
311
309
|
const limit = tileMatrixSetLimits[i];
|
|
312
310
|
const id = limit.tileMatrix;
|
|
313
|
-
|
|
314
|
-
const zoomLevel = matrices.indexOf(matrix);
|
|
315
|
-
matrixIds[zoomLevel] = id;
|
|
311
|
+
matrixIds.push(id);
|
|
316
312
|
limitLookup[id] = limit;
|
|
317
313
|
}
|
|
318
314
|
} else {
|
|
@@ -365,21 +361,13 @@ export function parseTileMatrixSet(
|
|
|
365
361
|
}
|
|
366
362
|
|
|
367
363
|
const tileGrid = new TileGrid({
|
|
368
|
-
origins,
|
|
369
|
-
resolutions,
|
|
370
|
-
sizes,
|
|
371
|
-
tileSizes,
|
|
364
|
+
origins: origins,
|
|
365
|
+
resolutions: resolutions,
|
|
366
|
+
sizes: sizes,
|
|
367
|
+
tileSizes: tileSizes,
|
|
372
368
|
extent: tileMatrixSetLimits ? extent : undefined,
|
|
373
|
-
matrixIds,
|
|
374
369
|
});
|
|
375
370
|
|
|
376
|
-
if (!tileUrlTemplate) {
|
|
377
|
-
return {
|
|
378
|
-
grid: tileGrid,
|
|
379
|
-
projection: projection,
|
|
380
|
-
};
|
|
381
|
-
}
|
|
382
|
-
|
|
383
371
|
const context = sourceInfo.context;
|
|
384
372
|
const base = sourceInfo.url;
|
|
385
373
|
|
package/source/static.d.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
|
|
4
4
|
* you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.
|
|
5
5
|
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
6
|
-
* @property {ReferrerPolicy} [referrerPolicy] The `referrerPolicy` property for loaded images.
|
|
7
6
|
* @property {import("../extent.js").Extent} imageExtent Extent of the image in map coordinates.
|
|
8
7
|
* This is the [left, bottom, right, top] map coordinates of your image. When using this loader with an
|
|
9
8
|
* `ol/source/Image`, the same extent must be set as `extent` of the `ol/layer/Image`.
|
|
@@ -26,10 +25,6 @@ export type LoaderOptions = {
|
|
|
26
25
|
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
27
26
|
*/
|
|
28
27
|
crossOrigin?: string | null | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* The `referrerPolicy` property for loaded images.
|
|
31
|
-
*/
|
|
32
|
-
referrerPolicy?: ReferrerPolicy | undefined;
|
|
33
28
|
/**
|
|
34
29
|
* Extent of the image in map coordinates.
|
|
35
30
|
* This is the [left, bottom, right, top] map coordinates of your image. When using this loader with an
|
package/source/static.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static.d.ts","sourceRoot":"","sources":["static.js"],"names":[],"mappings":"AAOA
|
|
1
|
+
{"version":3,"file":"static.d.ts","sourceRoot":"","sources":["static.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;GAYG;AAEH;;;;;GAKG;AACH,sCAJW,aAAa,GACZ,OAAO,aAAa,EAAE,wBAAwB,CAmBzD;;;;;;;;;;;;;iBA/Ba,OAAO,cAAc,EAAE,MAAM;;;;SAG7B,MAAM;;;;;;mBACG,gBAAgB,QAAE,MAAM,KAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC"}
|
package/source/static.js
CHANGED
|
@@ -10,7 +10,6 @@ import {getHeight, getWidth} from '../extent.js';
|
|
|
10
10
|
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
|
|
11
11
|
* you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.
|
|
12
12
|
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
13
|
-
* @property {ReferrerPolicy} [referrerPolicy] The `referrerPolicy` property for loaded images.
|
|
14
13
|
* @property {import("../extent.js").Extent} imageExtent Extent of the image in map coordinates.
|
|
15
14
|
* This is the [left, bottom, right, top] map coordinates of your image. When using this loader with an
|
|
16
15
|
* `ol/source/Image`, the same extent must be set as `extent` of the `ol/layer/Image`.
|
|
@@ -34,9 +33,6 @@ export function createLoader(options) {
|
|
|
34
33
|
return () => {
|
|
35
34
|
const image = new Image();
|
|
36
35
|
image.crossOrigin = crossOrigin;
|
|
37
|
-
if (options.referrerPolicy !== undefined) {
|
|
38
|
-
image.referrerPolicy = options.referrerPolicy;
|
|
39
|
-
}
|
|
40
36
|
return load(image, options.url).then((image) => {
|
|
41
37
|
const resolutionX = getWidth(extent) / image.width;
|
|
42
38
|
const resolutionY = getHeight(extent) / image.height;
|
package/source/wms.d.ts
CHANGED
|
@@ -38,7 +38,6 @@ export function getRequestParams(params: any, request: string): any;
|
|
|
38
38
|
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
|
|
39
39
|
* you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.
|
|
40
40
|
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
41
|
-
* @property {ReferrerPolicy} [referrerPolicy] The `referrerPolicy` property for loaded images.
|
|
42
41
|
* @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting
|
|
43
42
|
* the image from the remote server.
|
|
44
43
|
* @property {Object<string,*>} [params] WMS request parameters.
|
|
@@ -108,10 +107,6 @@ export type LoaderOptions = {
|
|
|
108
107
|
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
109
108
|
*/
|
|
110
109
|
crossOrigin?: string | null | undefined;
|
|
111
|
-
/**
|
|
112
|
-
* The `referrerPolicy` property for loaded images.
|
|
113
|
-
*/
|
|
114
|
-
referrerPolicy?: ReferrerPolicy | undefined;
|
|
115
110
|
/**
|
|
116
111
|
* Use the `ol/Map#pixelRatio` value when requesting
|
|
117
112
|
* the image from the remote server.
|
package/source/wms.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wms.d.ts","sourceRoot":"","sources":["wms.js"],"names":[],"mappings":"AAyBA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,uCAPW,MAAM,UACN,OAAO,cAAc,EAAE,MAAM,QAC7B,OAAO,YAAY,EAAE,IAAI,cACzB,OAAO,uBAAuB,EAAE,OAAO,gBAEtC,MAAM,CAgBjB;AAED;;;;;;;;;GASG;AACH,oCATW,OAAO,WAAW,EAAE,MAAM,cAC1B,MAAM,cACN,MAAM,cACN,OAAO,YAAY,EAAE,UAAU,OAC/B,MAAM,2BAEN,OAAO,UAAU,EAAE,UAAU,GAC5B,MAAM,CA4CjB;AAED;;;;GAIG;AACH,uDAHW,MAAM,OAehB;AAED
|
|
1
|
+
{"version":3,"file":"wms.d.ts","sourceRoot":"","sources":["wms.js"],"names":[],"mappings":"AAyBA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,uCAPW,MAAM,UACN,OAAO,cAAc,EAAE,MAAM,QAC7B,OAAO,YAAY,EAAE,IAAI,cACzB,OAAO,uBAAuB,EAAE,OAAO,gBAEtC,MAAM,CAgBjB;AAED;;;;;;;;;GASG;AACH,oCATW,OAAO,WAAW,EAAE,MAAM,cAC1B,MAAM,cACN,MAAM,cACN,OAAO,YAAY,EAAE,UAAU,OAC/B,MAAM,2BAEN,OAAO,UAAU,EAAE,UAAU,GAC5B,MAAM,CA4CjB;AAED;;;;GAIG;AACH,uDAHW,MAAM,OAehB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;GAKG;AACH,sCAJW,aAAa,GACZ,OAAO,aAAa,EAAE,wBAAwB,CA4BzD;AAED;;;;;;;;;;;GAWG;AACH,2CATW,aAAa,cAIb,OAAO,kBAAkB,EAAE,UAAU,cACrC,MAAM,GACL,MAAM,GAAC,SAAS,CAwC3B;AAED;;;;;;;;;;GAUG;AACH,sCANW,aAAa,eACb,MAAM,GAEL,MAAM,GAAC,SAAS,CAkC3B;AA5QD;;;GAGG;AACH,8BAFU,MAAM,CAEuB;;;;;;;;yBAU1B,gBAAgB,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;iBAoHpD,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;SAMnC,MAAM;;;;;;mBACG,gBAAgB,QAAE,MAAM,KAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC"}
|
package/source/wms.js
CHANGED
|
@@ -135,7 +135,6 @@ export function getRequestParams(params, request) {
|
|
|
135
135
|
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
|
|
136
136
|
* you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.
|
|
137
137
|
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
138
|
-
* @property {ReferrerPolicy} [referrerPolicy] The `referrerPolicy` property for loaded images.
|
|
139
138
|
* @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting
|
|
140
139
|
* the image from the remote server.
|
|
141
140
|
* @property {Object<string,*>} [params] WMS request parameters.
|
|
@@ -166,7 +165,6 @@ export function createLoader(options) {
|
|
|
166
165
|
const ratio = options.ratio || 1.5;
|
|
167
166
|
const load = options.load || decode;
|
|
168
167
|
const crossOrigin = options.crossOrigin ?? null;
|
|
169
|
-
const referrerPolicy = options.referrerPolicy;
|
|
170
168
|
|
|
171
169
|
return (extent, resolution, pixelRatio) => {
|
|
172
170
|
extent = getRequestExtent(extent, resolution, pixelRatio, ratio);
|
|
@@ -184,9 +182,6 @@ export function createLoader(options) {
|
|
|
184
182
|
);
|
|
185
183
|
const image = new Image();
|
|
186
184
|
image.crossOrigin = crossOrigin;
|
|
187
|
-
if (referrerPolicy !== undefined) {
|
|
188
|
-
image.referrerPolicy = referrerPolicy;
|
|
189
|
-
}
|
|
190
185
|
return load(image, src).then((image) => ({image, extent, pixelRatio}));
|
|
191
186
|
};
|
|
192
187
|
}
|
package/style/Circle.d.ts
CHANGED
|
@@ -60,6 +60,20 @@ declare class CircleStyle extends RegularShape {
|
|
|
60
60
|
* @param {Options} [options] Options.
|
|
61
61
|
*/
|
|
62
62
|
constructor(options?: Options);
|
|
63
|
+
/**
|
|
64
|
+
* Clones the style.
|
|
65
|
+
* @return {CircleStyle} The cloned style.
|
|
66
|
+
* @api
|
|
67
|
+
* @override
|
|
68
|
+
*/
|
|
69
|
+
override clone(): CircleStyle;
|
|
70
|
+
/**
|
|
71
|
+
* Set the circle radius.
|
|
72
|
+
*
|
|
73
|
+
* @param {number} radius Circle radius.
|
|
74
|
+
* @api
|
|
75
|
+
*/
|
|
76
|
+
setRadius(radius: number): void;
|
|
63
77
|
}
|
|
64
78
|
import RegularShape from './RegularShape.js';
|
|
65
79
|
//# sourceMappingURL=Circle.d.ts.map
|
package/style/Circle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["Circle.js"],"names":[],"mappings":";;;;;;;;;YASc,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAHpB;;;;;;;;;;;;;GAaG;AAEH;;;;GAIG;AACH;IACE;;OAEG;IACH,sBAFW,OAAO,EAkBjB;
|
|
1
|
+
{"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["Circle.js"],"names":[],"mappings":";;;;;;;;;YASc,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAHpB;;;;;;;;;;;;;GAaG;AAEH;;;;GAIG;AACH;IACE;;OAEG;IACH,sBAFW,OAAO,EAkBjB;IAED;;;;;OAKG;IACH,kBAJY,WAAW,CAkBtB;IAED;;;;;OAKG;IACH,kBAHW,MAAM,QAMhB;CACF;yBA5EwB,mBAAmB"}
|
package/style/Circle.js
CHANGED
|
@@ -67,6 +67,17 @@ class CircleStyle extends RegularShape {
|
|
|
67
67
|
style.setOpacity(this.getOpacity());
|
|
68
68
|
return style;
|
|
69
69
|
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Set the circle radius.
|
|
73
|
+
*
|
|
74
|
+
* @param {number} radius Circle radius.
|
|
75
|
+
* @api
|
|
76
|
+
*/
|
|
77
|
+
setRadius(radius) {
|
|
78
|
+
this.radius = radius;
|
|
79
|
+
this.render();
|
|
80
|
+
}
|
|
70
81
|
}
|
|
71
82
|
|
|
72
83
|
export default CircleStyle;
|
package/style/Fill.js
CHANGED
package/style/Icon.d.ts
CHANGED
|
@@ -40,10 +40,6 @@ export type Options = {
|
|
|
40
40
|
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
41
41
|
*/
|
|
42
42
|
crossOrigin?: string | null | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* The `referrerPolicy` property for loaded images.
|
|
45
|
-
*/
|
|
46
|
-
referrerPolicy?: ReferrerPolicy | undefined;
|
|
47
43
|
/**
|
|
48
44
|
* Image object for the icon.
|
|
49
45
|
*/
|
|
@@ -141,11 +137,6 @@ declare class Icon extends ImageStyle {
|
|
|
141
137
|
* @type {?string}
|
|
142
138
|
*/
|
|
143
139
|
private crossOrigin_;
|
|
144
|
-
/**
|
|
145
|
-
* @private
|
|
146
|
-
* @type {ReferrerPolicy}
|
|
147
|
-
*/
|
|
148
|
-
private referrerPolicy_;
|
|
149
140
|
/**
|
|
150
141
|
* @private
|
|
151
142
|
* @type {import("../color.js").Color}
|
|
@@ -198,16 +189,6 @@ declare class Icon extends ImageStyle {
|
|
|
198
189
|
* @api
|
|
199
190
|
*/
|
|
200
191
|
getColor(): import("../color.js").Color;
|
|
201
|
-
/**
|
|
202
|
-
* Set the icon color.
|
|
203
|
-
*
|
|
204
|
-
* Warning: Repeatedly setting the color on an icon style
|
|
205
|
-
* causes the icon image to be re-created each time. This can have a
|
|
206
|
-
* severe performance impact.
|
|
207
|
-
*
|
|
208
|
-
* @param {import("../color.js").Color|string|null|undefined} color Color.
|
|
209
|
-
*/
|
|
210
|
-
setColor(color: import("../color.js").Color | string | null | undefined): void;
|
|
211
192
|
/**
|
|
212
193
|
* Get the image icon.
|
|
213
194
|
* @param {number} pixelRatio Pixel ratio.
|
package/style/Icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["Icon.js"],"names":[],"mappings":";;;;8BAYa,UAAU,GAAG,QAAQ;;;;yBAKrB,aAAa,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["Icon.js"],"names":[],"mappings":";;;;8BAYa,UAAU,GAAG,QAAQ;;;;yBAKrB,aAAa,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DtE;;;;GAIG;AACH;IACE;;OAEG;IACH,sBAFW,OAAO,EA0MjB;IAtKC;;;OAGG;IACH,gBAAyE;IAEzE;;;OAGG;IACH,0BAA6B;IAE7B;;;OAGG;IACH,sBACwE;IAExE;;;OAGG;IACH,sBACwE;IAExE;;;OAGG;IACH,sBACwE;IAExE;;;OAGG;IACH,qBACgE;IA0ChE;;;OAGG;IACH,eAAyE;IAEzE;;;OAGG;IACH,mBAMC;IAED;;;OAGG;IACH,gBAAqE;IACrE;;;OAGG;IACH,sBACwE;IAExE;;;OAGG;IACH,gBAAmB;IAEnB;;;OAGG;IACH,cAA6D;IAoBvD,qCAA8B;IA4BtC;;;;;OAKG;IACH,kBAJY,IAAI,CAoCf;IA8DD;;;;;;OAMG;IACH,kBAHW,KAAK,CAAC,MAAM,CAAC,QAMvB;IAED;;;;OAIG;IACH,YAHY,OAAO,aAAa,EAAE,KAAK,CAKtC;IAED;;;;;;;OAOG;IACH,8BANW,MAAM,GACL,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,WAAW,CAOzE;IA6BD;;;OAGG;IACH,iCAHY,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,WAAW,CAKzE;IAsCD;;;;OAIG;IACH,UAHY,MAAM,GAAC,SAAS,CAK3B;IAED;;;;OAIG;IACH,YAHW,MAAM,QAWhB;IAYD;;;;OAIG;IACH,YAHY,MAAM,CAYjB;IAED;;;;OAIG;IACH,aAHY,MAAM,CAYjB;CAgDF;uBAllBsB,YAAY"}
|
package/style/Icon.js
CHANGED
|
@@ -35,7 +35,6 @@ import ImageStyle from './Image.js';
|
|
|
35
35
|
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that you must provide a
|
|
36
36
|
* `crossOrigin` value if you want to access pixel data with the Canvas renderer.
|
|
37
37
|
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
38
|
-
* @property {ReferrerPolicy} [referrerPolicy] The `referrerPolicy` property for loaded images.
|
|
39
38
|
* @property {HTMLImageElement|HTMLCanvasElement|OffscreenCanvas|ImageBitmap} [img] Image object for the icon.
|
|
40
39
|
* @property {Array<number>} [displacement=[0, 0]] Displacement of the icon in pixels.
|
|
41
40
|
* Positive values will shift the icon right and up.
|
|
@@ -158,12 +157,6 @@ class Icon extends ImageStyle {
|
|
|
158
157
|
this.crossOrigin_ =
|
|
159
158
|
options.crossOrigin !== undefined ? options.crossOrigin : null;
|
|
160
159
|
|
|
161
|
-
/**
|
|
162
|
-
* @private
|
|
163
|
-
* @type {ReferrerPolicy}
|
|
164
|
-
*/
|
|
165
|
-
this.referrerPolicy_ = options.referrerPolicy;
|
|
166
|
-
|
|
167
160
|
const image = options.img !== undefined ? options.img : null;
|
|
168
161
|
|
|
169
162
|
let cacheKey = options.src;
|
|
@@ -217,10 +210,7 @@ class Icon extends ImageStyle {
|
|
|
217
210
|
this.iconImage_ = getIconImage(
|
|
218
211
|
image,
|
|
219
212
|
/** @type {string} */ (cacheKey),
|
|
220
|
-
|
|
221
|
-
crossOrigin: this.crossOrigin_,
|
|
222
|
-
referrerPolicy: this.referrerPolicy_,
|
|
223
|
-
},
|
|
213
|
+
this.crossOrigin_,
|
|
224
214
|
imageState,
|
|
225
215
|
this.color_,
|
|
226
216
|
);
|
|
@@ -320,7 +310,6 @@ class Icon extends ImageStyle {
|
|
|
320
310
|
? this.color_.slice()
|
|
321
311
|
: this.color_ || undefined,
|
|
322
312
|
crossOrigin: this.crossOrigin_,
|
|
323
|
-
referrerPolicy: this.referrerPolicy_,
|
|
324
313
|
offset: this.offset_.slice(),
|
|
325
314
|
offsetOrigin: this.offsetOrigin_,
|
|
326
315
|
opacity: this.getOpacity(),
|
|
@@ -417,45 +406,6 @@ class Icon extends ImageStyle {
|
|
|
417
406
|
return this.color_;
|
|
418
407
|
}
|
|
419
408
|
|
|
420
|
-
/**
|
|
421
|
-
* Set the icon color.
|
|
422
|
-
*
|
|
423
|
-
* Warning: Repeatedly setting the color on an icon style
|
|
424
|
-
* causes the icon image to be re-created each time. This can have a
|
|
425
|
-
* severe performance impact.
|
|
426
|
-
*
|
|
427
|
-
* @param {import("../color.js").Color|string|null|undefined} color Color.
|
|
428
|
-
*/
|
|
429
|
-
setColor(color) {
|
|
430
|
-
const nextColor = color ? asArray(color) : null;
|
|
431
|
-
if (
|
|
432
|
-
this.color_ === nextColor ||
|
|
433
|
-
(this.color_ &&
|
|
434
|
-
nextColor &&
|
|
435
|
-
this.color_.length === nextColor.length &&
|
|
436
|
-
this.color_.every((value, index) => value === nextColor[index]))
|
|
437
|
-
) {
|
|
438
|
-
// Discard if the color hasn't changed.
|
|
439
|
-
return;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
this.color_ = nextColor;
|
|
443
|
-
const src = this.getSrc();
|
|
444
|
-
const image = src !== undefined ? null : this.getHitDetectionImage();
|
|
445
|
-
const imageState =
|
|
446
|
-
src !== undefined ? ImageState.IDLE : this.iconImage_.getImageState();
|
|
447
|
-
this.iconImage_ = getIconImage(
|
|
448
|
-
image,
|
|
449
|
-
src,
|
|
450
|
-
{
|
|
451
|
-
crossOrigin: this.crossOrigin_,
|
|
452
|
-
referrerPolicy: this.referrerPolicy_,
|
|
453
|
-
},
|
|
454
|
-
imageState,
|
|
455
|
-
this.color_,
|
|
456
|
-
);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
409
|
/**
|
|
460
410
|
* Get the image icon.
|
|
461
411
|
* @param {number} pixelRatio Pixel ratio.
|
|
@@ -557,10 +507,7 @@ class Icon extends ImageStyle {
|
|
|
557
507
|
this.iconImage_ = getIconImage(
|
|
558
508
|
null,
|
|
559
509
|
src,
|
|
560
|
-
|
|
561
|
-
crossOrigin: this.crossOrigin_,
|
|
562
|
-
referrerPolicy: this.referrerPolicy_,
|
|
563
|
-
},
|
|
510
|
+
this.crossOrigin_,
|
|
564
511
|
ImageState.IDLE,
|
|
565
512
|
this.color_,
|
|
566
513
|
);
|
package/style/IconImage.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {HTMLImageElement|HTMLCanvasElement|OffscreenCanvas|ImageBitmap|null} image Image.
|
|
3
|
-
* @param {string|undefined}
|
|
4
|
-
* @param {
|
|
3
|
+
* @param {string|undefined} cacheKey Src.
|
|
4
|
+
* @param {?string} crossOrigin Cross origin.
|
|
5
5
|
* @param {import("../ImageState.js").default|undefined} imageState Image state.
|
|
6
6
|
* @param {import("../color.js").Color|string|null} color Color.
|
|
7
7
|
* @param {boolean} [pattern] Also cache a `repeat` pattern with the icon image.
|
|
8
8
|
* @return {IconImage} Icon image.
|
|
9
9
|
*/
|
|
10
|
-
export function get(image: HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap | null,
|
|
10
|
+
export function get(image: HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap | null, cacheKey: string | undefined, crossOrigin: string | null, imageState: any | undefined, color: import("../color.js").Color | string | null, pattern?: boolean): IconImage;
|
|
11
11
|
export default IconImage;
|
|
12
12
|
declare class IconImage extends EventTarget {
|
|
13
13
|
/**
|
|
14
14
|
* @param {HTMLImageElement|HTMLCanvasElement|OffscreenCanvas|ImageBitmap|null} image Image.
|
|
15
15
|
* @param {string|undefined} src Src.
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {?string} crossOrigin Cross origin.
|
|
17
17
|
* @param {import("../ImageState.js").default|undefined} imageState Image state.
|
|
18
18
|
* @param {import("../color.js").Color|string|null} color Color.
|
|
19
19
|
*/
|
|
20
|
-
constructor(image: HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap | null, src: string | undefined,
|
|
20
|
+
constructor(image: HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap | null, src: string | undefined, crossOrigin: string | null, imageState: any | undefined, color: import("../color.js").Color | string | null);
|
|
21
21
|
/**
|
|
22
22
|
* @private
|
|
23
23
|
* @type {HTMLImageElement|OffscreenCanvas|HTMLCanvasElement|ImageBitmap}
|
|
@@ -33,11 +33,6 @@ declare class IconImage extends EventTarget {
|
|
|
33
33
|
* @type {string|null}
|
|
34
34
|
*/
|
|
35
35
|
private crossOrigin_;
|
|
36
|
-
/**
|
|
37
|
-
* @private
|
|
38
|
-
* @type {ReferrerPolicy}
|
|
39
|
-
*/
|
|
40
|
-
private referrerPolicy_;
|
|
41
36
|
/**
|
|
42
37
|
* @private
|
|
43
38
|
* @type {Object<number, HTMLCanvasElement|OffscreenCanvas>}
|
|
@@ -95,10 +90,6 @@ declare class IconImage extends EventTarget {
|
|
|
95
90
|
* @return {HTMLImageElement|HTMLCanvasElement|OffscreenCanvas|ImageBitmap} Image or Canvas element or image bitmap.
|
|
96
91
|
*/
|
|
97
92
|
getImage(pixelRatio: number): HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap;
|
|
98
|
-
/**
|
|
99
|
-
* @param {HTMLImageElement|HTMLCanvasElement|OffscreenCanvas|ImageBitmap} image Image.
|
|
100
|
-
*/
|
|
101
|
-
setImage(image: HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap): void;
|
|
102
93
|
/**
|
|
103
94
|
* @param {number} pixelRatio Pixel ratio.
|
|
104
95
|
* @return {number} Image or Canvas element.
|
package/style/IconImage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconImage.d.ts","sourceRoot":"","sources":["IconImage.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconImage.d.ts","sourceRoot":"","sources":["IconImage.js"],"names":[],"mappings":"AA6SA;;;;;;;;GAQG;AACH,2BARW,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,WAAW,GAAC,IAAI,YACnE,MAAM,GAAC,SAAS,eACf,MAAM,OAAA,cACP,GAAkC,GAAC,SAAS,SAC5C,OAAO,aAAa,EAAE,KAAK,GAAC,MAAM,GAAC,IAAI,YACvC,OAAO,GACN,SAAS,CAyBpB;;AA5TD;IACE;;;;;;OAMG;IACH,mBANW,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,WAAW,GAAC,IAAI,OACnE,MAAM,GAAC,SAAS,eACf,MAAM,OAAA,cACP,GAAkC,GAAC,SAAS,SAC5C,OAAO,aAAa,EAAE,KAAK,GAAC,MAAM,GAAC,IAAI,EAgEjD;IA3DC;;;OAGG;IACH,2BAA8B;IAE9B;;;OAGG;IACH,eAAmB;IAEnB;;;OAGG;IACH,qBAA+B;IAE/B;;;OAGG;IACH,gBAAiB;IAEjB;;;OAGG;IACH,eAAmB;IAEnB;;;OAGG;IACH,oBAA0E;IAE1E;;;OAGG;IACH,cAC2E;IAE3E;;;OAGG;IACH,aAAe;IAOf;;;OAGG;IACH,eAAkB;IAGpB;;OAEG;IACH,yBAKC;IAED;;;OAGG;IACH,mBAiBC;IAPK,8BAAqB;IAS3B;;OAEG;IACH,6BAEC;IAED;;OAEG;IACH,0BAGC;IAED;;OAEG;IACH,yBAIC;IAED;;;OAGG;IACH,qBAHW,MAAM,GACL,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,WAAW,CAQzE;IAED;;;OAGG;IACH,0BAHW,MAAM,GACL,MAAM,CAKjB;IAED;;OAEG;IACH,qBAEC;IAED;;OAEG;IACH,wBAFY,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,WAAW,CAkBzE;IAED;;;OAGG;IACH,WAFY,OAAO,YAAY,EAAE,IAAI,CAIpC;IAED;;OAEG;IACH,UAFY,MAAM,GAAC,SAAS,CAI3B;IAED;;OAEG;IACH,aAwBC;IAED;;;OAGG;IACH,sBA2BC;IAED;;OAEG;IACH,SAFY,OAAO,CAAC,IAAI,CAAC,CAyBxB;CACF;wBAlSuB,qBAAqB"}
|
package/style/IconImage.js
CHANGED
|
@@ -19,11 +19,11 @@ class IconImage extends EventTarget {
|
|
|
19
19
|
/**
|
|
20
20
|
* @param {HTMLImageElement|HTMLCanvasElement|OffscreenCanvas|ImageBitmap|null} image Image.
|
|
21
21
|
* @param {string|undefined} src Src.
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {?string} crossOrigin Cross origin.
|
|
23
23
|
* @param {import("../ImageState.js").default|undefined} imageState Image state.
|
|
24
24
|
* @param {import("../color.js").Color|string|null} color Color.
|
|
25
25
|
*/
|
|
26
|
-
constructor(image, src,
|
|
26
|
+
constructor(image, src, crossOrigin, imageState, color) {
|
|
27
27
|
super();
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -42,13 +42,7 @@ class IconImage extends EventTarget {
|
|
|
42
42
|
* @private
|
|
43
43
|
* @type {string|null}
|
|
44
44
|
*/
|
|
45
|
-
this.crossOrigin_ =
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @private
|
|
49
|
-
* @type {ReferrerPolicy}
|
|
50
|
-
*/
|
|
51
|
-
this.referrerPolicy_ = imageAttributes?.referrerPolicy;
|
|
45
|
+
this.crossOrigin_ = crossOrigin;
|
|
52
46
|
|
|
53
47
|
/**
|
|
54
48
|
* @private
|
|
@@ -101,9 +95,6 @@ class IconImage extends EventTarget {
|
|
|
101
95
|
if (this.crossOrigin_ !== null) {
|
|
102
96
|
this.image_.crossOrigin = this.crossOrigin_;
|
|
103
97
|
}
|
|
104
|
-
if (this.referrerPolicy_ !== undefined) {
|
|
105
|
-
this.image_.referrerPolicy = this.referrerPolicy_;
|
|
106
|
-
}
|
|
107
98
|
}
|
|
108
99
|
|
|
109
100
|
/**
|
|
@@ -165,13 +156,6 @@ class IconImage extends EventTarget {
|
|
|
165
156
|
return this.canvas_[pixelRatio] ? this.canvas_[pixelRatio] : this.image_;
|
|
166
157
|
}
|
|
167
158
|
|
|
168
|
-
/**
|
|
169
|
-
* @param {HTMLImageElement|HTMLCanvasElement|OffscreenCanvas|ImageBitmap} image Image.
|
|
170
|
-
*/
|
|
171
|
-
setImage(image) {
|
|
172
|
-
this.image_ = image;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
159
|
/**
|
|
176
160
|
* @param {number} pixelRatio Pixel ratio.
|
|
177
161
|
* @return {number} Image or Canvas element.
|
|
@@ -317,28 +301,34 @@ class IconImage extends EventTarget {
|
|
|
317
301
|
|
|
318
302
|
/**
|
|
319
303
|
* @param {HTMLImageElement|HTMLCanvasElement|OffscreenCanvas|ImageBitmap|null} image Image.
|
|
320
|
-
* @param {string|undefined}
|
|
321
|
-
* @param {
|
|
304
|
+
* @param {string|undefined} cacheKey Src.
|
|
305
|
+
* @param {?string} crossOrigin Cross origin.
|
|
322
306
|
* @param {import("../ImageState.js").default|undefined} imageState Image state.
|
|
323
307
|
* @param {import("../color.js").Color|string|null} color Color.
|
|
324
308
|
* @param {boolean} [pattern] Also cache a `repeat` pattern with the icon image.
|
|
325
309
|
* @return {IconImage} Icon image.
|
|
326
310
|
*/
|
|
327
|
-
export function get(image,
|
|
311
|
+
export function get(image, cacheKey, crossOrigin, imageState, color, pattern) {
|
|
328
312
|
let iconImage =
|
|
329
|
-
|
|
313
|
+
cacheKey === undefined
|
|
314
|
+
? undefined
|
|
315
|
+
: iconImageCache.get(cacheKey, crossOrigin, color);
|
|
330
316
|
if (!iconImage) {
|
|
331
317
|
iconImage = new IconImage(
|
|
332
318
|
image,
|
|
333
|
-
image && 'src' in image ? image.src || undefined :
|
|
334
|
-
|
|
319
|
+
image && 'src' in image ? image.src || undefined : cacheKey,
|
|
320
|
+
crossOrigin,
|
|
335
321
|
imageState,
|
|
336
322
|
color,
|
|
337
323
|
);
|
|
338
|
-
iconImageCache.set(
|
|
324
|
+
iconImageCache.set(cacheKey, crossOrigin, color, iconImage, pattern);
|
|
339
325
|
}
|
|
340
|
-
if (
|
|
341
|
-
|
|
326
|
+
if (
|
|
327
|
+
pattern &&
|
|
328
|
+
iconImage &&
|
|
329
|
+
!iconImageCache.getPattern(cacheKey, crossOrigin, color)
|
|
330
|
+
) {
|
|
331
|
+
iconImageCache.set(cacheKey, crossOrigin, color, iconImage, pattern);
|
|
342
332
|
}
|
|
343
333
|
return iconImage;
|
|
344
334
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {string} src Src.
|
|
3
|
+
* @param {?string} crossOrigin Cross origin.
|
|
3
4
|
* @param {import("../color.js").Color|string|null} color Color.
|
|
4
5
|
* @return {string} Cache key.
|
|
5
6
|
*/
|
|
6
|
-
export function getCacheKey(src: string, color: import("../color.js").Color | string | null): string;
|
|
7
|
+
export function getCacheKey(src: string, crossOrigin: string | null, color: import("../color.js").Color | string | null): string;
|
|
7
8
|
export default IconImageCache;
|
|
8
9
|
/**
|
|
9
10
|
* The {@link module:ol/style/IconImageCache~IconImageCache} for
|
|
@@ -50,23 +51,26 @@ declare class IconImageCache {
|
|
|
50
51
|
expire(): void;
|
|
51
52
|
/**
|
|
52
53
|
* @param {string} src Src.
|
|
54
|
+
* @param {?string} crossOrigin Cross origin.
|
|
53
55
|
* @param {import("../color.js").Color|string|null} color Color.
|
|
54
56
|
* @return {import("./IconImage.js").default} Icon image.
|
|
55
57
|
*/
|
|
56
|
-
get(src: string, color: import("../color.js").Color | string | null): import("./IconImage.js").default;
|
|
58
|
+
get(src: string, crossOrigin: string | null, color: import("../color.js").Color | string | null): import("./IconImage.js").default;
|
|
57
59
|
/**
|
|
58
60
|
* @param {string} src Src.
|
|
61
|
+
* @param {?string} crossOrigin Cross origin.
|
|
59
62
|
* @param {import("../color.js").Color|string|null} color Color.
|
|
60
63
|
* @return {CanvasPattern} Icon image.
|
|
61
64
|
*/
|
|
62
|
-
getPattern(src: string, color: import("../color.js").Color | string | null): CanvasPattern;
|
|
65
|
+
getPattern(src: string, crossOrigin: string | null, color: import("../color.js").Color | string | null): CanvasPattern;
|
|
63
66
|
/**
|
|
64
67
|
* @param {string} src Src.
|
|
68
|
+
* @param {?string} crossOrigin Cross origin.
|
|
65
69
|
* @param {import("../color.js").Color|string|null} color Color.
|
|
66
70
|
* @param {import("./IconImage.js").default|null} iconImage Icon image.
|
|
67
71
|
* @param {boolean} [pattern] Also cache a `'repeat'` pattern with this `iconImage`.
|
|
68
72
|
*/
|
|
69
|
-
set(src: string, color: import("../color.js").Color | string | null, iconImage: import("./IconImage.js").default | null, pattern?: boolean): void;
|
|
73
|
+
set(src: string, crossOrigin: string | null, color: import("../color.js").Color | string | null, iconImage: import("./IconImage.js").default | null, pattern?: boolean): void;
|
|
70
74
|
/**
|
|
71
75
|
* Set the cache size of the icon cache. Default is `1024`. Change this value when
|
|
72
76
|
* your map uses more than 1024 different icon images and you are not caching icon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconImageCache.d.ts","sourceRoot":"","sources":["IconImageCache.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconImageCache.d.ts","sourceRoot":"","sources":["IconImageCache.js"],"names":[],"mappings":"AA4IA;;;;;GAKG;AACH,iCALW,MAAM,eACL,MAAM,OAAA,SACP,OAAO,aAAa,EAAE,KAAK,GAAC,MAAM,GAAC,IAAI,GACtC,MAAM,CAKjB;;AAID;;;;GAIG;AACH,oCAA2C;AAvJ3C;;;GAGG;AACH;IAEI;;;OAGG;IACH,eAAgB;IAEhB;;;OAGG;IACH,sBAAuB;IAEvB;;;OAGG;IACH,mBAAmB;IAEnB;;;OAGG;IACH,sBAAyB;IAG3B;;OAEG;IACH,cAIC;IAED;;OAEG;IACH,kBAFY,OAAO,CAIlB;IAED;;OAEG;IACH,eAYC;IAED;;;;;OAKG;IACH,SALW,MAAM,eACL,MAAM,OAAA,SACP,OAAO,aAAa,EAAE,KAAK,GAAC,MAAM,GAAC,IAAI,GACtC,OAAO,gBAAgB,EAAE,OAAO,CAK3C;IAED;;;;;OAKG;IACH,gBALW,MAAM,eACL,MAAM,OAAA,SACP,OAAO,aAAa,EAAE,KAAK,GAAC,MAAM,GAAC,IAAI,GACtC,aAAa,CAKxB;IAED;;;;;;OAMG;IACH,SANW,MAAM,eACL,MAAM,OAAA,SACP,OAAO,aAAa,EAAE,KAAK,GAAC,MAAM,GAAC,IAAI,aACvC,OAAO,gBAAgB,EAAE,OAAO,GAAC,IAAI,YACrC,OAAO,QA2BjB;IAED;;;;;;OAMG;IACH,sBAHW,MAAM,QAMhB;CACF"}
|