This commit is contained in:
djes
2016-07-28 20:59:25 +02:00
parent a961f01378
commit 3cca540852

15
osm.pb
View File

@@ -237,11 +237,11 @@ Module OSM
OSM\Drawing\Mutex = CreateMutex() OSM\Drawing\Mutex = CreateMutex()
OSM\Drawing\Semaphore = CreateSemaphore() OSM\Drawing\Semaphore = CreateSemaphore()
;-*** PROXY ;- Proxy details
Global Proxy = #False Global Proxy = #False
;- => Use this to customize your preferences ;Use this to customize your preferences
; Result = CreatePreferences(GetHomeDirectory() + "OSM.prefs") ; Result = CreatePreferences(GetHomeDirectory() + "OSM.prefs")
; If Proxy ; If Proxy
; PreferenceGroup("PROXY") ; PreferenceGroup("PROXY")
@@ -254,6 +254,7 @@ Module OSM
; EndIf ; EndIf
Result = OpenPreferences(GetHomeDirectory() + "OSM.prefs") Result = OpenPreferences(GetHomeDirectory() + "OSM.prefs")
If Proxy If Proxy
PreferenceGroup("PROXY") PreferenceGroup("PROXY")
Global ProxyURL$ = ReadPreferenceString("ProxyURL", "") ;InputRequester("ProxyServer", "Do you use a Proxy Server? Then enter the full url:", "") Global ProxyURL$ = ReadPreferenceString("ProxyURL", "") ;InputRequester("ProxyServer", "Do you use a Proxy Server? Then enter the full url:", "")
@@ -266,10 +267,11 @@ Module OSM
EndIf EndIf
curl_global_init(#CURL_GLOBAL_ALL); curl_global_init(#CURL_GLOBAL_ALL);
;- Main drawing thread launching
CreateThread(@DrawingThread(), @OSM\Drawing) CreateThread(@DrawingThread(), @OSM\Drawing)
EndProcedure EndProcedure
;- ***
Procedure MapGadget(Gadget.i, X.i, Y.i, Width.i, Height.i) Procedure MapGadget(Gadget.i, X.i, Y.i, Width.i, Height.i)
If Gadget = #PB_Any If Gadget = #PB_Any
@@ -402,7 +404,6 @@ Module OSM
Protected nImage.i = -1 Protected nImage.i = -1
Protected TileURL.s = OSM\ServerURL + Str(Zoom) + "/" + Str(XTile) + "/" + Str(YTile) + ".png" Protected TileURL.s = OSM\ServerURL + Str(Zoom) + "/" + Str(XTile) + "/" + Str(YTile) + ".png"
; Test if in cache else download it
Protected CacheFile.s = "OSM_" + Str(Zoom) + "_" + Str(XTile) + "_" + Str(YTile) + ".png" Protected CacheFile.s = "OSM_" + Str(Zoom) + "_" + Str(XTile) + "_" + Str(YTile) + ".png"
Debug "Check if we have this image on Web" Debug "Check if we have this image on Web"
@@ -474,7 +475,7 @@ Module OSM
DrawVectorText(Str(x) + ", " + Str(y)) DrawVectorText(Str(x) + ", " + Str(y))
Else Else
Debug "Image missing" Debug "Image missing"
OSM\Drawing\Dirty = #True ;Signal that this image is missing so we should have to redraw OSM\Drawing\Dirty = #True ;Signals that this image is missing so we should have to redraw
EndIf EndIf
EndProcedure EndProcedure
@@ -953,8 +954,8 @@ CompilerIf #PB_Compiler_IsMainFile
CompilerEndIf CompilerEndIf
; IDE Options = PureBasic 5.42 LTS (Windows - x64) ; IDE Options = PureBasic 5.42 LTS (Windows - x64)
; CursorPosition = 242 ; CursorPosition = 723
; FirstLine = 222 ; FirstLine = 671
; Folding = ------ ; Folding = ------
; EnableUnicode ; EnableUnicode
; EnableThread ; EnableThread