Monday, 8 February 2021

HERE Traffic incidents integration in Leaflet.js

Background:

I'm currently integrating HERE maps into our web-based application. I'm trying both - HERE provided Javascript API and Leaflet at the same time to find the best approach for our use-case.

While JavaScript API provided by HERE maps is OK, rendering wise Leaflet performs much better when using raster tiles.

Issue:

It would be fine by me to use raster tiles + leaflet, but our application also needs to display traffic incidents data.

Traffic incident data is provided by HERE in JSON and XML formats (Documentation link, Example JSON). They provide [Z]/[X]/[Y], quadkey, prox, bbox, or corridor filters which can be used to retrieve filtered data set.

I've tried using [Z]/[X]/[Y] addressing with custom L.TileLayer implementation which loads appropriate JSON, converts it to GeoJSON and displays GeoJSON on map. However that approach is very inefficient and significant performance drop is visible.

Question:

Maybe anyone has already solved this issue and could share any insights on how the HERE traffic incidents could be shown on Leaflet map without encountering performance issues?



from HERE Traffic incidents integration in Leaflet.js

No comments:

Post a Comment