Getting ZoomLevel from page html?

Is there any way to parse the html for an OSM-based page (created by a travel-time tool) to find the OSM zoom level for the map that is being displayed?

I am experimenting with using the tool to compare how far you can get by car vs by public transport in the same time, from a variety of locations.

I have no budget for my research, so can’t afford to use the tool’s API, which I am sure would give me all I need. But the tool does offer a free casual-user interface which produces an OSM map with shading of the areas that can be reached by a particular transport mode in a particular time.

My idea is to write code that will work out the square km of the area that is shaded. But as I re-run the query with different settings, the OSM scale changes. It would be great to be able to parse the HTML source code for the page and extract the OSM zoom level. But my explorations haven’t found any sign of a parameter that I can identify as the ZoomLevel.


Probably not, because …

… it will very probably be set dynamically with javascript to the zoom level needed by the area that needs to be displayed and the available space on the device. This may be done by methods like the leaflet method fitBounds() or the equivalent of the library used by the tool.

1 Like