question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Best practise/performace for displaying 1000 features

See original GitHub issue

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

<vl-layer-vector id="sias" v-if="showSias" :z-index="1">
          <vl-source-vector :features.sync="sias"></vl-source-vector>
        </vl-layer-vector>

The second one seems to work but not quite fast.

<vl-layer-vector id="sias" v-if="showSias" :z-index="1">
          <vl-source-vector>
            <vl-feature v-for="feature in sias" :key="feature.id">
              <vl-geom-point :coordinates="feature.geometry.coordinates"></vl-geom-point>
            </vl-feature>
          </vl-source-vector>
        </vl-layer-vector>

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
sjmalloncommented, May 16, 2019

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:

  <vl-layer-vector>
    <vl-source-cluster :distance="clusterDistance" :key="key">
      <vl-source-vector :features="features" ref="gjsource"/>
      <vl-style-func :factory="clusterStyleFunc"/>
    </vl-source-cluster>
  </vl-layer-vector>

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 key variable above.

    watch: {
        features() {
            this.key++
        }
    },
1reaction
sjmalloncommented, May 15, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 Tips to Make Your Dashboards More Performant - Tableau
Practice guided analytics. There's no need to fit everything you plan to show in a single view. Compile related views and connect them...
Read more >
Tuning Tableau Server: Performance Best Practices - YouTube
The performance of your Tableau Server deployment can make or break your users' experiences and their acceptance of Tableau within your ...
Read more >
SQL Performance Best Practices | CockroachDB Docs
Best practices for optimizing SQL performance in CockroachDB. ... by monitoring the performance for different batch sizes (10 rows, 100 rows, 1000 rows)....
Read more >
14 Best Practices to Tune BigQuery SQL Performance
#1: LIMIT is a booby trap.​​ Best practice: LIMIT speeds up performance, but doesn't reduce costs. For data exploration, consider using BigQuery's (free)...
Read more >
9 Performance Best Practices - Oracle Help Center
9 Performance Best Practices. This topic provides tips for creating efficient data models for better performance. Topics: Know Oracle WebLogic Server ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found