vue2-leaflet-markercluster icon indicating copy to clipboard operation
vue2-leaflet-markercluster copied to clipboard

GeoJSON added via REST not appearing in clusters

Open WilliamWCYoung opened this issue 6 years ago • 9 comments

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

WilliamWCYoung avatar Jul 15 '18 16:07 WilliamWCYoung

me, too. i have no thought. so sad have you solved it? help!

lsumx avatar Jul 28 '19 14:07 lsumx

Unfortunately not, sorry.

WilliamWCYoung avatar Jul 30 '19 21:07 WilliamWCYoung

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!

jperelli avatar Jul 30 '19 22:07 jperelli

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

lsumx avatar Aug 02 '19 06:08 lsumx

Any news?

skinner12 avatar Oct 09 '19 23:10 skinner12

Wait for update too

morfair avatar Dec 11 '19 18:12 morfair

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

ray007 avatar Jan 09 '20 09:01 ray007

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?

morfair avatar Jan 09 '20 09:01 morfair

Same thing, still no work around ?

SolimanGit avatar Oct 20 '21 12:10 SolimanGit