Webplanner: URL and Map Center

Alan G shared this problem 5 days ago
In Progress

The URL of webplanner includes the zoom level and lat/lng of the the map center, as confirmed recently.

There seems to be some problems with the displayed/calculated URL lat/lng, hard to see at the higher zoom levels but more obvious at lower zooms.

Here are a few ways to see it. Compare , for example, with Brouter map and OSM maps, which behave OK.

1/ When starting LM Web by providing a URL with lat/lng specified the displayed URL gets changed to different coordinates. (probably it recalculates lat/lng from the screen coordinates of the map center - but also adds another error - see below.)

Expected: The lat/lng in the displayed URL should be exactly the values entered. When you zoom in using the 'plus' button (without moving the map) these coordinates should be retained and the map positioned using them accurately at each zoom level.

Actual:-

Enter the above Eiffel Tower URL for each zoom level (or a sample of them).

The map displays with the map center apparently at the Eiffel Tower, or as zoom level decreases as close to it as you can see with lower resolutions.

However the lat/lng in the URL shown changes from that entered to different values - different, not just less precision.

Its happens for all zoom levels, except 19, but it's most obvious for the lower zoom levels, so for example on my PC (Win 11 resolution 1920x1080) I get:

zoom 8: https://web.locusmap.app/en/?lat=48.835455&lng=2.296143&z=8&map=hikeBike. This is a point about 2.5km South of the Eiffel Tower

zoom 5: https://web.locusmap.app/en/?lat=47.346124&lng=2.285156&z=5&map=hikeBike. This is a point about 168 km South of Paris.

zoom 3: https://web.locusmap.app/en/?lat=29.904590&lng=2.285156&z=3&map=hikeBike. This is about 2,100km South of Paris somewhere in the Algerian desert.

zoom 2: https://web.locusmap.app/en/?lat=9.368222&lng=2.460938&z=2&map=hikeBike. This is about 4,391km South of Paris near the city of Parakou in Benin.

2/ When zooming in (without moving the map), accuracy is lost.

Expected: The URL shown at every zoom level and the corresponding displayed map center location should be as entered.

Actual:-

After entering the Eiffel Tower URL at some zoom level then you zoom in (using the 'plus' button) the final point at zoom 19 is not at the point originally entered.

The distance in meters from the Eiffel Tower varies (for me) as follows:

startzoom:distance (at zoom 19) from entered coordinates

19:0; 18:0; 17:0.22; 16:1.12; 15:1.56; 14:3.22; 13:5.49; 12:8.22; 11:20.64; 10:37.17; 9:82.97; 8:169.31; 7:341.82; 6:688.55; 5:1235.00; 4:2585.50; 3:944.36; 2:13454.51

3/ The coordinates shown by "Share Point" do not agree with those shown in the URL.

Right click on the exact map center and choose "Share Point" (might need to employ a ruler or else display cross hairs at the map center by software, or trigger the share point dialog programmatically at the map center, etc.)

Expected: If the map was moved, then the coordinates shown should agree exactly with those in the URL. If the map was not moved they should only agree approximately.

Actual: the longitude agrees exactly with the URL whereas the latitude does not - it differs increasingly as the zoom level decreases.

What seems to be happening is that the app re-calculates the lat/lng from the screen coordinates and updates the URL to those - fine if the map has been moved but not if you have entered the coordinates and just zoomed in/out with the plus button.

Secondly the latitude has another error which gets very big as the zoom level decreases.

----------------------------

I'm guessing there are two issues:-

A/ When you enter a URL with Lat/Lng specified then to my mind that should fix the map center at that location - if you zoom in or out WITHOUT moving the map then at each zoom the app should respect the supplied coordinates to position the map center as close to that location as is possible at that resolution. If you move the map center then that invalidates the coordinates - now the app should use the screen coordinates to determine the lat/lng. As a pixel can span a set of lat/lng coordinates - ever increasing as the zoom level decreases - this inevitably introduces an uncertainty which is expected.

OSM Maps and brouter map both work as expected. If you enter the Eiffel tower coordinates at any zoom level, then zoom in you arrive exactly at the Eiffel tower.

B/ On top of that, the latitudes displayed are wrong - starting from very small error at zoom 19 but increasing to huge errors at zoom 2. It can be directly seen in the Share Point values - longitudes agree (but shouldn't if the map was not moved) but latitudes have a much bigger error. Perhaps a wrong coordinate conversion formula is being used.

The upshot of this is that the map center coordinates in the URL cannot be entirely trusted. At higher zoom levels (over about 13) the errors are fairly small, though whether this matters depends on what you are using them for. Below this they increase rapidly.

Replies (3)

photo
1

Sorry, I think I referred to the Eiffel Tower URL without specifying it:

At zoom 19: https://web.locusmap.app/en/?lat=48.858222&lng=2.294501&z=19&map=hikeBike

photo
1

Another weird thing, with probably the same root cause:-

For zoom levels of 11 or less, if you click on the browser refresh button repeatedly you see the map gradually drifts Northwards (i.e the map centre drifts South) until the map centre is just North of the equator. (continental drift ?). The lower the zoom level the faster it does it. The longitude stays the same.

Except it doesn't do it for zoom level 5 !!

photo
1

In fact for zoom level 5 after clicking on the browser refresh button, the URL coordinates lat/lng are frozen - if you move the map the URL does not update. The latitude is wrong anyway of course. If you change zoom and then back to zoom 5 then it un-freezes.

Leave a Comment
 
Attach a file