vue2-leaflet-markercluster
vue2-leaflet-markercluster copied to clipboard
GeoJSON added via REST not appearing in clusters
I'm getting some geojson data via a RESTful API call in the created()
method which I store in the variable applications
. This variable is initialized as null
:
created () {
this.axios.get('/applications/proximity/').then((response) => {
this.applications = response.data
})
I am passing the variable into the template as such (ignore the l- prefix, I renamed them so they were consistent with the other leaflet components):
<l-marker-cluster :options="clusterOptions">
<l-geo-json :geojson="applications" :options="applicationsOptions">
</l-geo-json>
</l-marker-cluster>
The problem is I never see the clusters on the map! It does work if I manually set the points within the data()
method though. My thought is that it is not dynamically binding and refreshing when data is added?
Has anyone experienced similar or can advise what to do?
Many thanks, Will
me, too. i have no thought. so sad have you solved it? help!
Unfortunately not, sorry.
I'm reading you guys, but sadly didn't have the time to look into this. Will try to look into it this weekend, comment here so it reaches my mail and I don't forget!
it seems that cluster only works on the array of geojson.
i see the example on https://github.com/jperelli/vue2-leaflet-markercluster/blob/master/example-geojson.vue
and i use like that
<v-marker-cluster :options="clusterOptions"> <l-geo-json v-for="geojson in all.geojson" :geojson="geojson" :options="all.options" ></l-geo-json> </v-marker-cluster>
all:{ geojson:{features:[]}, options:{ } },
i hope it will work for you
i wonder if cluster can work for a single geojson
Any news?
Wait for update too
Setting geojson data once works for me, but changing the geojson data does not work. See also https://github.com/vue-leaflet/Vue2Leaflet/issues/475
Setting geojson data once works for me, but changing the geojson data does not work. See also vue-leaflet/Vue2Leaflet#475
Confirm, waiting for correction. Maybe there is an alternative?
Same thing, still no work around ?