Merging typhoon and djes branches
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
PureBasic_Compilation0.exe
|
108
PBMap.pb
108
PBMap.pb
@@ -3,7 +3,7 @@
|
|||||||
; Description: Permits the use of tiled maps like
|
; Description: Permits the use of tiled maps like
|
||||||
; OpenStreetMap in a handy PureBASIC module
|
; OpenStreetMap in a handy PureBASIC module
|
||||||
; Author: Thyphoon, djes, Idle, yves86
|
; Author: Thyphoon, djes, Idle, yves86
|
||||||
; Date: June, 2017
|
; Date: July, 2017
|
||||||
; License: PBMap : Free, unrestricted, credit
|
; License: PBMap : Free, unrestricted, credit
|
||||||
; appreciated but not required.
|
; appreciated but not required.
|
||||||
; OSM : see http://www.openstreetmap.org/copyright
|
; OSM : see http://www.openstreetmap.org/copyright
|
||||||
@@ -46,12 +46,13 @@ DeclareModule PBMap
|
|||||||
#PB_MAP_RETRY = #PB_EventType_FirstCustomValue + 2
|
#PB_MAP_RETRY = #PB_EventType_FirstCustomValue + 2
|
||||||
#PB_MAP_TILE_CLEANUP = #PB_EventType_FirstCustomValue + 3
|
#PB_MAP_TILE_CLEANUP = #PB_EventType_FirstCustomValue + 3
|
||||||
|
|
||||||
Structure GeographicCoordinates
|
;-*** Public structures
|
||||||
|
Structure GeographicCoordinates
|
||||||
Longitude.d
|
Longitude.d
|
||||||
Latitude.d
|
Latitude.d
|
||||||
EndStructure
|
EndStructure
|
||||||
|
|
||||||
Structure Marker
|
Structure Marker
|
||||||
GeographicCoordinates.GeographicCoordinates ; Marker latitude and longitude
|
GeographicCoordinates.GeographicCoordinates ; Marker latitude and longitude
|
||||||
Identifier.s
|
Identifier.s
|
||||||
Legend.s
|
Legend.s
|
||||||
@@ -61,7 +62,7 @@ DeclareModule PBMap
|
|||||||
CallBackPointer.i ; @Procedure(X.i, Y.i) to DrawPointer (you must use VectorDrawing lib)
|
CallBackPointer.i ; @Procedure(X.i, Y.i) to DrawPointer (you must use VectorDrawing lib)
|
||||||
EditWindow.i
|
EditWindow.i
|
||||||
EndStructure
|
EndStructure
|
||||||
|
;***
|
||||||
|
|
||||||
Declare InitPBMap(window)
|
Declare InitPBMap(window)
|
||||||
Declare SetDebugLevel(level.i)
|
Declare SetDebugLevel(level.i)
|
||||||
@@ -122,9 +123,7 @@ Module PBMap
|
|||||||
|
|
||||||
EnableExplicit
|
EnableExplicit
|
||||||
|
|
||||||
;-*** Structures
|
;-*** Internal Structures
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Structure PixelCoordinates
|
Structure PixelCoordinates
|
||||||
x.d
|
x.d
|
||||||
@@ -187,9 +186,7 @@ Module PBMap
|
|||||||
List ImagesTimeStack.ImgMemCachKey() ; Usage of the tile (first = older)
|
List ImagesTimeStack.ImgMemCachKey() ; Usage of the tile (first = older)
|
||||||
EndStructure
|
EndStructure
|
||||||
|
|
||||||
|
;-Options Structure
|
||||||
|
|
||||||
;-Options
|
|
||||||
Structure Option
|
Structure Option
|
||||||
HDDCachePath.s ; Path where to load and save tiles downloaded from server
|
HDDCachePath.s ; Path where to load and save tiles downloaded from server
|
||||||
DefaultOSMServer.s ; Base layer OSM server
|
DefaultOSMServer.s ; Base layer OSM server
|
||||||
@@ -270,11 +267,12 @@ Module PBMap
|
|||||||
StrokeWidth.i
|
StrokeWidth.i
|
||||||
EndStructure
|
EndStructure
|
||||||
|
|
||||||
;- PBMap
|
;- PBMap Structure
|
||||||
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
|
||||||
@@ -320,7 +318,7 @@ Module PBMap
|
|||||||
|
|
||||||
EndStructure
|
EndStructure
|
||||||
|
|
||||||
;-*** Global variables
|
;-*** Module's global variables
|
||||||
|
|
||||||
;-Show debug infos
|
;-Show debug infos
|
||||||
Global MyDebugLevel = 5
|
Global MyDebugLevel = 5
|
||||||
@@ -337,7 +335,7 @@ Module PBMap
|
|||||||
|
|
||||||
;- *** GetText - Translation purpose
|
;- *** GetText - Translation purpose
|
||||||
|
|
||||||
; TODO use this for all text
|
; TODO use this
|
||||||
IncludeFile "gettext.pbi"
|
IncludeFile "gettext.pbi"
|
||||||
|
|
||||||
;-*** Misc tools
|
;-*** Misc tools
|
||||||
@@ -438,7 +436,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$)
|
||||||
@@ -454,7 +452,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$)
|
||||||
@@ -829,7 +827,7 @@ Module PBMap
|
|||||||
EndSelect
|
EndSelect
|
||||||
EndWith
|
EndWith
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
; By default, save options in the user's home directory
|
; By default, save options in the user's home directory
|
||||||
Procedure SaveOptions(PreferencesFile.s = "PBMap.prefs")
|
Procedure SaveOptions(PreferencesFile.s = "PBMap.prefs")
|
||||||
If PreferencesFile = "PBMap.prefs"
|
If PreferencesFile = "PBMap.prefs"
|
||||||
@@ -950,7 +948,6 @@ Module PBMap
|
|||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
;-*** Layers
|
;-*** Layers
|
||||||
|
|
||||||
; Add a layer to a list (to get things ordered) and to a map (to access things easily)
|
; Add a layer to a list (to get things ordered) and to a map (to access things easily)
|
||||||
Procedure.i AddLayer(Name.s, Order.i, Alpha.d)
|
Procedure.i AddLayer(Name.s, Order.i, Alpha.d)
|
||||||
Protected *Ptr = 0
|
Protected *Ptr = 0
|
||||||
@@ -1260,15 +1257,18 @@ Module PBMap
|
|||||||
MyDebug("Key : " + key + " added in memory cache", 4)
|
MyDebug("Key : " + key + " added in memory cache", 4)
|
||||||
EndIf
|
EndIf
|
||||||
; If there's no active download thread for this tile
|
; If there's no active download thread for this tile
|
||||||
If *timg\Tile <= 0
|
If *timg\Tile <= 0
|
||||||
; Manage tile file lifetime, delete if too old
|
*timg\nImage = 0
|
||||||
|
*timg\Size = FileSize(CacheFile)
|
||||||
|
; Manage tile file lifetime, delete if too old, or if size = 0
|
||||||
If PBMap\Options\TileLifetime <> -1
|
If PBMap\Options\TileLifetime <> -1
|
||||||
If FileSize(CacheFile) > 0 ; Does the file exists ?
|
If *timg\Size >= 0 ; Does the file exists ?
|
||||||
If Date() - GetFileDate(CacheFile, #PB_Date_Modified) > PBMap\Options\TileLifetime ; If Lifetime > MaxLifeTime ; There's a bug with #PB_Date_Created
|
If *timg\Size = 0 Or (Date() - GetFileDate(CacheFile, #PB_Date_Modified) > PBMap\Options\TileLifetime) ; If Lifetime > MaxLifeTime ; There's a bug with #PB_Date_Created
|
||||||
If DeleteFile(CacheFile)
|
If DeleteFile(CacheFile)
|
||||||
MyDebug(" Deleting too old image file " + CacheFile, 3)
|
MyDebug(" Deleting image file " + CacheFile, 3)
|
||||||
|
*timg\Size = 0
|
||||||
Else
|
Else
|
||||||
MyDebug(" Can't delete too old image file " + CacheFile, 3)
|
MyDebug(" Can't delete image file " + CacheFile, 3)
|
||||||
UnlockMutex(PBMap\MemoryCacheAccessMutex)
|
UnlockMutex(PBMap\MemoryCacheAccessMutex)
|
||||||
ProcedureReturn #False
|
ProcedureReturn #False
|
||||||
EndIf
|
EndIf
|
||||||
@@ -1276,8 +1276,6 @@ Module PBMap
|
|||||||
EndIf
|
EndIf
|
||||||
EndIf
|
EndIf
|
||||||
; Try To load it from HD
|
; Try To load it from HD
|
||||||
*timg\nImage = 0
|
|
||||||
*timg\Size = FileSize(CacheFile)
|
|
||||||
If *timg\Size > 0
|
If *timg\Size > 0
|
||||||
*timg\nImage = GetTileFromHDD(CacheFile.s)
|
*timg\nImage = GetTileFromHDD(CacheFile.s)
|
||||||
Else
|
Else
|
||||||
@@ -1427,7 +1425,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))
|
||||||
@@ -1465,7 +1463,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)
|
||||||
@@ -1491,7 +1489,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
|
||||||
@@ -1519,7 +1517,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()))
|
||||||
@@ -1539,7 +1537,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))
|
||||||
@@ -1558,7 +1556,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))
|
||||||
@@ -1846,13 +1844,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
|
||||||
@@ -1892,7 +1890,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())))
|
||||||
@@ -1915,8 +1913,8 @@ Module PBMap
|
|||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure DrawOSMCopyright(*Drawing.DrawingParameters)
|
Procedure DrawOSMCopyright(*Drawing.DrawingParameters)
|
||||||
Protected Text.s = "© OpenStreetMap contributors"
|
Protected Text.s = "<EFBFBD> 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)
|
||||||
@@ -1928,6 +1926,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
|
||||||
@@ -1966,6 +1965,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)
|
||||||
@@ -1988,7 +1990,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
|
||||||
|
|
||||||
@@ -2420,17 +2424,17 @@ Module PBMap
|
|||||||
EndIf
|
EndIf
|
||||||
Next
|
Next
|
||||||
EndIf
|
EndIf
|
||||||
; YA pour sélectionner un point de la trace avec le clic gauche
|
; YA pour s<EFBFBD>lectionner un point de la trace avec le clic gauche
|
||||||
If PBMap\EditMarker = #False
|
If PBMap\EditMarker = #False
|
||||||
Location\Latitude = GetMouseLatitude()
|
Location\Latitude = GetMouseLatitude()
|
||||||
Location\Longitude = GetMouseLongitude()
|
Location\Longitude = GetMouseLongitude()
|
||||||
If PBMap\CallBackLeftClic > 0
|
If PBMap\CallBackLeftClic > 0
|
||||||
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<EFBFBD>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
|
||||||
@@ -2485,7 +2489,7 @@ Module PBMap
|
|||||||
EndIf
|
EndIf
|
||||||
Next
|
Next
|
||||||
; Check if mouse touch tracks
|
; Check if mouse touch tracks
|
||||||
If PBMap\Options\ShowTrackSelection ; YA ajout pour éviter la sélection de la trace
|
If PBMap\Options\ShowTrackSelection ; YA ajout pour <EFBFBD>viter la s<EFBFBD>lection de la trace
|
||||||
With PBMap\TracksList()
|
With PBMap\TracksList()
|
||||||
; Trace Track
|
; Trace Track
|
||||||
If ListSize(PBMap\TracksList()) > 0
|
If ListSize(PBMap\TracksList()) > 0
|
||||||
@@ -2523,11 +2527,10 @@ Module PBMap
|
|||||||
; PBMap\MoveStartingPoint\x = - 1
|
; PBMap\MoveStartingPoint\x = - 1
|
||||||
PBMap\Dragging = #False
|
PBMap\Dragging = #False
|
||||||
PBMap\Redraw = #True
|
PBMap\Redraw = #True
|
||||||
;YA pour connaitre les coordonnées d'un marqueur après déplacement
|
;YA pour connaitre les coordonn<EFBFBD>es d'un marqueur apr<EFBFBD>s d<EFBFBD>placement
|
||||||
ForEach PBMap\Markers()
|
ForEach PBMap\Markers()
|
||||||
If PBMap\Markers()\Selected = #True
|
If PBMap\Markers()\Selected = #True
|
||||||
If PBMap\CallBackMarker > 0
|
If PBMap\CallBackMarker > 0
|
||||||
;CallFunctionFast(PBMap\CallBackMarker, @PBMap\Markers()\GeographicCoordinates)
|
|
||||||
CallFunctionFast(PBMap\CallBackMarker, @PBMap\Markers());
|
CallFunctionFast(PBMap\CallBackMarker, @PBMap\Markers());
|
||||||
EndIf
|
EndIf
|
||||||
EndIf
|
EndIf
|
||||||
@@ -2620,7 +2623,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
|
||||||
@@ -2717,7 +2721,7 @@ CompilerIf #PB_Compiler_IsMainFile
|
|||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure MarkerMoveCallBack(*Marker.PBMap::Marker)
|
Procedure MarkerMoveCallBack(*Marker.PBMap::Marker)
|
||||||
Debug "Identifier:"+*Marker\Identifier+"("+StrD(*Marker\GeographicCoordinates\Latitude)+","+StrD(*Marker\GeographicCoordinates\Longitude)+")"
|
Debug "Identifier : " + *Marker\Identifier + "(" + StrD(*Marker\GeographicCoordinates\Latitude) + ", " + StrD(*Marker\GeographicCoordinates\Longitude) + ")"
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure MainPointer(x.i, y.i)
|
Procedure MainPointer(x.i, y.i)
|
||||||
@@ -2950,11 +2954,11 @@ CompilerIf #PB_Compiler_IsMainFile
|
|||||||
|
|
||||||
CompilerEndIf
|
CompilerEndIf
|
||||||
|
|
||||||
; IDE Options = PureBasic 5.60 (Windows - x86)
|
|
||||||
; CursorPosition = 2821
|
; IDE Options = PureBasic 5.60 (Windows - x64)
|
||||||
; FirstLine = 2780
|
; CursorPosition = 2726
|
||||||
|
; FirstLine = 2720
|
||||||
; Folding = --------------------
|
; Folding = --------------------
|
||||||
; EnableThread
|
; EnableThread
|
||||||
; EnableXP
|
; EnableXP
|
||||||
; CompileSourceDirectory
|
; CompileSourceDirectory
|
||||||
; DisablePurifier = 1,1,1,1
|
|
Reference in New Issue
Block a user