Hi there, I imported the OSM tile layer into Javascript (leaflet), and can see it visually. But how do I access the actual data of the layer? It's vector data, made of points, lines, and polygons, right? How can I access the feature data for some part of the map with Javascript, like as json? Ex: Get the data for the polylines/polygons making up the streets/blocks of a town. Thank you asked 17 Jan '18, 00:03 noncomp |
You can query the OSM data with Overpass. There seems to be a framework to do that from Leaflet. Another method is to build the query and parse the result yourself in Javascript. This page lists some websites that combine Overpass and Leaflet answered 17 Jan '18, 04:09 escada The link you attached to "framework" doesn't link to a leaflet plugin, have you got a direct link? Thank you!
(17 Jan '18, 06:32)
noncomp
|
If I understand you well, you mean you want to access, for a certain area of the map, the underlying osm data that the OSM renderer used to create the tiles ?
Yes, e.g. if it displays an area with some streets and blocks from OSM, I want to be able to access the vector feature data describing those streets and blocks. Thank you, help is much appreciated!