From 297b224a4f4bf7a5ff8fed82025802443d5fc07d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio=20Carvalho?= Date: Sat, 2 Feb 2019 11:17:53 -0200 Subject: [PATCH 1/4] Move VectorLayer source url to optional --- src/components/layer/VectorLayer.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/layer/VectorLayer.js b/src/components/layer/VectorLayer.js index a12e35c3..baa520d5 100644 --- a/src/components/layer/VectorLayer.js +++ b/src/components/layer/VectorLayer.js @@ -25,6 +25,10 @@ export default { type: String, required: true }, + type: { + type: String, + required: true + }, bounds: { type: Array, default: () => [-180, -85.051129, 180, 85.051129] @@ -77,10 +81,10 @@ export default { if (payload.mapId !== this.mapId) return; this.map = payload.map; let source = { - type: "vector", - url: this.url + type: "vector" }; + if (this.url) source.url = this.url; if (this.tiles) source.tiles = this.tiles; if (this.tilesMinZoom) source.minzoom = this.tilesMinZoom; if (this.tilesMaxZoom) source.maxzoom = this.tilesMinZoom; From d70a24e1355592c194b595c07d929d27f5d00925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio=20Carvalho?= Date: Sat, 2 Feb 2019 11:19:59 -0200 Subject: [PATCH 2/4] VectorLayer type default fill --- src/components/layer/VectorLayer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/layer/VectorLayer.js b/src/components/layer/VectorLayer.js index baa520d5..76906fa4 100644 --- a/src/components/layer/VectorLayer.js +++ b/src/components/layer/VectorLayer.js @@ -27,7 +27,7 @@ export default { }, type: { type: String, - required: true + default: "fill" }, bounds: { type: Array, @@ -133,7 +133,7 @@ export default { if (this.refLayer) { layer.ref = this.refLayer; } else { - layer.type = this.type ? this.type : "fill"; + layer.type = this.type; layer.source = this.sourceId; if (this.minzoom) layer.minzoom = this.minzoom; if (this.maxzoom) layer.maxzoom = this.maxzoom; From d985e8875bfbcfb626b5174db12d3ef8d1bb1b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio=20Carvalho?= Date: Sat, 2 Feb 2019 11:21:35 -0200 Subject: [PATCH 3/4] Change layer before prop type to string --- src/components/layer/layerMixin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/layer/layerMixin.js b/src/components/layer/layerMixin.js index 8584243b..ed95614d 100644 --- a/src/components/layer/layerMixin.js +++ b/src/components/layer/layerMixin.js @@ -19,7 +19,7 @@ const mapboxLayerStyleProps = { maxZoom: Number, paint: Object, layout: Object, - before: Object, + before: String, filter: undefined }; From 54886186493db9348d7a2edfc097f33b5c2f8fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio=20Carvalho?= Date: Sat, 2 Feb 2019 11:29:09 -0200 Subject: [PATCH 4/4] Added VectorLayer type doc --- docs_source/api/Layers/vectorlayer.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs_source/api/Layers/vectorlayer.md b/docs_source/api/Layers/vectorlayer.md index a58bfab8..bfa3f50b 100644 --- a/docs_source/api/Layers/vectorlayer.md +++ b/docs_source/api/Layers/vectorlayer.md @@ -49,6 +49,13 @@ - **Description:** An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: [sw.lng, sw.lat, ne.lng, ne.lat]. - **See:** `bounds` in [Mapbox Source Style Spec](https://www.mapbox.com/mapbox-gl-js/style-spec/#sources-vector-bounds) +### `type` + +- **Type:** `String` +- **Non-Synced** +- **Description:** Rendering type of this layer. +- **See:** `type` in [Mapbox Source Style Spec](https://www.mapbox.com/mapbox-gl-js/style-spec/#layers-type) + ### `scheme` - **Type:** `String`