diff --git a/src/Core/Style.js b/src/Core/Style.js index 23a2d68029..44f78194c3 100644 --- a/src/Core/Style.js +++ b/src/Core/Style.js @@ -302,15 +302,12 @@ function _addIcon(icon, domElement, opt) { } /** - * An object that can contain any properties (order, zoom, fill, stroke, point, + * An object that can contain any properties (zoom, fill, stroke, point, * text or/and icon) and sub properties of a Style.
* Used for the instanciation of a {@link Style}. * * @typedef {Object} StyleOptions * - * @property {Number} [order] - Order of the features that will be associated to - * the style. It can helps sorting and prioritizing features if needed. - * * @property {Object} [zoom] - Level on which to display the feature * @property {Number} [zoom.max] - max level * @property {Number} [zoom.min] - min level @@ -468,8 +465,6 @@ function _addIcon(icon, domElement, opt) { * The first parameter of functions used to set `Style` properties is always an object containing * the properties of the features displayed with the current `Style` instance. * - * @property {Number} order - Order of the features that will be associated to - * the style. It can helps sorting and prioritizing features if needed. * @property {Object} fill - Polygons and fillings style. * @property {String|Function|THREE.Color} fill.color - Defines the main color of the filling. Can be * any [valid color @@ -619,15 +614,13 @@ function _addIcon(icon, domElement, opt) { class Style { /** * @param {StyleOptions} [params={}] An object that contain any properties - * (order, zoom, fill, stroke, point, text or/and icon) + * (zoom, fill, stroke, point, text or/and icon) * and sub properties of a Style ({@link StyleOptions}). */ constructor(params = {}) { this.isStyle = true; this.context = new StyleContext(); - this.order = params.order || 0; - params.zoom = params.zoom || {}; params.fill = params.fill || {}; params.stroke = params.stroke || {}; @@ -767,13 +760,12 @@ class Style { * set Style from vector tile layer properties. * @param {Object} layer vector tile layer. * @param {Object} sprites vector tile layer. - * @param {Number} [order=0] * @param {Boolean} [symbolToCircle=false] * @param {Set} warn Set storing all warnings encountered by the source. * * @returns {StyleOptions} containing all properties for itowns.Style */ - static setFromVectorTileLayer(layer, sprites, order = 0, symbolToCircle = false, warn) { + static setFromVectorTileLayer(layer, sprites, symbolToCircle = false, warn) { const style = { fill: {}, stroke: {}, @@ -785,8 +777,6 @@ class Style { layer.layout = layer.layout || {}; layer.paint = layer.paint || {}; - style.order = order; - if (layer.type === 'fill') { const { color, opacity } = rgba2rgb(readVectorProperty(layer.paint['fill-color'] || layer.paint['fill-pattern'], { type: 'color' })); style.fill.color = color; @@ -848,7 +838,7 @@ class Style { // content style.text.field = readVectorProperty(layer.layout['text-field']); - style.text.wrap = readVectorProperty(layer.layout['text-max-width']); + style.text.wrap = readVectorProperty(layer.layout['text-max-width']);// Units ems style.text.spacing = readVectorProperty(layer.layout['text-letter-spacing']); style.text.transform = readVectorProperty(layer.layout['text-transform']); style.text.justify = readVectorProperty(layer.layout['text-justify']); diff --git a/src/Layer/LabelLayer.js b/src/Layer/LabelLayer.js index 383d16b944..c6d18f0d6e 100644 --- a/src/Layer/LabelLayer.js +++ b/src/Layer/LabelLayer.js @@ -306,6 +306,7 @@ class LabelLayer extends GeometryLayer { const label = new Label(content, coord.clone(), this.style); label.layerId = this.id; + label.order = f.order; label.padding = this.margin || label.padding; labels.push(label); diff --git a/src/Source/VectorTilesSource.js b/src/Source/VectorTilesSource.js index 6d6aa8e231..cc806c9de2 100644 --- a/src/Source/VectorTilesSource.js +++ b/src/Source/VectorTilesSource.js @@ -111,7 +111,7 @@ class VectorTilesSource extends TMSSource { layer[prop] = refLayer[prop]; }); } - const style = Style.setFromVectorTileLayer(layer, this.sprites, order, this.symbolToCircle, this.warn); + const style = Style.setFromVectorTileLayer(layer, this.sprites, this.symbolToCircle, this.warn); this.styles[layer.id] = style; if (!this.layers[layer['source-layer']]) {