-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Bulk adding and removing Markers #7
Comments
I might be implementing this somehow in this days. Seems a good feature to have. Thanks for the report, I'll let you know any news. |
@friedPotat0 @nickforddesign I made a pull request #8 can you help me test if that works to fix this issue? you can checkout the branch and test it locally using the example app |
@jperelli |
I'm getting this error - not exactly sure why though :(
|
@jperelli Thanks for trying to implement the feature. I was able to build the example successfully with Poi. The original markercluster doc has two examples for bulk adding with chunk progress: One with 10,000 and one with 50,000 markers to add ( |
ok, thanks for the reports, evidently the proposed solution is not working. I'm thinking if this is a problem with the implementation I made or if this is a problem with vue's v-for performance. Can't find any help on fixing vue's v-for performance easily, so I'll check my code and let you know if I can improve it somehow. Any comments on the pull request are infinitely welcomed :) |
The _add function in the Vue2LeafletMarkercluster component is called twice. Once in the mounted function and a few seconds later in the watcher for the options prop again. That is the reason why I got only one output of the chunkProgress-function. The second _add destroyed or stacked with the first adding progress in any way. After commenting out the options watcher I get a page load with the progress logged in every interval when setting the clusterOptions to:
But the overall page loading time is still very bad in comparison to the example. |
Okay, figured out that there is a setTimeout function in the example component which causes the options prop to be rewritten after 5 seconds. If you remove these lines the bulk adding only gets called once when mounting the markercluster. Probably the function is there for testing purposes only?! |
Right, the setTimeout was for testing purposes. I will make two test files, one only for bulk. I'll modify the PR today in a couple of hour. Thank you for your help! |
No problem. Please keep in mind that the build command of vue-cli is no longer useable for building your examples. When using
I fixed this by installing Poi new Vue({ After that I could build the example by running Hope this helps not only for the bulk testing but for the normal example, too. Alternatively the process could also be done with yarn like @skinnyjames mentioned earlier but I didn't test it. |
I modified the examples, but couldn't improve performance. Please let me know if the new Pull Request is ok or if you see that it runs slow
|
I got marker clusters to work well with vue as a standalone library. If it helps, I can take a closer look soonish! |
Yes please :) |
Hi all,
Would love to hear thoughts. |
Is there any way to achieve bulk adding/removing of markers to a cluster group like it's described in the Leaflet.markercluster doc?
https://github.com/Leaflet/Leaflet.markercluster#bulk-adding-and-removing-markers
I tried to reference the v-marker-cluster component and call the function contained in the mapObject to add the markers this.$refs.cluster.mapObject.addLayers(<MARKER_ARRAY>). But it throws an error saying 'layer.addEventParent is not a function'.
The text was updated successfully, but these errors were encountered: