threxx
threxx

Reputation: 1243

Using Geojson over normal markers with leaflet

I am building a web application with Angular and (Angular) Leaflet which includes a map with several hundreds markers in one area. Right now, all of our markers are simple L.circleMarkers. However as we need to reload these markers quite often and therefore have a bad performance, I thought about using geoJson. I did a bit research but could not find a real comparison of the simple markers and those geoJson markers.

So now I would like to know, if geoJson markers would be an applicable option or do they not really perform better than simple markers in large groups and frequent reloading. (If someone knows a even better way please feel free telling me so).

Thanks in advance!

Upvotes: 0

Views: 382

Answers (3)

spy
spy

Reputation: 39

I would recommend take a look into clustering concept, if you want to show lot of markers in small area. https://github.com/tombatossals/angular-leaflet-directive/tree/master/examples/ 0509-markers-clustering-example.html

Upvotes: 0

ghybs
ghybs

Reputation: 53280

Hundreds of markers is a lot, even if they are just circle markers (i.e. SVG).

The usual work around is to cluster them (e.g. using Leaflet.markercluster plugin), or to switch to canvas-based rendering instead of SVG.

Upvotes: 0

IvanSanchez
IvanSanchez

Reputation: 19069

I did a bit research but could not find a real comparison of the simple markers and those geoJson markers.

For Leaflet, they are exactly the same - when a piece of GeoJSON data is parsed, normal markers are spawned.

You should research more into what is your real bottleneck - use the profiling functionalities of your web browser's javascript debugger and see if there are delays in the network. Data processing shouldn't be a problem unless you're into the megabyte order of magnitude.

Upvotes: 1

Related Questions