I have a Leaflet web application which loads the data stored in a PostGIS database using pg_tileserv as Vector Tiles. I include the Vector Tiles as follows: new L.vectorGrid.protobuf('http://localhost:7800/mydata/{z}/{x}/{y}.pbf', options) Additionally I request from an external web service GeoJSON data which I can relate to my data by an ID.

I cannot add these external GeoJSON data to the database, as these data are very dynamic. As my data are static, I would like to add the attribute information from the GeoJSON data to my loaded Vector Tiles.

Can I and if yes, how can I join these GeoJSON data with my Vector Tiles? For MapboxGL JS there is a match expression in order to solve such an issue (https://docs.mapbox.com/mapbox-gl-js/example/data-join/), but is there anything similar that I can do with Leaflet?

  • 1
    Coding question on GIS SE site should include relevant existing code, otherwise it's most likely to be closed as not compliant with the site policy. Please edit your question and add relevant existing code.
    – TomazicM
    Nov 18 at 8:14


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy