itowns 2.44.3-next.34 → 2.44.3-next.35

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.
@@ -1,7 +1,7 @@
1
1
  import * as THREE from 'three';
2
2
  import Extent from "./Geographic/Extent.js";
3
3
  import Coordinates from "./Geographic/Coordinates.js";
4
- import Style from "./Style.js";
4
+ import StyleOptions from "./StyleOptions.js";
5
5
  function defaultExtent(crs) {
6
6
  return new Extent(crs, Infinity, -Infinity, Infinity, -Infinity);
7
7
  }
@@ -247,7 +247,7 @@ class Feature {
247
247
  }
248
248
  this._pos = 0;
249
249
  this._pushValues = (this.size === 3 ? push3DValues : push2DValues).bind(this);
250
- this.style = Style.setFromProperties;
250
+ this.style = StyleOptions.setFromProperties;
251
251
  }
252
252
  /**
253
253
  * Instance a new {@link FeatureGeometry} and push in {@link Feature}.
package/lib/Core/Style.js CHANGED
@@ -1,7 +1,5 @@
1
- import { FEATURE_TYPES } from "./Feature.js";
2
1
  import Cache from "./Scheduler/Cache.js";
3
2
  import Fetcher from "../Provider/Fetcher.js";
4
- import * as maplibre from '@maplibre/maplibre-gl-style-spec';
5
3
  import { Color } from 'three';
6
4
  import { deltaE } from "../Renderer/Color.js";
7
5
  import Coordinates from "./Geographic/Coordinates.js";
@@ -10,7 +8,6 @@ const itowns_stroke_single_before = ".itowns-stroke-single:before {\n display
10
8
  const cacheStyle = new Cache();
11
9
  const matrix = document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGMatrix();
12
10
  const canvas = document.createElement('canvas');
13
- const inv255 = 1 / 255;
14
11
  function baseAltitudeDefault(properties, ctx) {
15
12
  return ctx?.coordinates?.z || 0;
16
13
  }
@@ -40,46 +37,6 @@ export function readExpression(property, ctx) {
40
37
  }
41
38
  return property;
42
39
  }
43
- function rgba2rgb(orig) {
44
- if (!orig) {
45
- return {};
46
- } else if (orig.stops || orig.expression) {
47
- return {
48
- color: orig
49
- };
50
- } else if (typeof orig == 'string') {
51
- const result = orig.match(/(?:((hsl|rgb)a? *\(([\d.%]+(?:deg|g?rad|turn)?)[ ,]*([\d.%]+)[ ,]*([\d.%]+)[ ,/]*([\d.%]*)\))|(#((?:[\d\w]{3}){1,2})([\d\w]{1,2})?))/i);
52
- if (result === null) {
53
- return {
54
- color: orig,
55
- opacity: 1.0
56
- };
57
- } else if (result[7]) {
58
- let opacity = 1.0;
59
- if (result[9]) {
60
- opacity = parseInt(result[9].length == 1 ? `${result[9]}${result[9]}` : result[9], 16) * inv255;
61
- }
62
- return {
63
- color: `#${result[8]}`,
64
- opacity
65
- };
66
- } else if (result[1]) {
67
- return {
68
- color: `${result[2]}(${result[3]},${result[4]},${result[5]})`,
69
- opacity: result[6] ? Number(result[6]) : 1.0
70
- };
71
- }
72
- }
73
- }
74
- function readVectorProperty(property, options) {
75
- if (property != undefined) {
76
- if (maplibre.expression.isExpression(property)) {
77
- return maplibre.expression.createExpression(property, options).value;
78
- } else {
79
- return property;
80
- }
81
- }
82
- }
83
40
  async function loadImage(source) {
84
41
  let promise = cacheStyle.get(source, 'null');
85
42
  if (!promise) {
@@ -293,150 +250,6 @@ function _addIcon(icon, domElement, opt) {
293
250
  return cIcon;
294
251
  }
295
252
 
296
- /**
297
- * An object that can contain any properties (zoom, fill, stroke, point,
298
- * text or/and icon) and sub properties of a Style.<br/>
299
- * Used for the instanciation of a {@link Style}.
300
- *
301
- * @typedef {Object} StyleOptions
302
- *
303
- * @property {Object} [zoom] - Level on which to display the feature
304
- * @property {Number} [zoom.max] - max level
305
- * @property {Number} [zoom.min] - min level
306
- *
307
- * @property {Object} [fill] - Fill style for polygons.
308
- * @property {String|Function|THREE.Color} [fill.color] - Defines the main fill color. Can be
309
- * any [valid color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
310
- * Default is no value, which means no fill.
311
- * If the `Layer` is a `GeometryLayer` you can use `THREE.Color`.
312
- * @property {Image|Canvas|String|Object|Function} [fill.pattern] - Defines a pattern to fill the
313
- * surface with. It can be an `Image` to use directly, an url to fetch the pattern or an object containing
314
- * the url of the image to fetch and the transformation to apply.
315
- * from. See [this example](http://www.itowns-project.org/itowns/examples/#source_file_geojson_raster)
316
- * for how to use.
317
- * @property {Image|String} [fill.pattern.source] - The image or the url to fetch the pattern image
318
- * @property {Object} [fill.pattern.cropValues] - The x, y, width and height (in pixel) of the sub image to use.
319
- * @property {THREE.Color} [fill.pattern.color] - Can be any
320
- * [valid color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
321
- * It will change the color of the white pixels of the source image.
322
- * @property {Number|Function} [fill.opacity] - The opacity of the color or of the
323
- * pattern. Can be between `0.0` and `1.0`. Default is `1.0`.
324
- * For a `GeometryLayer`, this opacity property isn't used.
325
- * @property {Number|Function} [fill.base_altitude] - `GeometryLayer` style option, defines altitude
326
- * for each coordinate.
327
- * If `base_altitude` is `undefined`, the original altitude is kept, and if it doesn't exist
328
- * then the altitude value is set to 0.
329
- * @property {Number|Function} [fill.extrusion_height] - `GeometryLayer` style option, if defined,
330
- * polygons will be extruded by the specified amount
331
- *
332
- * @property {Object} [stroke] - Lines and polygons edges.
333
- * @property {String|Function|THREE.Color} [stroke.color] The color of the line. Can be any [valid
334
- * color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
335
- * Default is no value, which means no stroke.
336
- * If the `Layer` is a `GeometryLayer` you can use `THREE.Color`.
337
- * @property {Number|Function} [stroke.opacity] - The opacity of the line. Can be between
338
- * `0.0` and `1.0`. Default is `1.0`.
339
- * For a `GeometryLayer`, this opacity property isn't used.
340
- * @property {Number|Function} [stroke.width] - The width of the line. Default is `1.0`.
341
- * @property {Number|Function} [stroke.base_altitude] - `GeometryLayer` style option, defines altitude
342
- * for each coordinate.
343
- * If `base_altitude` is `undefined`, the original altitude is kept, and if it doesn't exist
344
- * then the altitude value is set to 0.
345
- *
346
- * @property {Object} [point] - Point style.
347
- * @property {String|Function} [point.color] - The color of the point. Can be any [valid
348
- * color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
349
- * Default is no value, which means points won't be displayed.
350
- * @property {Number|Function} [point.radius] - The radius of the point, in pixel. Default
351
- * is `2.0`.
352
- * @property {String|Function} [point.line] - The color of the border of the point. Can be
353
- * any [valid color
354
- * string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
355
- * Not supported for a `GeometryLayer`.
356
- * @property {Number|Function} [point.width] - The width of the border, in pixel. Default
357
- * is `0.0` (no border).
358
- * @property {Number|Function} [point.opacity] - The opacity of the point. Can be between
359
- * `0.0` and `1.0`. Default is `1.0`.
360
- * Not supported for `GeometryLayer`.
361
- * @property {Number|Function} [point.base_altitude] - `GeometryLayer` style option, defines altitude
362
- * for each coordinate.
363
- * If `base_altitude` is `undefined`, the original altitude is kept, and if it doesn't exist
364
- * then the altitude value is set to 0.
365
- * @property {Object} [point.model] - 3D model to instantiate at each point position.
366
- *
367
- * @property {Object} [text] - All things {@link Label} related. (Supported for Points features, not yet
368
- * for Lines and Polygons features.)
369
- * @property {String|Function} [text.field] - A string representing a property key of
370
- * a `FeatureGeometry` enclosed in brackets, that will be replaced by the value of the
371
- * property for each geometry. For example, if each geometry contains a `name` property,
372
- * `text.field` can be set to `{name}`. Default is no value, indicating that no
373
- * text will be displayed.
374
- *
375
- * It's also possible to create more complex expressions. For example, you can combine
376
- * text that will always be displayed (e.g. `foo`) and variable properties (e.g. `{bar}`)
377
- * like the following: `foo {bar}`. You can also use multiple variables in one field.
378
- * Let's say for instance that you have two properties latin name and local name of a
379
- * place, you can write something like `{name_latin} - {name_local}` which can result
380
- * in `Marrakesh - مراكش` for example.
381
- * @property {String|Function} [text.color] - The color of the text. Can be any [valid
382
- * color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
383
- * Default is `#000000`.
384
- * @property {String|Number[]|Function} [text.anchor] - The anchor of the text compared to its
385
- * position (see {@link Label} for the position). Can be one of the following values: `top`,
386
- * `left`, `bottom`, `right`, `center`, `top-left`, `top-right`, `bottom-left`
387
- * or `bottom-right`. Default is `center`.
388
- *
389
- * It can also be defined as an Array of two numbers. Each number defines an offset (in
390
- * fraction of the label width and height) between the label position and the top-left
391
- * corner of the text. The first value is the horizontal offset, and the second is the
392
- * vertical offset. For example, `[-0.5, -0.5]` will be equivalent to `center`.
393
- * @property {Array|Function} [text.offset] - The offset of the text, depending on its
394
- * anchor, in pixels. First value is from `left`, second is from `top`. Default
395
- * is `[0, 0]`.
396
- * @property {Number|Function} [text.padding] - The padding outside the text, in pixels.
397
- * Default is `2`.
398
- * @property {Number|Function} [text.size] - The size of the font, in pixels. Default is
399
- * `16`.
400
- * @property {Number|Function} [text.wrap] - The maximum width, in pixels, before the text
401
- * is wrapped, because the string is too long. Default is `10`.
402
- * @property {Number|Function} [text.spacing] - The spacing between the letters, in `em`.
403
- * Default is `0`.
404
- * @property {String|Function} [text.transform] - A value corresponding to the [CSS
405
- * property
406
- * `text-transform`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform).
407
- * Default is `none`.
408
- * @property {String|Function} [text.justify] - A value corresponding to the [CSS property
409
- * `text-align`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align).
410
- * Default is `center`.
411
- * @property {Number|Function} [text.opacity] - The opacity of the text. Can be between
412
- * `0.0` and `1.0`. Default is `1.0`.
413
- * @property {Array|Function} [text.font] - A list (as an array of string) of font family
414
- * names, prioritized in the order it is set. Default is `Open Sans Regular,
415
- * Arial Unicode MS Regular, sans-serif`.
416
- * @property {String|Function} [text.haloColor] - The color of the halo. Can be any [valid
417
- * color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
418
- * Default is `#000000`.
419
- * @property {Number|Function} [text.haloWidth] - The width of the halo, in pixels.
420
- * Default is `0`.
421
- * @property {Number|Function} [text.haloBlur] - The blur value of the halo, in pixels.
422
- * Default is `0`.
423
- *
424
- * @property {Object} [icon] - Defines the appearance of icons attached to label.
425
- * @property {String} [icon.source] - The url of the icons' image file.
426
- * @property {String} [icon.id] - The id of the icons' sub-image in a vector tile data set.
427
- * @property {String} [icon.cropValues] - the x, y, width and height (in pixel) of the sub image to use.
428
- * @property {String} [icon.anchor] - The anchor of the icon compared to the label position.
429
- * Can be `left`, `bottom`, `right`, `center`, `top-left`, `top-right`, `bottom-left`
430
- * or `bottom-right`. Default is `center`.
431
- * @property {Number} [icon.size] - If the icon's image is passed with `icon.source` and/or
432
- * `icon.id`, its size when displayed on screen is multiplied by `icon.size`. Default is `1`.
433
- * @property {String|Function} [icon.color] - The color of the icon. Can be any [valid
434
- * color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
435
- * It will change the color of the white pixels of the icon source image.
436
- * @property {Number|Function} [icon.opacity] - The opacity of the icon. Can be between
437
- * `0.0` and `1.0`. Default is `1.0`.
438
- */
439
-
440
253
  /**
441
254
  * A Style is a class that defines the visual appearance of {@link
442
255
  * FeatureCollection} and {@link Feature}. It is taken into account when drawing
@@ -682,301 +495,6 @@ class Style {
682
495
  this.context = ctx;
683
496
  }
684
497
 
685
- /**
686
- * set Style from (geojson-like) properties.
687
- * @param {Object} properties (geojson-like) properties.
688
- * @param {FeatureContext} featCtx the context of the feature
689
- *
690
- * @returns {StyleOptions} containing all properties for itowns.Style
691
- */
692
- static setFromProperties(properties, featCtx) {
693
- const type = featCtx.type;
694
- const style = {};
695
- if (type === FEATURE_TYPES.POINT) {
696
- const point = {
697
- ...(properties.fill !== undefined && {
698
- color: properties.fill
699
- }),
700
- ...(properties['fill-opacity'] !== undefined && {
701
- opacity: properties['fill-opacity']
702
- }),
703
- ...(properties.stroke !== undefined && {
704
- line: properties.stroke
705
- }),
706
- ...(properties.radius !== undefined && {
707
- radius: properties.radius
708
- })
709
- };
710
- if (Object.keys(point).length) {
711
- style.point = point;
712
- }
713
- const text = {
714
- ...(properties['label-color'] !== undefined && {
715
- color: properties['label-color']
716
- }),
717
- ...(properties['label-opacity'] !== undefined && {
718
- opacity: properties['label-opacity']
719
- }),
720
- ...(properties['label-size'] !== undefined && {
721
- size: properties['label-size']
722
- })
723
- };
724
- if (Object.keys(point).length) {
725
- style.text = text;
726
- }
727
- const icon = {
728
- ...(properties.icon !== undefined && {
729
- source: properties.icon
730
- }),
731
- ...(properties['icon-scale'] !== undefined && {
732
- size: properties['icon-scale']
733
- }),
734
- ...(properties['icon-opacity'] !== undefined && {
735
- opacity: properties['icon-opacity']
736
- }),
737
- ...(properties['icon-color'] !== undefined && {
738
- color: properties['icon-color']
739
- })
740
- };
741
- if (Object.keys(icon).length) {
742
- style.icon = icon;
743
- }
744
- } else {
745
- const stroke = {
746
- ...(properties.stroke !== undefined && {
747
- color: properties.stroke
748
- }),
749
- ...(properties['stroke-width'] !== undefined && {
750
- width: properties['stroke-width']
751
- }),
752
- ...(properties['stroke-opacity'] !== undefined && {
753
- opacity: properties['stroke-opacity']
754
- })
755
- };
756
- if (Object.keys(stroke).length) {
757
- style.stroke = stroke;
758
- }
759
- if (type !== FEATURE_TYPES.LINE) {
760
- const fill = {
761
- ...(properties.fill !== undefined && {
762
- color: properties.fill
763
- }),
764
- ...(properties['fill-opacity'] !== undefined && {
765
- opacity: properties['fill-opacity']
766
- })
767
- };
768
- if (Object.keys(fill).length) {
769
- style.fill = fill;
770
- }
771
- }
772
- }
773
- return style;
774
- }
775
-
776
- /**
777
- * set Style from vector tile layer properties.
778
- * @param {Object} layer vector tile layer.
779
- * @param {Object} sprites vector tile layer.
780
- * @param {Boolean} [symbolToCircle=false]
781
- *
782
- * @returns {StyleOptions} containing all properties for itowns.Style
783
- */
784
- static setFromVectorTileLayer(layer, sprites) {
785
- let symbolToCircle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
786
- const style = {
787
- fill: {},
788
- stroke: {},
789
- point: {},
790
- text: {},
791
- icon: {}
792
- };
793
- layer.layout = layer.layout || {};
794
- layer.paint = layer.paint || {};
795
- if (layer.type === 'fill') {
796
- const {
797
- color,
798
- opacity
799
- } = rgba2rgb(readVectorProperty(layer.paint['fill-color'] || layer.paint['fill-pattern'], {
800
- type: 'color'
801
- }));
802
- style.fill.color = color;
803
- style.fill.opacity = readVectorProperty(layer.paint['fill-opacity']) || opacity;
804
- if (layer.paint['fill-pattern']) {
805
- try {
806
- style.fill.pattern = {
807
- id: layer.paint['fill-pattern'],
808
- source: sprites.source,
809
- cropValues: sprites[layer.paint['fill-pattern']]
810
- };
811
- } catch (err) {
812
- err.message = `VTlayer '${layer.id}': argument sprites must not be null when using layer.paint['fill-pattern']`;
813
- throw err;
814
- }
815
- }
816
- if (layer.paint['fill-outline-color']) {
817
- const {
818
- color,
819
- opacity
820
- } = rgba2rgb(readVectorProperty(layer.paint['fill-outline-color'], {
821
- type: 'color'
822
- }));
823
- style.stroke.color = color;
824
- style.stroke.opacity = opacity;
825
- style.stroke.width = 1.0;
826
- } else {
827
- style.stroke.width = 0.0;
828
- }
829
- } else if (layer.type === 'line') {
830
- const prepare = readVectorProperty(layer.paint['line-color'], {
831
- type: 'color'
832
- });
833
- const {
834
- color,
835
- opacity
836
- } = rgba2rgb(prepare);
837
- style.stroke.dasharray = readVectorProperty(layer.paint['line-dasharray']);
838
- style.stroke.color = color;
839
- style.stroke.lineCap = layer.layout['line-cap'];
840
- style.stroke.width = readVectorProperty(layer.paint['line-width']);
841
- style.stroke.opacity = readVectorProperty(layer.paint['line-opacity']) || opacity;
842
- } else if (layer.type === 'circle' || symbolToCircle) {
843
- const {
844
- color,
845
- opacity
846
- } = rgba2rgb(readVectorProperty(layer.paint['circle-color'], {
847
- type: 'color'
848
- }));
849
- style.point.color = color;
850
- style.point.opacity = opacity;
851
- style.point.radius = readVectorProperty(layer.paint['circle-radius']);
852
- } else if (layer.type === 'symbol') {
853
- // if symbol we shouldn't draw stroke but defaut value is 1.
854
- style.stroke.width = 0.0;
855
- // overlapping order
856
- style.text.zOrder = readVectorProperty(layer.layout['symbol-z-order']);
857
- if (style.text.zOrder == 'auto') {
858
- style.text.zOrder = readVectorProperty(layer.layout['symbol-sort-key']) || 'Y';
859
- } else if (style.text.zOrder == 'viewport-y') {
860
- style.text.zOrder = 'Y';
861
- } else if (style.text.zOrder == 'source') {
862
- style.text.zOrder = 0;
863
- }
864
-
865
- // position
866
- style.text.anchor = readVectorProperty(layer.layout['text-anchor']);
867
- style.text.offset = readVectorProperty(layer.layout['text-offset']);
868
- style.text.padding = readVectorProperty(layer.layout['text-padding']);
869
- style.text.size = readVectorProperty(layer.layout['text-size']);
870
- style.text.placement = readVectorProperty(layer.layout['symbol-placement']);
871
- style.text.rotation = readVectorProperty(layer.layout['text-rotation-alignment']);
872
-
873
- // content
874
- style.text.field = readVectorProperty(layer.layout['text-field']);
875
- style.text.wrap = readVectorProperty(layer.layout['text-max-width']); // Units ems
876
- style.text.spacing = readVectorProperty(layer.layout['text-letter-spacing']);
877
- style.text.transform = readVectorProperty(layer.layout['text-transform']);
878
- style.text.justify = readVectorProperty(layer.layout['text-justify']);
879
-
880
- // appearance
881
- const {
882
- color,
883
- opacity
884
- } = rgba2rgb(readVectorProperty(layer.paint['text-color'], {
885
- type: 'color'
886
- }));
887
- style.text.color = color;
888
- style.text.opacity = readVectorProperty(layer.paint['text-opacity']) || opacity !== undefined && opacity;
889
- style.text.font = readVectorProperty(layer.layout['text-font']);
890
- const haloColor = readVectorProperty(layer.paint['text-halo-color'], {
891
- type: 'color'
892
- });
893
- if (haloColor) {
894
- style.text.haloColor = haloColor.color || haloColor;
895
- style.text.haloWidth = readVectorProperty(layer.paint['text-halo-width']);
896
- style.text.haloBlur = readVectorProperty(layer.paint['text-halo-blur']);
897
- }
898
-
899
- // additional icon
900
- const iconImg = readVectorProperty(layer.layout['icon-image']);
901
- if (iconImg) {
902
- const cropValueDefault = {
903
- x: 0,
904
- y: 0,
905
- width: 1,
906
- height: 1
907
- };
908
- try {
909
- style.icon.id = iconImg;
910
- if (iconImg.stops) {
911
- const iconCropValue = {
912
- ...(iconImg.base !== undefined && {
913
- base: iconImg.base
914
- }),
915
- stops: iconImg.stops.map(stop => {
916
- let cropValues = sprites[stop[1]];
917
- if (stop[1].includes('{')) {
918
- cropValues = function (p) {
919
- const id = stop[1].replace(/\{(.+?)\}/g, (a, b) => p[b] || '').trim();
920
- if (cropValues === undefined) {
921
- // const warning = `WARNING: "${id}" not found in sprite file`;
922
- sprites[id] = cropValueDefault; // or return cropValueDefault;
923
- }
924
- return sprites[id];
925
- };
926
- } else if (cropValues === undefined) {
927
- // const warning = `WARNING: "${stop[1]}" not found in sprite file`;
928
- cropValues = cropValueDefault;
929
- }
930
- return [stop[0], cropValues];
931
- })
932
- };
933
- style.icon.cropValues = iconCropValue;
934
- } else {
935
- style.icon.cropValues = sprites[iconImg];
936
- if (iconImg.includes('{')) {
937
- style.icon.cropValues = function (p) {
938
- const id = iconImg.replace(/\{(.+?)\}/g, (a, b) => p[b] || '').trim();
939
- if (sprites[id] === undefined) {
940
- // const warning = `WARNING: "${id}" not found in sprite file`;
941
- sprites[id] = cropValueDefault; // or return cropValueDefault;
942
- }
943
- return sprites[id];
944
- };
945
- } else if (sprites[iconImg] === undefined) {
946
- // const warning = `WARNING: "${iconImg}" not found in sprite file`;
947
- style.icon.cropValues = cropValueDefault;
948
- }
949
- }
950
- style.icon.source = sprites.source;
951
- style.icon.size = readVectorProperty(layer.layout['icon-size']) ?? 1;
952
- const {
953
- color,
954
- opacity
955
- } = rgba2rgb(readVectorProperty(layer.paint['icon-color'], {
956
- type: 'color'
957
- }));
958
- // https://docs.mapbox.com/style-spec/reference/layers/#paint-symbol-icon-color
959
- if (iconImg.sdf) {
960
- style.icon.color = color;
961
- }
962
- style.icon.opacity = readVectorProperty(layer.paint['icon-opacity']) ?? (opacity !== undefined && opacity);
963
- } catch (err) {
964
- err.message = `VTlayer '${layer.id}': argument sprites must not be null when using layer.layout['icon-image']`;
965
- throw err;
966
- }
967
- }
968
- }
969
- // VectorTileSet: by default minZoom = 0 and maxZoom = 24
970
- // https://docs.mapbox.com/style-spec/reference/layers/#maxzoom and #minzoom
971
- // Should be move to layer properties, when (if) one mapBox layer will be considered as several itowns layers.
972
- // issue https://github.com/iTowns/itowns/issues/2153 (last point)
973
- style.zoom = {
974
- min: layer.minzoom || 0,
975
- max: layer.maxzoom || 24
976
- };
977
- return style;
978
- }
979
-
980
498
  /**
981
499
  * Applies the style.fill to a polygon of the texture canvas.
982
500
  * @param {CanvasRenderingContext2D} txtrCtx The Context 2D of the texture canvas.