Track bugfix

This commit is contained in:
djes
2016-07-25 23:01:22 +02:00
parent 3cd42fbee6
commit 8c2f59801b

13
osm.pb
View File

@@ -309,8 +309,8 @@ Module OSM
Protected mapHeight.l = Pow(2,OSM\Zoom+8)
Protected x1.l,y1.l
;Protected deltaX = OSM\Position\x - Int(OSM\Drawing\x) * OSM\TileSize ;Get the position into the tile
;Protected deltaY = OSM\Position\y - Int(OSM\Drawing\y) * OSM\TileSize
Protected deltaX = OSM\Position\x - Int(OSM\Drawing\x) * OSM\TileSize ;Get the position into the tile
Protected deltaY = OSM\Position\y - Int(OSM\Drawing\y) * OSM\TileSize
; get x value
x1 = (*Location\Longitude+180)*(mapWidth/360)
@@ -329,8 +329,8 @@ Module OSM
mercN = Log(Tan((#PI/4)+(latRad/2))) ;
y2 = (mapHeight/2)-(mapWidth*mercN/(2*#PI));
*Pixel\x=GadgetWidth(OSM\Gadget)/2 - (x2-x1); + deltaX
*Pixel\y=GadgetHeight(OSM\Gadget)/2 - (y2-y1);+ deltaY
*Pixel\x=GadgetWidth(OSM\Gadget)/2 - (x2-x1) - deltaX
*Pixel\y=GadgetHeight(OSM\Gadget)/2 - (y2-y1) - deltaY
EndProcedure
Procedure LoadGpxFile(file.s)
@@ -826,6 +826,7 @@ CompilerIf #PB_Compiler_IsMainFile
SetGadgetText(#String_1, StrD(*Location\Longitude))
ProcedureReturn 0
EndProcedure
;- Main
If OpenWindow(#Window_0, 260, 225, 700, 571, "OpenStreetMap", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
@@ -876,8 +877,8 @@ CompilerIf #PB_Compiler_IsMainFile
CompilerEndIf
; IDE Options = PureBasic 5.42 LTS (Windows - x64)
; CursorPosition = 331
; FirstLine = 328
; CursorPosition = 332
; FirstLine = 531
; Folding = -----
; EnableUnicode
; EnableThread