logoalt Hacker News

coalteddytoday at 6:40 PM2 repliesview on HN

Does anyone know how they make their map so performant? Showing all those pins is mind blowing to me coming from leaflet maps. Marinetraffic is also a map that blows me away every time i see all the icons and how smooth and fast the loading is when zooming in. Would love to make a similar map at some point for my hobby but leaflet just does not cut it when you want to render 10million plus pins on a global map.

Tech blogs or pointers would be great


Replies

jw_cooktoday at 7:01 PM

Points are rendered server-side, backed by Elasticsearch, and served as PNG tiles for each zoom level. Individual markers are only rendered for small sets. Some of the relevant source code:

https://github.com/inaturalist/inaturalist/blob/main/app/ass...

https://github.com/inaturalist/inaturalist/blob/main/app/ass...

https://github.com/inaturalist/inaturalist/blob/main/app/ass...

noahgolmanttoday at 6:47 PM

You may want to look into the PMTiles format and tippecanoe. It efficiently produces pyramidal XYZ tile overviews of vector data. Sometimes this is also done server side via the PostGIS asMVT ffunction, or Martin.

For client side rendering, deck.gl is quite good, also a newer library called lonboard from DevelopmentSeed.