Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added VectorLayer type prop and changed layerMixin before prop to String #81

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs_source/api/Layers/vectorlayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
10 changes: 7 additions & 3 deletions src/components/layer/VectorLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export default {
type: String,
required: true
},
type: {
type: String,
default: "fill"
},
bounds: {
type: Array,
default: () => [-180, -85.051129, 180, 85.051129]
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -129,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;
Expand Down
2 changes: 1 addition & 1 deletion src/components/layer/layerMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const mapboxLayerStyleProps = {
maxZoom: Number,
paint: Object,
layout: Object,
before: Object,
before: String,
filter: undefined
};

Expand Down