openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

Location picker, and maps in general handle lat/long outiside of a single planet.

Open LovesTha opened this issue 9 months ago • 1 comments

Expected Behavior

Location data should be constrained to +-90 degrees for lat, and +-180 degrees for long (or [0-360) for long)

Current Behavior

Zooming into the wrong alias of Australia can give you locations with positive or negative longitude values. Then when those locations are put onto a map view it will be zoomed out enough to show two Australias, one with the positive long values and one with the negative long values

Possible Solution

Location picker should alias positions onto a single copy of the globes coordinates once the location is picked.

Care may be needed to ensure that a bunch of locations picked each side of the 0 degree line doesn't cause the default map view to be the whole globe. But that unusual corner case may not be worth the time handling well.

Steps to Reproduce (for Bugs)

  1. Create a map page
  2. Add some location markers
  3. Use the map location selector for the location markers location
  4. Zoom out till you see three Australias, zoom into one to pick a location
  5. Repeat for a few location markers but zoom in on different Australias each time
  6. Save the map page
  7. Load the map page, see that the default zoom shows you multiple Australias
  8. Zooming into an australia will only show you the markers on that Australia

This bug wasted a lot of time on me trying to fix the default zoom level, when it was that I had markers in different Melbournes.

Your Environment

OpenHAB 4.3.2

LovesTha avatar Feb 16 '25 03:02 LovesTha

Any comment?

LovesTha avatar Mar 28 '25 06:03 LovesTha