I'm using the queryRenderedFeatures
function from https://maplibre.org/maplibre-gl-js-docs/example/queryrenderedfeatures/ to query all features over the mouse on a MapLibre map.
I have access to all Node
, and the id
identified in the windows looks similar to the OSM ID (where the mbtiles seems to add a '0' at the end of the OSM ID :
mbtiles ID : 1230
corresponds to OSM ID N123
)
(A) When I'm trying to access Way
, the ID doesn't show up in the queryRenderedFeatures
function
A console.log of the queried feature shows the ID as undefined
When I compare to the query on OpenStreetMap website, I can confirm that both return similar results by re-building the LineString output from MapLibre.
In other words, the query looks good and accurate, but I'm curious on how to fetch the OSM_ID from a way with this function ?
The source ID is road_path_pedestrian
, with its source layer being Transportation
for which I've added the osm_id
(in case this could have been the root cause)
(B) as for the relation
, is there any way to fetch those from the mbtiles (rendered or not) directly on the map ?
In the example above, the summit track has a relation on OSM that gathers all portions of the summit track ways. Is there a way to access as well the ID of this relation from the mbtiles, on the go ?
The objective is to have the user clicking on a path/track on a maplibre map, and the function to return the full OSM relation ID and LineString.
Exactly the same way it's currently done on OpenStreetMap website. For the same example, it would be the yellow track with its 7 members.
Thanks in advance for your support!