ol 10.6.2-dev.1751489453019 → 10.6.2-dev.1751550843419
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/dist/ol.js +1 -1
- package/dist/ol.js.map +1 -1
- package/format/Polyline.d.ts +2 -0
- package/format/Polyline.d.ts.map +1 -1
- package/format/Polyline.js +15 -31
- package/package.json +1 -1
- package/style/Icon.d.ts +6 -0
- package/style/Icon.d.ts.map +1 -1
- package/style/Icon.js +15 -0
- package/util.js +1 -1
package/format/Polyline.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export function decodeDeltas(encoded: string, stride: number, factor?: number):
|
|
|
34
34
|
* multiplied. The remaining decimal places will get rounded away.
|
|
35
35
|
* Default is `1e5`.
|
|
36
36
|
* @return {string} The encoded string.
|
|
37
|
+
* @deprecated
|
|
37
38
|
* @api
|
|
38
39
|
*/
|
|
39
40
|
export function encodeFloats(numbers: Array<number>, factor?: number): string;
|
|
@@ -44,6 +45,7 @@ export function encodeFloats(numbers: Array<number>, factor?: number): string;
|
|
|
44
45
|
* @param {number} [factor] The factor by which the result will be divided.
|
|
45
46
|
* Default is `1e5`.
|
|
46
47
|
* @return {Array<number>} A list of floating point numbers.
|
|
48
|
+
* @deprecated
|
|
47
49
|
* @api
|
|
48
50
|
*/
|
|
49
51
|
export function decodeFloats(encoded: string, factor?: number): Array<number>;
|
package/format/Polyline.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polyline.d.ts","sourceRoot":"","sources":["Polyline.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Polyline.d.ts","sourceRoot":"","sources":["Polyline.js"],"names":[],"mappings":"AAqJA;;;;;;;;;;;;GAYG;AACH,sCARW,KAAK,CAAC,MAAM,CAAC,UACb,MAAM,WACN,MAAM,GAGL,MAAM,CAoBjB;AAED;;;;;;;;;;GAUG;AACH,sCARW,MAAM,UACN,MAAM,WAEN,MAAM,GAEL,KAAK,CAAC,MAAM,CAAC,CAkBxB;AAED;;;;;;;;;;;;GAYG;AACH,sCARW,KAAK,CAAC,MAAM,CAAC,WACb,MAAM,GAGL,MAAM,CAWjB;AAED;;;;;;;;;GASG;AACH,sCAPW,MAAM,WACN,MAAM,GAEL,KAAK,CAAC,MAAM,CAAC,CAWxB;AAED;;;;;;;GAOG;AACH,8CAHW,KAAK,CAAC,MAAM,CAAC,GACZ,MAAM,CAQjB;AAED;;;;;GAKG;AACH,8CAHW,MAAM,GACL,KAAK,CAAC,MAAM,CAAC,CASxB;AAED;;;;;GAKG;AACH,gDAHW,KAAK,CAAC,MAAM,CAAC,GACZ,MAAM,CAQjB;AAED;;;;;GAKG;AACH,gDAHW,MAAM,GACL,KAAK,CAAC,MAAM,CAAC,CAkBxB;AAED;;;;;GAKG;AACH,2CAHW,MAAM,GACL,MAAM,CAajB;;;;;;;;;;;;;AArUD;;;;;GAKG;AAEH;;;;;;;;;;;;;GAaG;AACH;IACE;;OAEG;IACH,sBAFW,OAAO,EAyBjB;IAbC;;;OAGG;IACH,gBAAoD;IAEpD;;;OAGG;IACH,wBAEQ;IA+CV;;;;;;OAMG;IACH,6CANW,OAAO,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,YAC3C,OAAO,cAAc,EAAE,YAAY,GAElC,MAAM,CASjB;IAED;;;;;;OAMG;IACH,+CANW,KAAK,CAAC,OAAO,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,YAClD,OAAO,cAAc,EAAE,YAAY,GAElC,MAAM,CAKjB;IAED;;;;;;OAMG;IACH,+CANW,UAAU,YACV,OAAO,cAAc,EAAE,YAAY,GAElC,MAAM,CAWjB;CACF;wBA1IuB,kBAAkB;uBALnB,uBAAuB"}
|
package/format/Polyline.js
CHANGED
|
@@ -5,7 +5,6 @@ import Feature from '../Feature.js';
|
|
|
5
5
|
import LineString from '../geom/LineString.js';
|
|
6
6
|
import {getStrideForLayout} from '../geom/SimpleGeometry.js';
|
|
7
7
|
import {flipXY} from '../geom/flat/flip.js';
|
|
8
|
-
import {inflateCoordinates} from '../geom/flat/inflate.js';
|
|
9
8
|
import {get as getProjection} from '../proj.js';
|
|
10
9
|
import {transformGeometryWithOptions} from './Feature.js';
|
|
11
10
|
import TextFeature from './TextFeature.js';
|
|
@@ -95,13 +94,7 @@ class Polyline extends TextFeature {
|
|
|
95
94
|
const stride = getStrideForLayout(this.geometryLayout_);
|
|
96
95
|
const flatCoordinates = decodeDeltas(text, stride, this.factor_);
|
|
97
96
|
flipXY(flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates);
|
|
98
|
-
const
|
|
99
|
-
flatCoordinates,
|
|
100
|
-
0,
|
|
101
|
-
flatCoordinates.length,
|
|
102
|
-
stride,
|
|
103
|
-
);
|
|
104
|
-
const lineString = new LineString(coordinates, this.geometryLayout_);
|
|
97
|
+
const lineString = new LineString(flatCoordinates, this.geometryLayout_);
|
|
105
98
|
|
|
106
99
|
return transformGeometryWithOptions(
|
|
107
100
|
lineString,
|
|
@@ -144,11 +137,9 @@ class Polyline extends TextFeature {
|
|
|
144
137
|
* @override
|
|
145
138
|
*/
|
|
146
139
|
writeGeometryText(geometry, options) {
|
|
147
|
-
geometry =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
transformGeometryWithOptions(geometry, true, this.adaptOptions(options))
|
|
151
|
-
);
|
|
140
|
+
geometry = /** @type {LineString} */ (
|
|
141
|
+
transformGeometryWithOptions(geometry, true, this.adaptOptions(options))
|
|
142
|
+
);
|
|
152
143
|
const flatCoordinates = geometry.getFlatCoordinates();
|
|
153
144
|
const stride = geometry.getStride();
|
|
154
145
|
flipXY(flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates);
|
|
@@ -171,16 +162,13 @@ class Polyline extends TextFeature {
|
|
|
171
162
|
*/
|
|
172
163
|
export function encodeDeltas(numbers, stride, factor) {
|
|
173
164
|
factor = factor ? factor : 1e5;
|
|
174
|
-
let d;
|
|
175
165
|
|
|
176
|
-
const lastNumbers = new Array(stride);
|
|
177
|
-
for (d = 0; d < stride; ++d) {
|
|
178
|
-
lastNumbers[d] = 0;
|
|
179
|
-
}
|
|
166
|
+
const lastNumbers = new Array(stride).fill(0);
|
|
180
167
|
|
|
181
168
|
for (let i = 0, ii = numbers.length; i < ii; ) {
|
|
182
|
-
for (d = 0; d < stride; ++d, ++i) {
|
|
183
|
-
const
|
|
169
|
+
for (let d = 0; d < stride; ++d, ++i) {
|
|
170
|
+
const value = numbers[i] * factor;
|
|
171
|
+
const num = value < 0 ? Math.ceil(value - 0.5) : Math.round(value);
|
|
184
172
|
const delta = num - lastNumbers[d];
|
|
185
173
|
lastNumbers[d] = num;
|
|
186
174
|
|
|
@@ -188,7 +176,7 @@ export function encodeDeltas(numbers, stride, factor) {
|
|
|
188
176
|
}
|
|
189
177
|
}
|
|
190
178
|
|
|
191
|
-
return
|
|
179
|
+
return encodeSignedIntegers(numbers);
|
|
192
180
|
}
|
|
193
181
|
|
|
194
182
|
/**
|
|
@@ -204,21 +192,15 @@ export function encodeDeltas(numbers, stride, factor) {
|
|
|
204
192
|
*/
|
|
205
193
|
export function decodeDeltas(encoded, stride, factor) {
|
|
206
194
|
factor = factor ? factor : 1e5;
|
|
207
|
-
let d;
|
|
208
195
|
|
|
209
196
|
/** @type {Array<number>} */
|
|
210
|
-
const lastNumbers = new Array(stride);
|
|
211
|
-
|
|
212
|
-
lastNumbers[d] = 0;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
const numbers = decodeFloats(encoded, factor);
|
|
197
|
+
const lastNumbers = new Array(stride).fill(0);
|
|
198
|
+
const numbers = decodeSignedIntegers(encoded);
|
|
216
199
|
|
|
217
200
|
for (let i = 0, ii = numbers.length; i < ii; ) {
|
|
218
|
-
for (d = 0; d < stride; ++d, ++i) {
|
|
201
|
+
for (let d = 0; d < stride; ++d, ++i) {
|
|
219
202
|
lastNumbers[d] += numbers[i];
|
|
220
|
-
|
|
221
|
-
numbers[i] = lastNumbers[d];
|
|
203
|
+
numbers[i] = lastNumbers[d] / factor;
|
|
222
204
|
}
|
|
223
205
|
}
|
|
224
206
|
|
|
@@ -235,6 +217,7 @@ export function decodeDeltas(encoded, stride, factor) {
|
|
|
235
217
|
* multiplied. The remaining decimal places will get rounded away.
|
|
236
218
|
* Default is `1e5`.
|
|
237
219
|
* @return {string} The encoded string.
|
|
220
|
+
* @deprecated
|
|
238
221
|
* @api
|
|
239
222
|
*/
|
|
240
223
|
export function encodeFloats(numbers, factor) {
|
|
@@ -253,6 +236,7 @@ export function encodeFloats(numbers, factor) {
|
|
|
253
236
|
* @param {number} [factor] The factor by which the result will be divided.
|
|
254
237
|
* Default is `1e5`.
|
|
255
238
|
* @return {Array<number>} A list of floating point numbers.
|
|
239
|
+
* @deprecated
|
|
256
240
|
* @api
|
|
257
241
|
*/
|
|
258
242
|
export function decodeFloats(encoded, factor) {
|
package/package.json
CHANGED
package/style/Icon.d.ts
CHANGED
|
@@ -209,6 +209,12 @@ declare class Icon extends ImageStyle {
|
|
|
209
209
|
* @api
|
|
210
210
|
*/
|
|
211
211
|
getSrc(): string | undefined;
|
|
212
|
+
/**
|
|
213
|
+
* Set the image URI
|
|
214
|
+
* @param {string} src Image source URI
|
|
215
|
+
* @api
|
|
216
|
+
*/
|
|
217
|
+
setSrc(src: string): void;
|
|
212
218
|
/**
|
|
213
219
|
* Get the width of the icon (in pixels). Will return undefined when the icon image is not yet loaded.
|
|
214
220
|
* @return {number} Icon width (in pixels).
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2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H,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,WAAW,CAOzD;IA6BD;;;OAGG;IACH,iCAHY,gBAAgB,GAAC,iBAAiB,GAAC,WAAW,CAKzD;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
|
@@ -498,6 +498,21 @@ class Icon extends ImageStyle {
|
|
|
498
498
|
return this.iconImage_.getSrc();
|
|
499
499
|
}
|
|
500
500
|
|
|
501
|
+
/**
|
|
502
|
+
* Set the image URI
|
|
503
|
+
* @param {string} src Image source URI
|
|
504
|
+
* @api
|
|
505
|
+
*/
|
|
506
|
+
setSrc(src) {
|
|
507
|
+
this.iconImage_ = getIconImage(
|
|
508
|
+
null,
|
|
509
|
+
src,
|
|
510
|
+
this.crossOrigin_,
|
|
511
|
+
ImageState.IDLE,
|
|
512
|
+
this.color_,
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
|
|
501
516
|
/**
|
|
502
517
|
* Get the size of the icon (in pixels).
|
|
503
518
|
* @return {import("../size.js").Size} Image size.
|
package/util.js
CHANGED