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
package/source/OGCMap.js
DELETED
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module ol/source/OGCMap
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import {decode} from '../Image.js';
|
|
6
|
-
import ImageSource, {defaultImageLoadFunction} from './Image.js';
|
|
7
|
-
import {createLoader} from './ogcMapUtil.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {Object} Options
|
|
11
|
-
* @property {import("./Source.js").AttributionLike} [attributions] Attributions.
|
|
12
|
-
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
|
|
13
|
-
* you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.
|
|
14
|
-
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
15
|
-
* @property {ReferrerPolicy} [referrerPolicy] The `referrerPolicy` property for loaded images.
|
|
16
|
-
* @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting
|
|
17
|
-
* the image from the remote server.
|
|
18
|
-
* @property {import("../Image.js").LoadFunction} [imageLoadFunction] Optional function to load an image given a URL.
|
|
19
|
-
* @property {boolean} [interpolate=true] Use interpolated values when resampling. By default,
|
|
20
|
-
* linear interpolation is used when resampling. Set to false to use the nearest neighbor instead.
|
|
21
|
-
* @property {Object<string,*>} [params] OGC Maps request parameters.
|
|
22
|
-
* No param is required by default. `width`, `height`, `bbox`, `crs` and `bbox-crs` will be set dynamically.
|
|
23
|
-
* @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection.
|
|
24
|
-
* @property {number} [ratio=1.5] Ratio. `1` means image requests are the size of the map viewport, `2` means
|
|
25
|
-
* twice the width and height of the map viewport, and so on. Must be `1` or higher.
|
|
26
|
-
* @property {Array<number>} [resolutions] Resolutions.
|
|
27
|
-
* If specified, requests will be made for these resolutions only.
|
|
28
|
-
* @property {string} [url] OGC Maps service URL.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @classdesc
|
|
33
|
-
* Source for OGC Maps servers providing single, untiled images.
|
|
34
|
-
*
|
|
35
|
-
* @fires module:ol/source/Image.ImageSourceEvent
|
|
36
|
-
* @api
|
|
37
|
-
*/
|
|
38
|
-
class OGCMap extends ImageSource {
|
|
39
|
-
/**
|
|
40
|
-
* @param {Options} [options] OGCMapOptions options.
|
|
41
|
-
*/
|
|
42
|
-
constructor(options) {
|
|
43
|
-
options = options ? options : {};
|
|
44
|
-
|
|
45
|
-
super({
|
|
46
|
-
attributions: options.attributions,
|
|
47
|
-
interpolate: options.interpolate,
|
|
48
|
-
projection: options.projection,
|
|
49
|
-
resolutions: options.resolutions,
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @private
|
|
54
|
-
* @type {?string}
|
|
55
|
-
*/
|
|
56
|
-
this.crossOrigin_ =
|
|
57
|
-
options.crossOrigin !== undefined ? options.crossOrigin : null;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @private
|
|
61
|
-
* @type {ReferrerPolicy}
|
|
62
|
-
*/
|
|
63
|
-
this.referrerPolicy_ = options.referrerPolicy;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @private
|
|
67
|
-
* @type {string|undefined}
|
|
68
|
-
*/
|
|
69
|
-
this.url_ = options.url;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* @private
|
|
73
|
-
* @type {import("../Image.js").LoadFunction}
|
|
74
|
-
*/
|
|
75
|
-
this.imageLoadFunction_ =
|
|
76
|
-
options.imageLoadFunction !== undefined
|
|
77
|
-
? options.imageLoadFunction
|
|
78
|
-
: defaultImageLoadFunction;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* @private
|
|
82
|
-
* @type {!Object}
|
|
83
|
-
*/
|
|
84
|
-
this.params_ = Object.assign({}, options.params);
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @private
|
|
88
|
-
* @type {boolean}
|
|
89
|
-
*/
|
|
90
|
-
this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* @private
|
|
94
|
-
* @type {number}
|
|
95
|
-
*/
|
|
96
|
-
this.renderedRevision_ = 0;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @private
|
|
100
|
-
* @type {number}
|
|
101
|
-
*/
|
|
102
|
-
this.ratio_ = options.ratio !== undefined ? options.ratio : 1.5;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* @private
|
|
106
|
-
* @type {import("../proj/Projection.js").default}
|
|
107
|
-
*/
|
|
108
|
-
this.loaderProjection_ = null;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Get the user-provided params, i.e. those passed to the constructor through
|
|
113
|
-
* the "params" option, and possibly updated using the updateParams method.
|
|
114
|
-
* @return {Object} Params.
|
|
115
|
-
* @api
|
|
116
|
-
*/
|
|
117
|
-
getParams() {
|
|
118
|
-
return this.params_;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* @param {import("../extent.js").Extent} extent Extent.
|
|
123
|
-
* @param {number} resolution Resolution.
|
|
124
|
-
* @param {number} pixelRatio Pixel ratio.
|
|
125
|
-
* @param {import("../proj/Projection.js").default} projection Projection.
|
|
126
|
-
* @return {import("../Image.js").default} Single image.
|
|
127
|
-
* @override
|
|
128
|
-
*/
|
|
129
|
-
getImageInternal(extent, resolution, pixelRatio, projection) {
|
|
130
|
-
if (this.url_ === undefined) {
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
if (!this.loader || this.loaderProjection_ !== projection) {
|
|
134
|
-
// Lazily create loader to pick up the view projection and to allow `params` updates
|
|
135
|
-
this.loaderProjection_ = projection;
|
|
136
|
-
this.loader = createLoader({
|
|
137
|
-
crossOrigin: this.crossOrigin_,
|
|
138
|
-
referrerPolicy: this.referrerPolicy_,
|
|
139
|
-
params: this.params_,
|
|
140
|
-
projection: projection,
|
|
141
|
-
hidpi: this.hidpi_,
|
|
142
|
-
url: this.url_,
|
|
143
|
-
ratio: this.ratio_,
|
|
144
|
-
load: (image, src) => {
|
|
145
|
-
this.image.setImage(image);
|
|
146
|
-
this.imageLoadFunction_(this.image, src);
|
|
147
|
-
return decode(image);
|
|
148
|
-
},
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return super.getImageInternal(extent, resolution, pixelRatio, projection);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Return the image load function of the source.
|
|
157
|
-
* @return {import("../Image.js").LoadFunction} The image load function.
|
|
158
|
-
* @api
|
|
159
|
-
*/
|
|
160
|
-
getImageLoadFunction() {
|
|
161
|
-
return this.imageLoadFunction_;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Return the URL used for this OGC Maps source.
|
|
166
|
-
* @return {string|undefined} URL.
|
|
167
|
-
* @api
|
|
168
|
-
*/
|
|
169
|
-
getUrl() {
|
|
170
|
-
return this.url_;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Set the image load function of the source.
|
|
175
|
-
* @param {import("../Image.js").LoadFunction} imageLoadFunction Image load function.
|
|
176
|
-
* @api
|
|
177
|
-
*/
|
|
178
|
-
setImageLoadFunction(imageLoadFunction) {
|
|
179
|
-
this.imageLoadFunction_ = imageLoadFunction;
|
|
180
|
-
this.changed();
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Set the URL to use for requests.
|
|
185
|
-
* @param {string|undefined} url URL.
|
|
186
|
-
* @api
|
|
187
|
-
*/
|
|
188
|
-
setUrl(url) {
|
|
189
|
-
if (url != this.url_) {
|
|
190
|
-
this.url_ = url;
|
|
191
|
-
this.loader = null;
|
|
192
|
-
this.changed();
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Set the user-provided params.
|
|
198
|
-
* @param {Object} params Params.
|
|
199
|
-
* @api
|
|
200
|
-
*/
|
|
201
|
-
setParams(params) {
|
|
202
|
-
this.params_ = Object.assign({}, params);
|
|
203
|
-
// Reset loader to pick up new params
|
|
204
|
-
this.loader = null;
|
|
205
|
-
this.changed();
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Update the user-provided params.
|
|
210
|
-
* @param {Object} params Params.
|
|
211
|
-
* @api
|
|
212
|
-
*/
|
|
213
|
-
updateParams(params) {
|
|
214
|
-
Object.assign(this.params_, params);
|
|
215
|
-
this.changed();
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @override
|
|
220
|
-
*/
|
|
221
|
-
changed() {
|
|
222
|
-
this.image = null;
|
|
223
|
-
super.changed();
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
export default OGCMap;
|
package/source/ogcMapUtil.d.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {string} baseUrl Base URL.
|
|
3
|
-
* @param {import("../extent.js").Extent} extent Extent.
|
|
4
|
-
* @param {import("../size.js").Size} size Size.
|
|
5
|
-
* @param {import("../proj/Projection.js").default} projection Projection.
|
|
6
|
-
* @param {Object} params OGC Map params. Will be modified in place.
|
|
7
|
-
* @return {string} Request URL.
|
|
8
|
-
*/
|
|
9
|
-
export function getRequestUrl(baseUrl: string, extent: import("../extent.js").Extent, size: import("../size.js").Size, projection: import("../proj/Projection.js").default, params: any): string;
|
|
10
|
-
/**
|
|
11
|
-
* @param {import("../extent").Extent} extent Extent.
|
|
12
|
-
* @param {number} resolution Resolution.
|
|
13
|
-
* @param {number} pixelRatio pixel ratio.
|
|
14
|
-
* @param {import("../proj.js").Projection} projection Projection.
|
|
15
|
-
* @param {string} url OGC Map service url.
|
|
16
|
-
* @param {Object} params OGC Map params.
|
|
17
|
-
* @return {string} Image src.
|
|
18
|
-
*/
|
|
19
|
-
export function getImageSrc(extent: import("../extent").Extent, resolution: number, pixelRatio: number, projection: import("../proj.js").Projection, url: string, params: any): string;
|
|
20
|
-
/**
|
|
21
|
-
* @typedef {Object} LoaderOptions
|
|
22
|
-
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
|
|
23
|
-
* you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.
|
|
24
|
-
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
25
|
-
* @property {ReferrerPolicy} [referrerPolicy] The `referrerPolicy` property for loaded images.
|
|
26
|
-
* @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting
|
|
27
|
-
* the image from the remote server.
|
|
28
|
-
* @property {Object<string,*>} [params] OGC Map request parameters.
|
|
29
|
-
* No param is required by default. `width`, `height`, `bbox`, `crs` and `bbox-crs` will be set dynamically.
|
|
30
|
-
* @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is 'EPSG:3857'.
|
|
31
|
-
* @property {number} [ratio=1.5] Ratio. `1` means image requests are the size of the map viewport, `2` means
|
|
32
|
-
* twice the width and height of the map viewport, and so on. Must be `1` or higher.
|
|
33
|
-
* @property {string} url OGC Map service URL.
|
|
34
|
-
* @property {function(HTMLImageElement, string): Promise<import('../DataTile.js').ImageLike>} [load] Function
|
|
35
|
-
* to perform loading of the image. Receives the created `HTMLImageElement` and the desired `src` as argument and
|
|
36
|
-
* returns a promise resolving to the loaded or decoded image. Default is {@link module:ol/Image.decode}.
|
|
37
|
-
*/
|
|
38
|
-
/**
|
|
39
|
-
* Creates a loader for OGC Map images.
|
|
40
|
-
* @param {LoaderOptions} options Loader options.
|
|
41
|
-
* @return {import("../Image.js").ImageObjectPromiseLoader} Loader.
|
|
42
|
-
* @api
|
|
43
|
-
*/
|
|
44
|
-
export function createLoader(options: LoaderOptions): import("../Image.js").ImageObjectPromiseLoader;
|
|
45
|
-
export type LoaderOptions = {
|
|
46
|
-
/**
|
|
47
|
-
* The `crossOrigin` attribute for loaded images. Note that
|
|
48
|
-
* you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.
|
|
49
|
-
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
50
|
-
*/
|
|
51
|
-
crossOrigin?: string | null | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* The `referrerPolicy` property for loaded images.
|
|
54
|
-
*/
|
|
55
|
-
referrerPolicy?: ReferrerPolicy | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* Use the `ol/Map#pixelRatio` value when requesting
|
|
58
|
-
* the image from the remote server.
|
|
59
|
-
*/
|
|
60
|
-
hidpi?: boolean | undefined;
|
|
61
|
-
/**
|
|
62
|
-
* OGC Map request parameters.
|
|
63
|
-
* No param is required by default. `width`, `height`, `bbox`, `crs` and `bbox-crs` will be set dynamically.
|
|
64
|
-
*/
|
|
65
|
-
params?: {
|
|
66
|
-
[x: string]: any;
|
|
67
|
-
} | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Projection. Default is 'EPSG:3857'.
|
|
70
|
-
*/
|
|
71
|
-
projection?: import("../proj.js").ProjectionLike;
|
|
72
|
-
/**
|
|
73
|
-
* Ratio. `1` means image requests are the size of the map viewport, `2` means
|
|
74
|
-
* twice the width and height of the map viewport, and so on. Must be `1` or higher.
|
|
75
|
-
*/
|
|
76
|
-
ratio?: number | undefined;
|
|
77
|
-
/**
|
|
78
|
-
* OGC Map service URL.
|
|
79
|
-
*/
|
|
80
|
-
url: string;
|
|
81
|
-
/**
|
|
82
|
-
* Function
|
|
83
|
-
* to perform loading of the image. Receives the created `HTMLImageElement` and the desired `src` as argument and
|
|
84
|
-
* returns a promise resolving to the loaded or decoded image. Default is {@link module :ol/Image.decode}.
|
|
85
|
-
*/
|
|
86
|
-
load?: ((arg0: HTMLImageElement, arg1: string) => Promise<import("../DataTile.js").ImageLike>) | undefined;
|
|
87
|
-
};
|
|
88
|
-
//# sourceMappingURL=ogcMapUtil.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ogcMapUtil.d.ts","sourceRoot":"","sources":["ogcMapUtil.js"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,uCAPW,MAAM,UACN,OAAO,cAAc,EAAE,MAAM,QAC7B,OAAO,YAAY,EAAE,IAAI,cACzB,OAAO,uBAAuB,EAAE,OAAO,gBAEtC,MAAM,CAejB;AAED;;;;;;;;GAQG;AACH,oCARW,OAAO,WAAW,EAAE,MAAM,cAC1B,MAAM,cACN,MAAM,cACN,OAAO,YAAY,EAAE,UAAU,OAC/B,MAAM,gBAEL,MAAM,CAwBjB;AAED;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;GAKG;AACH,sCAJW,aAAa,GACZ,OAAO,aAAa,EAAE,wBAAwB,CA8BzD;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA1Ca,OAAO,YAAY,EAAE,cAAc;;;;;;;;;SAGnC,MAAM;;;;;;mBACG,gBAAgB,QAAE,MAAM,KAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC"}
|
package/source/ogcMapUtil.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module ol/source/ogcMapUtil
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import {decode} from '../Image.js';
|
|
6
|
-
import {getHeight, getWidth} from '../extent.js';
|
|
7
|
-
import {round} from '../math.js';
|
|
8
|
-
import {get as getProjection} from '../proj.js';
|
|
9
|
-
import {appendParams} from '../uri.js';
|
|
10
|
-
import {getRequestExtent} from './Image.js';
|
|
11
|
-
import {DECIMALS} from './common.js';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @param {string} baseUrl Base URL.
|
|
15
|
-
* @param {import("../extent.js").Extent} extent Extent.
|
|
16
|
-
* @param {import("../size.js").Size} size Size.
|
|
17
|
-
* @param {import("../proj/Projection.js").default} projection Projection.
|
|
18
|
-
* @param {Object} params OGC Map params. Will be modified in place.
|
|
19
|
-
* @return {string} Request URL.
|
|
20
|
-
*/
|
|
21
|
-
export function getRequestUrl(baseUrl, extent, size, projection, params) {
|
|
22
|
-
params['width'] = size[0];
|
|
23
|
-
params['height'] = size[1];
|
|
24
|
-
|
|
25
|
-
const axisOrientation = projection.getAxisOrientation();
|
|
26
|
-
params['crs'] = projection.getCode();
|
|
27
|
-
params['bbox-crs'] = projection.getCode();
|
|
28
|
-
const bbox = axisOrientation.startsWith('ne')
|
|
29
|
-
? [extent[1], extent[0], extent[3], extent[2]]
|
|
30
|
-
: extent;
|
|
31
|
-
params['bbox'] = bbox.join(',');
|
|
32
|
-
|
|
33
|
-
return appendParams(baseUrl, params);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @param {import("../extent").Extent} extent Extent.
|
|
38
|
-
* @param {number} resolution Resolution.
|
|
39
|
-
* @param {number} pixelRatio pixel ratio.
|
|
40
|
-
* @param {import("../proj.js").Projection} projection Projection.
|
|
41
|
-
* @param {string} url OGC Map service url.
|
|
42
|
-
* @param {Object} params OGC Map params.
|
|
43
|
-
* @return {string} Image src.
|
|
44
|
-
*/
|
|
45
|
-
export function getImageSrc(
|
|
46
|
-
extent,
|
|
47
|
-
resolution,
|
|
48
|
-
pixelRatio,
|
|
49
|
-
projection,
|
|
50
|
-
url,
|
|
51
|
-
params,
|
|
52
|
-
) {
|
|
53
|
-
params = Object.assign({}, params);
|
|
54
|
-
|
|
55
|
-
const imageResolution = resolution / pixelRatio;
|
|
56
|
-
|
|
57
|
-
const imageSize = [
|
|
58
|
-
round(getWidth(extent) / imageResolution, DECIMALS),
|
|
59
|
-
round(getHeight(extent) / imageResolution, DECIMALS),
|
|
60
|
-
];
|
|
61
|
-
|
|
62
|
-
if (pixelRatio !== 1) {
|
|
63
|
-
params['mm-per-pixel'] = 0.28 / pixelRatio;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return getRequestUrl(url, extent, imageSize, projection, params);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* @typedef {Object} LoaderOptions
|
|
71
|
-
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
|
|
72
|
-
* you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.
|
|
73
|
-
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
74
|
-
* @property {ReferrerPolicy} [referrerPolicy] The `referrerPolicy` property for loaded images.
|
|
75
|
-
* @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting
|
|
76
|
-
* the image from the remote server.
|
|
77
|
-
* @property {Object<string,*>} [params] OGC Map request parameters.
|
|
78
|
-
* No param is required by default. `width`, `height`, `bbox`, `crs` and `bbox-crs` will be set dynamically.
|
|
79
|
-
* @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is 'EPSG:3857'.
|
|
80
|
-
* @property {number} [ratio=1.5] Ratio. `1` means image requests are the size of the map viewport, `2` means
|
|
81
|
-
* twice the width and height of the map viewport, and so on. Must be `1` or higher.
|
|
82
|
-
* @property {string} url OGC Map service URL.
|
|
83
|
-
* @property {function(HTMLImageElement, string): Promise<import('../DataTile.js').ImageLike>} [load] Function
|
|
84
|
-
* to perform loading of the image. Receives the created `HTMLImageElement` and the desired `src` as argument and
|
|
85
|
-
* returns a promise resolving to the loaded or decoded image. Default is {@link module:ol/Image.decode}.
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Creates a loader for OGC Map images.
|
|
90
|
-
* @param {LoaderOptions} options Loader options.
|
|
91
|
-
* @return {import("../Image.js").ImageObjectPromiseLoader} Loader.
|
|
92
|
-
* @api
|
|
93
|
-
*/
|
|
94
|
-
export function createLoader(options) {
|
|
95
|
-
const hidpi = options.hidpi === undefined ? true : options.hidpi;
|
|
96
|
-
const projection = getProjection(options.projection || 'EPSG:3857');
|
|
97
|
-
const ratio = options.ratio || 1.5;
|
|
98
|
-
const load = options.load || decode;
|
|
99
|
-
const crossOrigin = options.crossOrigin ?? null;
|
|
100
|
-
|
|
101
|
-
return (extent, resolution, pixelRatio) => {
|
|
102
|
-
extent = getRequestExtent(extent, resolution, pixelRatio, ratio);
|
|
103
|
-
if (pixelRatio !== 1 && !hidpi) {
|
|
104
|
-
pixelRatio = 1;
|
|
105
|
-
}
|
|
106
|
-
const src = getImageSrc(
|
|
107
|
-
extent,
|
|
108
|
-
resolution,
|
|
109
|
-
pixelRatio,
|
|
110
|
-
projection,
|
|
111
|
-
options.url,
|
|
112
|
-
options.params,
|
|
113
|
-
);
|
|
114
|
-
const image = new Image();
|
|
115
|
-
image.crossOrigin = crossOrigin;
|
|
116
|
-
if (options.referrerPolicy !== undefined) {
|
|
117
|
-
image.referrerPolicy = options.referrerPolicy;
|
|
118
|
-
}
|
|
119
|
-
return load(image, src).then((image) => ({image, extent, pixelRatio}));
|
|
120
|
-
};
|
|
121
|
-
}
|