jgpacker / osm-smart-menu

An OpenStreetMap webextension for Firefox and Chrome
GNU General Public License v3.0
56 stars 12 forks source link

Recognize parameters from sites with Leaflet (a common map library) #30

Open jgpacker opened 4 years ago

jgpacker commented 4 years ago

Some websites may not show {zoom, latitude, longitude} parameters in the URL or a permalink. If they use Leaflet, is it possible to extract these parameters somehow?

Examples:

jgpacker commented 4 years ago

If document.querySelectorAll('.leaflet-tile-container img') returns images with URLs like https://b.tile.openstreetmap.org/14/9571/4764.png , then it may be possible to calculate the coordinates with this: https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#ECMAScript_.28JavaScript.2FActionScript.2C_etc..29