Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

GeoJSON added via REST not appearing in clusters #20

Open
WilliamWCYoung opened this issue Jul 15, 2018 · 9 comments
Open

GeoJSON added via REST not appearing in clusters #20

WilliamWCYoung opened this issue Jul 15, 2018 · 9 comments

Comments

@WilliamWCYoung
Copy link

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

@lsumx
Copy link

lsumx commented Jul 28, 2019

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

@WilliamWCYoung
Copy link
Author

Unfortunately not, sorry.

@jperelli
Copy link
Owner

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!

@lsumx
Copy link

lsumx commented Aug 2, 2019

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

@skinner12
Copy link

Any news?

@morfair
Copy link

morfair commented Dec 11, 2019

Wait for update too

@ray007
Copy link

ray007 commented Jan 9, 2020

Setting geojson data once works for me, but changing the geojson data does not work.
See also vue-leaflet/Vue2Leaflet#475

@morfair
Copy link

morfair commented Jan 9, 2020

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?

@SolimanGit
Copy link

Same thing, still no work around ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants