ol 7.3.1-dev.1680093489853 → 7.3.1-dev.1680098251703
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 +2 -2
- package/dist/ol.js.map +1 -1
- package/package.json +1 -1
- package/style/Icon.d.ts +3 -77
- package/style/Icon.d.ts.map +1 -1
- package/style/Icon.js +89 -86
- package/style/flat.d.ts +14 -0
- package/style/flat.d.ts.map +1 -1
- package/style/flat.js +6 -0
- package/util.js +1 -1
package/package.json
CHANGED
package/style/Icon.d.ts
CHANGED
|
@@ -104,52 +104,6 @@ export type Options = {
|
|
|
104
104
|
*/
|
|
105
105
|
declutterMode?: "declutter" | "obstacle" | "none" | undefined;
|
|
106
106
|
};
|
|
107
|
-
/**
|
|
108
|
-
* @typedef {'fraction' | 'pixels'} IconAnchorUnits
|
|
109
|
-
* Anchor unit can be either a fraction of the icon size or in pixels.
|
|
110
|
-
*/
|
|
111
|
-
/**
|
|
112
|
-
* @typedef {'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'} IconOrigin
|
|
113
|
-
* Icon origin. One of 'bottom-left', 'bottom-right', 'top-left', 'top-right'.
|
|
114
|
-
*/
|
|
115
|
-
/**
|
|
116
|
-
* @typedef {Object} Options
|
|
117
|
-
* @property {Array<number>} [anchor=[0.5, 0.5]] Anchor. Default value is the icon center.
|
|
118
|
-
* @property {IconOrigin} [anchorOrigin='top-left'] Origin of the anchor: `bottom-left`, `bottom-right`,
|
|
119
|
-
* `top-left` or `top-right`.
|
|
120
|
-
* @property {IconAnchorUnits} [anchorXUnits='fraction'] Units in which the anchor x value is
|
|
121
|
-
* specified. A value of `'fraction'` indicates the x value is a fraction of the icon. A value of `'pixels'` indicates
|
|
122
|
-
* the x value in pixels.
|
|
123
|
-
* @property {IconAnchorUnits} [anchorYUnits='fraction'] Units in which the anchor y value is
|
|
124
|
-
* specified. A value of `'fraction'` indicates the y value is a fraction of the icon. A value of `'pixels'` indicates
|
|
125
|
-
* the y value in pixels.
|
|
126
|
-
* @property {import("../color.js").Color|string} [color] Color to tint the icon. If not specified,
|
|
127
|
-
* the icon will be left as is.
|
|
128
|
-
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that you must provide a
|
|
129
|
-
* `crossOrigin` value if you want to access pixel data with the Canvas renderer.
|
|
130
|
-
* See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
|
131
|
-
* @property {HTMLImageElement|HTMLCanvasElement} [img] Image object for the icon. If the `src` option is not provided then the
|
|
132
|
-
* provided image must already be loaded. And in that case, it is required
|
|
133
|
-
* to provide the size of the image, with the `imgSize` option.
|
|
134
|
-
* @property {import("../size.js").Size} [imgSize] Image size in pixels. Only required if `img` is set and `src` is not.
|
|
135
|
-
* The provided `imgSize` needs to match the actual size of the image.
|
|
136
|
-
* @property {Array<number>} [displacement=[0, 0]] Displacement of the icon in pixels.
|
|
137
|
-
* Positive values will shift the icon right and up.
|
|
138
|
-
* @property {number} [opacity=1] Opacity of the icon.
|
|
139
|
-
* @property {number} [width] The width of the icon in pixels. This can't be used together with `scale`.
|
|
140
|
-
* @property {number} [height] The height of the icon in pixels. This can't be used together with `scale`.
|
|
141
|
-
* @property {number|import("../size.js").Size} [scale=1] Scale.
|
|
142
|
-
* @property {boolean} [rotateWithView=false] Whether to rotate the icon with the view.
|
|
143
|
-
* @property {number} [rotation=0] Rotation in radians (positive rotation clockwise).
|
|
144
|
-
* @property {Array<number>} [offset=[0, 0]] Offset which, together with `size` and `offsetOrigin`, defines the
|
|
145
|
-
* sub-rectangle to use from the original (sprite) image.
|
|
146
|
-
* @property {IconOrigin} [offsetOrigin='top-left'] Origin of the offset: `bottom-left`, `bottom-right`,
|
|
147
|
-
* `top-left` or `top-right`.
|
|
148
|
-
* @property {import("../size.js").Size} [size] Icon size in pixels. Used together with `offset` to define the
|
|
149
|
-
* sub-rectangle to use from the original (sprite) image.
|
|
150
|
-
* @property {string} [src] Image source URI.
|
|
151
|
-
* @property {"declutter"|"obstacle"|"none"|undefined} [declutterMode] Declutter mode.
|
|
152
|
-
*/
|
|
153
107
|
/**
|
|
154
108
|
* @classdesc
|
|
155
109
|
* Set icon style for vector features.
|
|
@@ -225,29 +179,13 @@ declare class Icon extends ImageStyle {
|
|
|
225
179
|
* @type {import("../size.js").Size}
|
|
226
180
|
*/
|
|
227
181
|
private size_;
|
|
228
|
-
|
|
229
|
-
* @type {number|undefined}
|
|
230
|
-
*/
|
|
231
|
-
width_: number | undefined;
|
|
232
|
-
/**
|
|
233
|
-
* @type {number|undefined}
|
|
234
|
-
*/
|
|
235
|
-
height_: number | undefined;
|
|
182
|
+
initialOptions_: Options | undefined;
|
|
236
183
|
/**
|
|
237
184
|
* Clones the style. The underlying Image/HTMLCanvasElement is not cloned.
|
|
238
185
|
* @return {Icon} The cloned style.
|
|
239
186
|
* @api
|
|
240
187
|
*/
|
|
241
188
|
clone(): Icon;
|
|
242
|
-
/**
|
|
243
|
-
* Set the scale of the Icon by calculating it from given width and height and the
|
|
244
|
-
* width and height of the image.
|
|
245
|
-
*
|
|
246
|
-
* @private
|
|
247
|
-
* @param {number} width The width.
|
|
248
|
-
* @param {number} height The height.
|
|
249
|
-
*/
|
|
250
|
-
private updateScaleFromWidthAndHeight;
|
|
251
189
|
/**
|
|
252
190
|
* Set the anchor point. The anchor determines the center point for the
|
|
253
191
|
* symbolizer.
|
|
@@ -280,29 +218,17 @@ declare class Icon extends ImageStyle {
|
|
|
280
218
|
*/
|
|
281
219
|
getSrc(): string | undefined;
|
|
282
220
|
/**
|
|
283
|
-
* Get the width of the icon (in pixels).
|
|
221
|
+
* Get the width of the icon (in pixels). Will return undefined when the icon image is not yet loaded.
|
|
284
222
|
* @return {number} Icon width (in pixels).
|
|
285
223
|
* @api
|
|
286
224
|
*/
|
|
287
225
|
getWidth(): number;
|
|
288
226
|
/**
|
|
289
|
-
* Get the height of the icon (in pixels).
|
|
227
|
+
* Get the height of the icon (in pixels). Will return undefined when the icon image is not yet loaded.
|
|
290
228
|
* @return {number} Icon height (in pixels).
|
|
291
229
|
* @api
|
|
292
230
|
*/
|
|
293
231
|
getHeight(): number;
|
|
294
|
-
/**
|
|
295
|
-
* Set the width of the icon in pixels.
|
|
296
|
-
*
|
|
297
|
-
* @param {number} width The width to set.
|
|
298
|
-
*/
|
|
299
|
-
setWidth(width: number): void;
|
|
300
|
-
/**
|
|
301
|
-
* Set the height of the icon in pixels.
|
|
302
|
-
*
|
|
303
|
-
* @param {number} height The height to set.
|
|
304
|
-
*/
|
|
305
|
-
setHeight(height: number): void;
|
|
306
232
|
}
|
|
307
233
|
import ImageStyle from './Image.js';
|
|
308
234
|
//# sourceMappingURL=Icon.d.ts.map
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAwCxD,WAAW,GAAC,UAAU,GAAC,MAAM,GAAC,SAAS;;
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAwCxD,WAAW,GAAC,UAAU,GAAC,MAAM,GAAC,SAAS;;AAuBrD;;;;GAIG;AACH;IACE;;OAEG;IACH,2CAsMC;IApKC;;;OAGG;IACH,gBAAyE;IAEzE;;;OAGG;IACH,0BAA6B;IAE7B;;;OAGG;IACH,sBACwE;IAExE;;;OAGG;IACH,sBACwE;IAExE;;;OAGG;IACH,sBACwE;IAExE;;;OAGG;IACH,qBACgE;IAOhE;;;OAGG;IACH,iBAA+B;IA8B/B;;;OAGG;IACH,eAAyE;IAEzE;;;OAGG;IACH,mBAOC;IAED;;;OAGG;IACH,gBAAqE;IACrE;;;OAGG;IACH,sBACwE;IAExE;;;OAGG;IACH,gBAAmB;IAEnB;;;OAGG;IACH,cAA6D;IAkBvD,qCAA8B;IA4BtC;;;;OAIG;IACH,SAHY,IAAI,CAqCf;IA6DD;;;;;;OAMG;IACH,kBAHW,MAAM,MAAM,CAAC,QAMvB;IAED;;;;OAIG;IACH,YAHY,OAAO,aAAa,EAAE,KAAK,CAKtC;IAED;;;;;OAKG;IACH,qBAJW,MAAM,GACL,gBAAgB,GAAC,iBAAiB,CAK7C;IA0BD;;OAEG;IACH,wBAFY,gBAAgB,GAAC,iBAAiB,CAI7C;IAqCD;;;;OAIG;IACH,UAHY,MAAM,GAAC,SAAS,CAK3B;IAWD;;;;OAIG;IACH,YAHY,MAAM,CAYjB;IAED;;;;OAIG;IACH,aAHY,MAAM,CAYjB;CAqCF;uBAtjBsB,YAAY"}
|
package/style/Icon.js
CHANGED
|
@@ -58,6 +58,26 @@ import {getUid} from '../util.js';
|
|
|
58
58
|
* @property {"declutter"|"obstacle"|"none"|undefined} [declutterMode] Declutter mode.
|
|
59
59
|
*/
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* @param {number} width The width.
|
|
63
|
+
* @param {number} height The height.
|
|
64
|
+
* @param {number|undefined} wantedWidth The wanted width.
|
|
65
|
+
* @param {number|undefined} wantedHeight The wanted height.
|
|
66
|
+
* @return {number|Array<number>} The scale.
|
|
67
|
+
*/
|
|
68
|
+
function calculateScale(width, height, wantedWidth, wantedHeight) {
|
|
69
|
+
if (wantedWidth !== undefined && wantedHeight !== undefined) {
|
|
70
|
+
return [wantedWidth / width, wantedHeight / height];
|
|
71
|
+
}
|
|
72
|
+
if (wantedWidth !== undefined) {
|
|
73
|
+
return wantedWidth / width;
|
|
74
|
+
}
|
|
75
|
+
if (wantedHeight !== undefined) {
|
|
76
|
+
return wantedHeight / height;
|
|
77
|
+
}
|
|
78
|
+
return 1;
|
|
79
|
+
}
|
|
80
|
+
|
|
61
81
|
/**
|
|
62
82
|
* @classdesc
|
|
63
83
|
* Set icon style for vector features.
|
|
@@ -224,27 +244,45 @@ class Icon extends ImageStyle {
|
|
|
224
244
|
this.size_ = options.size !== undefined ? options.size : null;
|
|
225
245
|
|
|
226
246
|
/**
|
|
227
|
-
*
|
|
228
|
-
*/
|
|
229
|
-
this.width_ = options.width;
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* @type {number|undefined}
|
|
247
|
+
* Calculate the scale if width or height were given.
|
|
233
248
|
*/
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
*/
|
|
239
|
-
if (this.width_ !== undefined || this.height_ !== undefined) {
|
|
240
|
-
const image = this.getImage(1);
|
|
241
|
-
const setScale = () => {
|
|
242
|
-
this.updateScaleFromWidthAndHeight(this.width_, this.height_);
|
|
243
|
-
};
|
|
244
|
-
if (image.width > 0) {
|
|
245
|
-
this.updateScaleFromWidthAndHeight(this.width_, this.height_);
|
|
249
|
+
if (options.width !== undefined || options.height !== undefined) {
|
|
250
|
+
let width, height;
|
|
251
|
+
if (options.size) {
|
|
252
|
+
[width, height] = options.size;
|
|
246
253
|
} else {
|
|
247
|
-
image.
|
|
254
|
+
const image = this.getImage(1);
|
|
255
|
+
if (
|
|
256
|
+
image instanceof HTMLCanvasElement ||
|
|
257
|
+
(image.src && image.complete)
|
|
258
|
+
) {
|
|
259
|
+
width = image.width;
|
|
260
|
+
height = image.height;
|
|
261
|
+
} else {
|
|
262
|
+
this.initialOptions_ = options;
|
|
263
|
+
const onload = () => {
|
|
264
|
+
this.unlistenImageChange(onload);
|
|
265
|
+
if (!this.initialOptions_) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const imageSize = this.iconImage_.getSize();
|
|
269
|
+
this.setScale(
|
|
270
|
+
calculateScale(
|
|
271
|
+
imageSize[0],
|
|
272
|
+
imageSize[1],
|
|
273
|
+
options.width,
|
|
274
|
+
options.height
|
|
275
|
+
)
|
|
276
|
+
);
|
|
277
|
+
};
|
|
278
|
+
this.listenImageChange(onload);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (width !== undefined) {
|
|
283
|
+
this.setScale(
|
|
284
|
+
calculateScale(width, height, options.width, options.height)
|
|
285
|
+
);
|
|
248
286
|
}
|
|
249
287
|
}
|
|
250
288
|
}
|
|
@@ -255,13 +293,15 @@ class Icon extends ImageStyle {
|
|
|
255
293
|
* @api
|
|
256
294
|
*/
|
|
257
295
|
clone() {
|
|
258
|
-
let scale
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
296
|
+
let scale, width, height;
|
|
297
|
+
if (this.initialOptions_) {
|
|
298
|
+
width = this.initialOptions_.width;
|
|
299
|
+
height = this.initialOptions_.height;
|
|
300
|
+
} else {
|
|
301
|
+
scale = this.getScale();
|
|
302
|
+
scale = Array.isArray(scale) ? scale.slice() : scale;
|
|
263
303
|
}
|
|
264
|
-
|
|
304
|
+
const clone = new Icon({
|
|
265
305
|
anchor: this.anchor_.slice(),
|
|
266
306
|
anchorOrigin: this.anchorOrigin_,
|
|
267
307
|
anchorXUnits: this.anchorXUnits_,
|
|
@@ -277,35 +317,15 @@ class Icon extends ImageStyle {
|
|
|
277
317
|
opacity: this.getOpacity(),
|
|
278
318
|
rotateWithView: this.getRotateWithView(),
|
|
279
319
|
rotation: this.getRotation(),
|
|
280
|
-
scale
|
|
320
|
+
scale,
|
|
321
|
+
width,
|
|
322
|
+
height,
|
|
281
323
|
size: this.size_ !== null ? this.size_.slice() : undefined,
|
|
282
324
|
src: this.getSrc(),
|
|
283
325
|
displacement: this.getDisplacement().slice(),
|
|
284
326
|
declutterMode: this.getDeclutterMode(),
|
|
285
|
-
width: this.width_,
|
|
286
|
-
height: this.height_,
|
|
287
327
|
});
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Set the scale of the Icon by calculating it from given width and height and the
|
|
292
|
-
* width and height of the image.
|
|
293
|
-
*
|
|
294
|
-
* @private
|
|
295
|
-
* @param {number} width The width.
|
|
296
|
-
* @param {number} height The height.
|
|
297
|
-
*/
|
|
298
|
-
updateScaleFromWidthAndHeight(width, height) {
|
|
299
|
-
const image = this.getImage(1);
|
|
300
|
-
if (width !== undefined && height !== undefined) {
|
|
301
|
-
super.setScale([width / image.width, height / image.height]);
|
|
302
|
-
} else if (width !== undefined) {
|
|
303
|
-
super.setScale([width / image.width, width / image.width]);
|
|
304
|
-
} else if (height !== undefined) {
|
|
305
|
-
super.setScale([height / image.height, height / image.height]);
|
|
306
|
-
} else {
|
|
307
|
-
super.setScale([1, 1]);
|
|
308
|
-
}
|
|
328
|
+
return clone;
|
|
309
329
|
}
|
|
310
330
|
|
|
311
331
|
/**
|
|
@@ -483,63 +503,46 @@ class Icon extends ImageStyle {
|
|
|
483
503
|
}
|
|
484
504
|
|
|
485
505
|
/**
|
|
486
|
-
* Get the width of the icon (in pixels).
|
|
506
|
+
* Get the width of the icon (in pixels). Will return undefined when the icon image is not yet loaded.
|
|
487
507
|
* @return {number} Icon width (in pixels).
|
|
488
508
|
* @api
|
|
489
509
|
*/
|
|
490
510
|
getWidth() {
|
|
491
|
-
|
|
511
|
+
const scale = this.getScaleArray();
|
|
512
|
+
if (this.size_) {
|
|
513
|
+
return this.size_[0] * scale[0];
|
|
514
|
+
}
|
|
515
|
+
if (this.iconImage_.getImageState() == ImageState.LOADED) {
|
|
516
|
+
return this.iconImage_.getSize()[0] * scale[0];
|
|
517
|
+
}
|
|
518
|
+
return undefined;
|
|
492
519
|
}
|
|
493
520
|
|
|
494
521
|
/**
|
|
495
|
-
* Get the height of the icon (in pixels).
|
|
522
|
+
* Get the height of the icon (in pixels). Will return undefined when the icon image is not yet loaded.
|
|
496
523
|
* @return {number} Icon height (in pixels).
|
|
497
524
|
* @api
|
|
498
525
|
*/
|
|
499
526
|
getHeight() {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
setWidth(width) {
|
|
509
|
-
this.width_ = width;
|
|
510
|
-
this.updateScaleFromWidthAndHeight(width, this.height_);
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* Set the height of the icon in pixels.
|
|
515
|
-
*
|
|
516
|
-
* @param {number} height The height to set.
|
|
517
|
-
*/
|
|
518
|
-
setHeight(height) {
|
|
519
|
-
this.height_ = height;
|
|
520
|
-
this.updateScaleFromWidthAndHeight(this.width_, height);
|
|
527
|
+
const scale = this.getScaleArray();
|
|
528
|
+
if (this.size_) {
|
|
529
|
+
return this.size_[1] * scale[1];
|
|
530
|
+
}
|
|
531
|
+
if (this.iconImage_.getImageState() == ImageState.LOADED) {
|
|
532
|
+
return this.iconImage_.getSize()[1] * scale[1];
|
|
533
|
+
}
|
|
534
|
+
return undefined;
|
|
521
535
|
}
|
|
522
536
|
|
|
523
537
|
/**
|
|
524
|
-
* Set the scale
|
|
538
|
+
* Set the scale.
|
|
525
539
|
*
|
|
526
540
|
* @param {number|import("../size.js").Size} scale Scale.
|
|
527
|
-
* @override
|
|
528
541
|
* @api
|
|
529
542
|
*/
|
|
530
543
|
setScale(scale) {
|
|
544
|
+
delete this.initialOptions_;
|
|
531
545
|
super.setScale(scale);
|
|
532
|
-
const image = this.getImage(1);
|
|
533
|
-
if (image) {
|
|
534
|
-
const widthScale = Array.isArray(scale) ? scale[0] : scale;
|
|
535
|
-
if (widthScale !== undefined) {
|
|
536
|
-
this.width_ = widthScale * image.width;
|
|
537
|
-
}
|
|
538
|
-
const heightScale = Array.isArray(scale) ? scale[1] : scale;
|
|
539
|
-
if (heightScale !== undefined) {
|
|
540
|
-
this.height_ = heightScale * image.height;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
546
|
}
|
|
544
547
|
|
|
545
548
|
/**
|
package/style/flat.d.ts
CHANGED
|
@@ -112,6 +112,10 @@
|
|
|
112
112
|
* `top-left` or `top-right`.
|
|
113
113
|
* @property {number} [icon-opacity=1] Opacity of the icon.
|
|
114
114
|
* @property {number|import("../size.js").Size} [icon-scale=1] Scale.
|
|
115
|
+
* @property {number} [icon-width] Width of the icon. If not specified, the actual image width will be used. Cannot be combined
|
|
116
|
+
* with `scale`.
|
|
117
|
+
* @property {number} [icon-height] Height of the icon. If not specified, the actual image height will be used. Cannot be combined
|
|
118
|
+
* with `scale`.
|
|
115
119
|
* @property {number} [icon-rotation=0] Rotation in radians (positive rotation clockwise).
|
|
116
120
|
* @property {boolean} [icon-rotate-with-view=false] Whether to rotate the icon with the view.
|
|
117
121
|
* @property {import("../size.js").Size} [icon-size] Icon size in pixel. Can be used together with `icon-offset` to define the
|
|
@@ -440,6 +444,16 @@ export type FlatIcon = {
|
|
|
440
444
|
* Scale.
|
|
441
445
|
*/
|
|
442
446
|
"icon-scale"?: number | import("../size.js").Size | undefined;
|
|
447
|
+
/**
|
|
448
|
+
* Width of the icon. If not specified, the actual image width will be used. Cannot be combined
|
|
449
|
+
* with `scale`.
|
|
450
|
+
*/
|
|
451
|
+
"icon-width"?: number | undefined;
|
|
452
|
+
/**
|
|
453
|
+
* Height of the icon. If not specified, the actual image height will be used. Cannot be combined
|
|
454
|
+
* with `scale`.
|
|
455
|
+
*/
|
|
456
|
+
"icon-height"?: number | undefined;
|
|
443
457
|
/**
|
|
444
458
|
* Rotation in radians (positive rotation clockwise).
|
|
445
459
|
*/
|
package/style/flat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flat.d.ts","sourceRoot":"","sources":["flat.js"],"names":[],"mappings":"AAYA;;;;;;GAMG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH
|
|
1
|
+
{"version":3,"file":"flat.d.ts","sourceRoot":"","sources":["flat.js"],"names":[],"mappings":"AAYA;;;;;;GAMG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;GAGG;AACH,mCAHW,SAAS,GACR,OAAO,YAAY,EAAE,OAAO,CAWvC;;;;;wBA3LY,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU;;;;4BAMpE,SAAS,GAAC,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAoHzB,WAAW,GAAC,UAAU,GAAC,MAAM,GAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BvC,WAAW,GAAC,UAAU,GAAC,MAAM,GAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAuBvC,WAAW,GAAC,UAAU,GAAC,MAAM,GAAC,SAAS"}
|
package/style/flat.js
CHANGED
|
@@ -129,6 +129,10 @@ import Text from './Text.js';
|
|
|
129
129
|
* `top-left` or `top-right`.
|
|
130
130
|
* @property {number} [icon-opacity=1] Opacity of the icon.
|
|
131
131
|
* @property {number|import("../size.js").Size} [icon-scale=1] Scale.
|
|
132
|
+
* @property {number} [icon-width] Width of the icon. If not specified, the actual image width will be used. Cannot be combined
|
|
133
|
+
* with `scale`.
|
|
134
|
+
* @property {number} [icon-height] Height of the icon. If not specified, the actual image height will be used. Cannot be combined
|
|
135
|
+
* with `scale`.
|
|
132
136
|
* @property {number} [icon-rotation=0] Rotation in radians (positive rotation clockwise).
|
|
133
137
|
* @property {boolean} [icon-rotate-with-view=false] Whether to rotate the icon with the view.
|
|
134
138
|
* @property {import("../size.js").Size} [icon-size] Icon size in pixel. Can be used together with `icon-offset` to define the
|
|
@@ -294,6 +298,8 @@ function getImage(flatStyle) {
|
|
|
294
298
|
displacement: flatStyle['icon-displacement'],
|
|
295
299
|
opacity: flatStyle['icon-opacity'],
|
|
296
300
|
scale: flatStyle['icon-scale'],
|
|
301
|
+
width: flatStyle['icon-width'],
|
|
302
|
+
height: flatStyle['icon-height'],
|
|
297
303
|
rotation: flatStyle['icon-rotation'],
|
|
298
304
|
rotateWithView: flatStyle['icon-rotate-with-view'],
|
|
299
305
|
size: flatStyle['icon-size'],
|
package/util.js
CHANGED