Skip to content

Commit

Permalink
add reactive prop to geojson layer
Browse files Browse the repository at this point in the history
  • Loading branch information
sboivinsystra committed Dec 12, 2023
1 parent 0f0fae1 commit 8d16af6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/api/Layers/geojsonlayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

All common [layers props](/api/Layers/README.md#props)

### `reactive`

- **Type:** `Boolean`
- **Default:** `true`
- **Description:** If false, no watcher on the source.data. you would need to manually update (ex: map.getSource('sourID').setData(newData))

### `source`

- **Type:** `Object | String`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-mapbox3",
"version": "0.6.1",
"version": "0.6.2",
"author": {
"name": "simon boivin",
"email": "[email protected]",
Expand Down
8 changes: 7 additions & 1 deletion src/components/layer/GeojsonLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import mixin from "./layerMixin";
export default {
name: "GeojsonLayer",
mixins: [mixin],
props: {
reactive: {
type: Boolean,
default: true
}
},

computed: {
getSourceFeatures() {
Expand Down Expand Up @@ -87,7 +93,7 @@ export default {
},

created() {
if (this.source) {
if (this.source && this.reactive) {
this.$watch(
"source.data",
function(next) {
Expand Down

0 comments on commit 8d16af6

Please sign in to comment.