fpw / avitab

X-Plane plugin that displays a tablet to aid VR usage
GNU Affero General Public License v3.0
299 stars 58 forks source link

Support wrapping of map tiles at -180/180 longitude. #184

Closed mjh65 closed 9 months ago

mjh65 commented 9 months ago

This enhancement shows the map and NAV overlays on both sides of the line when in the vicinity of the -180/180 meridian.

A transform functions has been added to the tile source API. This adjusts tile coordinates to constrain them in the tile sources allowable range. The tile cache asks the tile source to constrain the x,y indices before handling, so that only legitimate tile indices are loaded.

This allows the slippy map and stitcher's tile coordinates to be extended beyond the edges to support wrapping the map at the -180/180 edges. During panning the stitcher's center coordinates may be adjusted to keep them in range.

The overlayed map has been adapted to visit NAV nodes either side of the -180/180 meridian when the base map crosses the line and posiiton them correctly on the base map image. (The corners of the visited area have also been redefined to use a more logical pairing of (minX,minY) and (maxX,maxY), this is largely cosmetic).

The new feature is currently only enabled when the map is using online slippy tile sources. All other map sources will behave as previously.

An alternative start location and flight path fir the user plane is added to the standalone build. A small source edit will be required to select this if required for testing.