-
Notifications
You must be signed in to change notification settings - Fork 229
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
Best practise/performace for displaying 1000 features #166
Comments
This first way is work but the problem is when you change 'sias' and load another data, The vector layer will not show all new features and will cache some of the old features. I try to use like this this.$refs.vector[0].refresh() or this.$refs.vector[0].getFeatures().clear() we don't have any example that shows data change. |
Thanks for the response and I tried what u said but it is not really what I am looking for. I have a vector with, in this example, 900 points. And I would like to find a way to display those without the map slowing down image. Refreshing the vector did not really work. It might be an idea to cluster the points when zooing out. So less points are visible, and when zooming in more points are visible again? |
To overcome a similar issue I have used Object.freeze on the feature array to remove the Vue reactivity overhead, allowing successful operation with at least 10,000 features. This will however not work in combination with the .sync modifier. |
Thanks, it is a great solution however I do need the feature list to be able to add and remove data. In openlayers there is something like clusters shown here https://openlayers.org/en/latest/examples/cluster.html can this be done in Vuelayers? |
Even though it's not documented, clustering is implemented, as can be seen in the demo app. Here's a snippet from one of my apps:
My experience has been that clustering brought limited performance benefits, so I still use Object.freeze. To trigger re-rendering on feature changes at the Vue level, I use a watcher and increment the
|
@sjmallon |
Hi for all! @DaanO123 What is your use case? What you plan to do with 5k features showing at the same moment on the map? |
Thanks for all the responses I'll keep them in mind! For now I found a way I don't need to use so many features. Thanks guys! |
@DaanO123 Hello, I'm facing the same issue. Could you tell me how you did it? |
Hi @a971106a, like I said in a comment before: Instead of rendering so many features I created district areas that had a count with the actual amount. However I did try to use the Object.freeze like @sjmallon explained, it worked if the list is fixed which in my case wasn't an option. It is over a year ago so maybe this doesn't make any sense or new features arived. Let me know! |
Hi,
I want to draw between 200 and 5000 points on the map. I used two ways.
With the first one google chrome stops working
The second one seems to work but not quite fast.
Thanks!
The text was updated successfully, but these errors were encountered: