Updating from yves86 branch
This commit is contained in:
45
PBMap.pb
45
PBMap.pb
@@ -269,7 +269,8 @@ Module PBMap
|
|||||||
Structure PBMap
|
Structure PBMap
|
||||||
Window.i ; Parent Window
|
Window.i ; Parent Window
|
||||||
Gadget.i ; Canvas Gadget Id
|
Gadget.i ; Canvas Gadget Id
|
||||||
Font.i ; Font to uses when write on the map
|
StandardFont.i ; Font to use when writing on the map
|
||||||
|
UnderlineFont.i
|
||||||
Timer.i ; Redraw/update timer
|
Timer.i ; Redraw/update timer
|
||||||
|
|
||||||
GeographicCoordinates.GeographicCoordinates ; Latitude and Longitude from focus point
|
GeographicCoordinates.GeographicCoordinates ; Latitude and Longitude from focus point
|
||||||
@@ -433,7 +434,7 @@ Module PBMap
|
|||||||
AddPathBox(0, 0, 256, 256)
|
AddPathBox(0, 0, 256, 256)
|
||||||
FillPath()
|
FillPath()
|
||||||
MovePathCursor(0, 0)
|
MovePathCursor(0, 0)
|
||||||
VectorFont(FontID(PBMap\Font), 256 / 20)
|
VectorFont(FontID(PBMap\StandardFont), 256 / 20)
|
||||||
VectorSourceColor(RGBA(150, 150, 150, 255))
|
VectorSourceColor(RGBA(150, 150, 150, 255))
|
||||||
MovePathCursor(0 + (256 - VectorTextWidth(LoadingText$)) / 2, 0 + (256 - VectorTextHeight(LoadingText$)) / 2)
|
MovePathCursor(0 + (256 - VectorTextWidth(LoadingText$)) / 2, 0 + (256 - VectorTextHeight(LoadingText$)) / 2)
|
||||||
DrawVectorText(LoadingText$)
|
DrawVectorText(LoadingText$)
|
||||||
@@ -449,7 +450,7 @@ Module PBMap
|
|||||||
AddPathBox(0, 0, 256, 256)
|
AddPathBox(0, 0, 256, 256)
|
||||||
FillPath()
|
FillPath()
|
||||||
; MovePathCursor(0, 0)
|
; MovePathCursor(0, 0)
|
||||||
; VectorFont(FontID(PBMap\Font), 256 / 20)
|
; VectorFont(FontID(PBMap\StandardFont), 256 / 20)
|
||||||
; VectorSourceColor(RGBA(150, 150, 150, 255))
|
; VectorSourceColor(RGBA(150, 150, 150, 255))
|
||||||
; MovePathCursor(0 + (256 - VectorTextWidth(NothingText$)) / 2, 0 + (256 - VectorTextHeight(NothingText$)) / 2)
|
; MovePathCursor(0 + (256 - VectorTextWidth(NothingText$)) / 2, 0 + (256 - VectorTextHeight(NothingText$)) / 2)
|
||||||
; DrawVectorText(NothingText$)
|
; DrawVectorText(NothingText$)
|
||||||
@@ -1422,7 +1423,7 @@ Module PBMap
|
|||||||
; EndIf
|
; EndIf
|
||||||
EndIf
|
EndIf
|
||||||
If PBMap\Options\ShowDebugInfos
|
If PBMap\Options\ShowDebugInfos
|
||||||
VectorFont(FontID(PBMap\Font), 16)
|
VectorFont(FontID(PBMap\StandardFont), 16)
|
||||||
VectorSourceColor(RGBA(0, 0, 0, 80))
|
VectorSourceColor(RGBA(0, 0, 0, 80))
|
||||||
MovePathCursor(px, py)
|
MovePathCursor(px, py)
|
||||||
DrawVectorText("x:" + Str(tilex))
|
DrawVectorText("x:" + Str(tilex))
|
||||||
@@ -1460,7 +1461,7 @@ Module PBMap
|
|||||||
Case #SCALE_KM;
|
Case #SCALE_KM;
|
||||||
sunit = " Km"
|
sunit = " Km"
|
||||||
EndSelect
|
EndSelect
|
||||||
VectorFont(FontID(PBMap\Font), 10)
|
VectorFont(FontID(PBMap\StandardFont), 10)
|
||||||
VectorSourceColor(RGBA(0, 0, 0, alpha))
|
VectorSourceColor(RGBA(0, 0, 0, alpha))
|
||||||
MovePathCursor(x,y)
|
MovePathCursor(x,y)
|
||||||
DrawVectorText(StrD(Scale,3)+sunit)
|
DrawVectorText(StrD(Scale,3)+sunit)
|
||||||
@@ -1486,7 +1487,7 @@ Module PBMap
|
|||||||
; Debug "NW : " + StrD(Degrees1\Longitude) + " ; NE : " + StrD(Degrees2\Longitude)
|
; Debug "NW : " + StrD(Degrees1\Longitude) + " ; NE : " + StrD(Degrees2\Longitude)
|
||||||
LatLon2PixelRel(@Degrees1, @pos1, PBMap\Zoom)
|
LatLon2PixelRel(@Degrees1, @pos1, PBMap\Zoom)
|
||||||
LatLon2PixelRel(@Degrees2, @pos2, PBMap\Zoom)
|
LatLon2PixelRel(@Degrees2, @pos2, PBMap\Zoom)
|
||||||
VectorFont(FontID(PBMap\Font), 10)
|
VectorFont(FontID(PBMap\StandardFont), 10)
|
||||||
VectorSourceColor(RGBA(0, 0, 0, alpha))
|
VectorSourceColor(RGBA(0, 0, 0, alpha))
|
||||||
; draw latitudes
|
; draw latitudes
|
||||||
For y = ny1 To ny
|
For y = ny1 To ny
|
||||||
@@ -1514,7 +1515,7 @@ Module PBMap
|
|||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure DrawZoom(x.i, y.i)
|
Procedure DrawZoom(x.i, y.i)
|
||||||
VectorFont(FontID(PBMap\Font), 20)
|
VectorFont(FontID(PBMap\StandardFont), 20)
|
||||||
VectorSourceColor(RGBA(0, 0, 0,150))
|
VectorSourceColor(RGBA(0, 0, 0,150))
|
||||||
MovePathCursor(x,y)
|
MovePathCursor(x,y)
|
||||||
DrawVectorText(Str(GetZoom()))
|
DrawVectorText(Str(GetZoom()))
|
||||||
@@ -1534,7 +1535,7 @@ Module PBMap
|
|||||||
VectorSourceColor(RGBA(255, 255, 255, 255))
|
VectorSourceColor(RGBA(255, 255, 255, 255))
|
||||||
AddPathCircle(x,y-20,12)
|
AddPathCircle(x,y-20,12)
|
||||||
FillPath()
|
FillPath()
|
||||||
VectorFont(FontID(PBMap\Font), 13)
|
VectorFont(FontID(PBMap\StandardFont), 13)
|
||||||
MovePathCursor(x-VectorTextWidth(Str(dist))/2, y-20-VectorTextHeight(Str(dist))/2)
|
MovePathCursor(x-VectorTextWidth(Str(dist))/2, y-20-VectorTextHeight(Str(dist))/2)
|
||||||
VectorSourceColor(RGBA(0, 0, 0, 255))
|
VectorSourceColor(RGBA(0, 0, 0, 255))
|
||||||
DrawVectorText(Str(dist))
|
DrawVectorText(Str(dist))
|
||||||
@@ -1553,7 +1554,7 @@ Module PBMap
|
|||||||
VectorSourceColor(RGBA(255, 0, 0, 255))
|
VectorSourceColor(RGBA(255, 0, 0, 255))
|
||||||
AddPathCircle(x,y-24,14)
|
AddPathCircle(x,y-24,14)
|
||||||
FillPath()
|
FillPath()
|
||||||
VectorFont(FontID(PBMap\Font), 14)
|
VectorFont(FontID(PBMap\StandardFont), 14)
|
||||||
MovePathCursor(x-VectorTextWidth(Str(dist))/2, y-24-VectorTextHeight(Str(dist))/2)
|
MovePathCursor(x-VectorTextWidth(Str(dist))/2, y-24-VectorTextHeight(Str(dist))/2)
|
||||||
VectorSourceColor(RGBA(0, 0, 0, 255))
|
VectorSourceColor(RGBA(0, 0, 0, 255))
|
||||||
DrawVectorText(Str(dist))
|
DrawVectorText(Str(dist))
|
||||||
@@ -1841,13 +1842,13 @@ Module PBMap
|
|||||||
Else
|
Else
|
||||||
Text.s = *Marker\Identifier
|
Text.s = *Marker\Identifier
|
||||||
EndIf
|
EndIf
|
||||||
VectorFont(FontID(PBMap\Font), 13)
|
VectorFont(FontID(PBMap\StandardFont), 13)
|
||||||
MovePathCursor(x - VectorTextWidth(Text) / 2, y)
|
MovePathCursor(x - VectorTextWidth(Text) / 2, y)
|
||||||
VectorSourceColor(RGBA(0, 0, 0, 255))
|
VectorSourceColor(RGBA(0, 0, 0, 255))
|
||||||
DrawVectorText(Text)
|
DrawVectorText(Text)
|
||||||
EndIf
|
EndIf
|
||||||
If PBMap\Options\ShowMarkersLegend And *Marker\Legend <> ""
|
If PBMap\Options\ShowMarkersLegend And *Marker\Legend <> ""
|
||||||
VectorFont(FontID(PBMap\Font), 13)
|
VectorFont(FontID(PBMap\StandardFont), 13)
|
||||||
; dessin d'un cadre avec fond transparent
|
; dessin d'un cadre avec fond transparent
|
||||||
Protected Height = VectorParagraphHeight(*Marker\Legend, 100, 100)
|
Protected Height = VectorParagraphHeight(*Marker\Legend, 100, 100)
|
||||||
Protected Width.l
|
Protected Width.l
|
||||||
@@ -1887,7 +1888,7 @@ Module PBMap
|
|||||||
|
|
||||||
Procedure DrawDebugInfos(*Drawing.DrawingParameters)
|
Procedure DrawDebugInfos(*Drawing.DrawingParameters)
|
||||||
; Display how many images in cache
|
; Display how many images in cache
|
||||||
VectorFont(FontID(PBMap\Font), 16)
|
VectorFont(FontID(PBMap\StandardFont), 16)
|
||||||
VectorSourceColor(RGBA(0, 0, 0, 80))
|
VectorSourceColor(RGBA(0, 0, 0, 80))
|
||||||
MovePathCursor(50, 50)
|
MovePathCursor(50, 50)
|
||||||
DrawVectorText("Images in cache : " + Str(MapSize(PBMap\MemCache\Images())))
|
DrawVectorText("Images in cache : " + Str(MapSize(PBMap\MemCache\Images())))
|
||||||
@@ -1911,7 +1912,7 @@ Module PBMap
|
|||||||
|
|
||||||
Procedure DrawOSMCopyright(*Drawing.DrawingParameters)
|
Procedure DrawOSMCopyright(*Drawing.DrawingParameters)
|
||||||
Protected Text.s = "<22> OpenStreetMap contributors"
|
Protected Text.s = "<22> OpenStreetMap contributors"
|
||||||
VectorFont(FontID(PBMap\Font), 12)
|
VectorFont(FontID(PBMap\StandardFont), 12)
|
||||||
VectorSourceColor(RGBA(0, 0, 0, 80))
|
VectorSourceColor(RGBA(0, 0, 0, 80))
|
||||||
MovePathCursor(GadgetWidth(PBMAP\Gadget) - VectorTextWidth(Text), GadgetHeight(PBMAP\Gadget) - 20)
|
MovePathCursor(GadgetWidth(PBMAP\Gadget) - VectorTextWidth(Text), GadgetHeight(PBMAP\Gadget) - 20)
|
||||||
DrawVectorText(Text)
|
DrawVectorText(Text)
|
||||||
@@ -1923,6 +1924,7 @@ Module PBMap
|
|||||||
Protected Px.d, Py.d,a, ts = PBMap\TileSize, nx, ny
|
Protected Px.d, Py.d,a, ts = PBMap\TileSize, nx, ny
|
||||||
Protected LayerOrder.i = 0
|
Protected LayerOrder.i = 0
|
||||||
Protected NW.Coordinates, SE.Coordinates
|
Protected NW.Coordinates, SE.Coordinates
|
||||||
|
Protected OSMCopyright.i = #False
|
||||||
PBMap\Dirty = #False
|
PBMap\Dirty = #False
|
||||||
PBMap\Redraw = #False
|
PBMap\Redraw = #False
|
||||||
; *** Precalc some values
|
; *** Precalc some values
|
||||||
@@ -1961,6 +1963,9 @@ Module PBMap
|
|||||||
If PBMap\LayersList()\Enabled
|
If PBMap\LayersList()\Enabled
|
||||||
DrawTiles(*Drawing, PBMap\LayersList()\Name)
|
DrawTiles(*Drawing, PBMap\LayersList()\Name)
|
||||||
EndIf
|
EndIf
|
||||||
|
If PBMap\LayersList()\LayerType = 0 ; OSM
|
||||||
|
OSMCopyright = #True
|
||||||
|
EndIf
|
||||||
Next
|
Next
|
||||||
If PBMap\Options\ShowTrack
|
If PBMap\Options\ShowTrack
|
||||||
DrawTracks(*Drawing)
|
DrawTracks(*Drawing)
|
||||||
@@ -1983,7 +1988,9 @@ Module PBMap
|
|||||||
If PBMap\Options\ShowZoom
|
If PBMap\Options\ShowZoom
|
||||||
DrawZoom(GadgetWidth(PBMap\Gadget) - 30, 5) ; ajout YA - affiche le niveau de zoom
|
DrawZoom(GadgetWidth(PBMap\Gadget) - 30, 5) ; ajout YA - affiche le niveau de zoom
|
||||||
EndIf
|
EndIf
|
||||||
DrawOSMCopyright(*Drawing)
|
If OSMCopyright
|
||||||
|
DrawOSMCopyright(*Drawing)
|
||||||
|
EndIf
|
||||||
StopVectorDrawing()
|
StopVectorDrawing()
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
@@ -2423,9 +2430,9 @@ Module PBMap
|
|||||||
CallFunctionFast(PBMap\CallBackLeftClic, @Location)
|
CallFunctionFast(PBMap\CallBackLeftClic, @Location)
|
||||||
EndIf
|
EndIf
|
||||||
; ajout YA // change la forme du pointeur de souris pour les d<>placements de la carte
|
; ajout YA // change la forme du pointeur de souris pour les d<>placements de la carte
|
||||||
SetGadgetAttribute(PBMap\Gadget,#PB_Canvas_Cursor,#PB_Cursor_Hand)
|
SetGadgetAttribute(PBMap\Gadget, #PB_Canvas_Cursor, #PB_Cursor_Hand)
|
||||||
Else
|
Else
|
||||||
SetGadgetAttribute(PBMap\Gadget,#PB_Canvas_Cursor,#PB_Cursor_Default) ; ajout YA pour remettre le pointeur souris en normal
|
SetGadgetAttribute(PBMap\Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) ; ajout YA pour remettre le pointeur souris en normal
|
||||||
EndIf
|
EndIf
|
||||||
Case #PB_EventType_MouseMove
|
Case #PB_EventType_MouseMove
|
||||||
; Drag
|
; Drag
|
||||||
@@ -2614,7 +2621,8 @@ Module PBMap
|
|||||||
\TileSize = 256
|
\TileSize = 256
|
||||||
\Dirty = #False
|
\Dirty = #False
|
||||||
\EditMarker = #False
|
\EditMarker = #False
|
||||||
\Font = LoadFont(#PB_Any, "Arial", 20, #PB_Font_Bold)
|
\StandardFont = LoadFont(#PB_Any, "Arial", 20, #PB_Font_Bold)
|
||||||
|
\UnderlineFont = LoadFont(#PB_Any, "Arial", 20, #PB_Font_Underline)
|
||||||
\Window = Window
|
\Window = Window
|
||||||
\Timer = 1
|
\Timer = 1
|
||||||
\Mode = #MODE_DEFAULT
|
\Mode = #MODE_DEFAULT
|
||||||
@@ -2940,7 +2948,8 @@ CompilerIf #PB_Compiler_IsMainFile
|
|||||||
CompilerEndIf
|
CompilerEndIf
|
||||||
|
|
||||||
; IDE Options = PureBasic 5.60 (Windows - x64)
|
; IDE Options = PureBasic 5.60 (Windows - x64)
|
||||||
; CursorPosition = 16
|
; CursorPosition = 2456
|
||||||
|
; FirstLine = 2435
|
||||||
; Folding = --------------------
|
; Folding = --------------------
|
||||||
; EnableThread
|
; EnableThread
|
||||||
; EnableXP
|
; EnableXP
|
||||||
|
Reference in New Issue
Block a user