FlightMirage how map boundaries are calculated.

FlightMirage will only display aircraft positions on the maps correctly for the Northern hemisphere. Positions for the Southern hemispere need calculating differently and that has not been coded.

Map boundaries are read from each map level's Trekbuddy .map file. The latitude and longitude are used to calculate an Openstreet map tile index. The latitude and longitude boundaries for the map are recalculated from the tile index. This was causing a problem with Mobac maps because the top latitude was on a tile border and sometimes the calculation would return the y tile index for the tile above. To avoid this I have subtracted 0.01 degrees from the latitude when calculating the tile index. This puts the latitude inside the tile area instead of on the tiles top edge and the calculation will now reliably return the correct y tile index.   I do not seem to have a problem with the longitude so I have not done this for that.  If you find you have a problem you can try adjusting your longitude by adding a little to it's longitude value in the .map file for each level.

You can use the geofabrik tools web page to check latitude and longitude for tiles at each Openstreet zoom level.
 http://tools.geofabrik.de/map/#14/52.0378/-1.5062&type=Geofabrik_Standard&grid=1&mlat=52.03887&mlon=-1.53826n=-1.53826.

In Flightmirage move to the top left of your map. X and Y should both show 0. The latitude and longitude for will show the coordinates of the top left corner of the tile in the top left of your map. You can check this against the latitude and longitude shown in geofabrik tools.
If you use Windows Snipping Tool to screen grab from Flightmirage you can also check that aircraft are displayed in the correct position by checking the latitude and longitude in geofabrik tools.

Aircraft position indicator

Aircraft position indicator

 

If you are creating your own custom maps and are manually changing the latitude and longitude in the Trekbuddy map files you will only see any change on your map in Flightmirage when the changes you make are big enough to reference a different map tile. All latitude and longitude in the Trekbuddy map file get converted to tile boundaries by Flightmirage.



For the FlightMirage main web page see.
http://www.stevematt.f9.co.uk/flightmirage/index.html.

My home page

http://www.stevematt.f9.co.uk

Last updated 28 October 2020