Page 2 of 10
Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Mon Sep 05, 2016 8:23 am
by djes
BasicallyPure wrote:Hi Djes,
Fails syntax check because a shared variable (ReceiveData.s) required in the include file has not been defined in main code.
This patch fixes the problem.
Apparently the variable is not actually used in your code.
Code: Select all
Define ReceivedData.s ;<-- added ReceiveData.s,-- BasicallyPure
IncludeFile "libcurl.pbi" ; https://github.com/deseven/pbsamples/tree/master/crossplatform/libcurl
In fact, the distributed libcurl include has been fixed for that. Anyway, you're right, if I share the original URL, I should include the definition

Please note that the pbmap code includes a curl "downloadtofile" that is not present in the curl pbi. I will post it somewhere in the forum...
edit: here it is :
http://www.purebasic.fr/english/viewtop ... 12&t=66527
Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Fri Sep 09, 2016 3:17 pm
by djes
The code have been updated on the Github deposit (master)
Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Tue Sep 13, 2016 9:38 pm
by minimy
Thanks for share!
This open a world of new features.
Very good work Djes!!
Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Tue Sep 13, 2016 10:18 pm
by djes
minimy wrote:Thanks for share!
This open a world of new features.
Very good work Djes!!
Thank you ! I'm not alone, actually we're 3 on the project, initiated by Typhoon, and now with Idle. Users are very important, don't hesitate to ask and comment !

Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Thu Sep 15, 2016 12:30 am
by netmaestro
I tried it here on Windows 7 with PB 5.5 x86 and it works very well. There are two string gadgets for Lat and Long but I miss a button to take the map there if I put values in. Is that something that users should be able to do or are they informational only (in which case text gadgets might be less confusing) Good work!
Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Thu Sep 15, 2016 7:21 am
by djes
netmaestro wrote:I tried it here on Windows 7 with PB 5.5 x86 and it works very well. There are two string gadgets for Lat and Long but I miss a button to take the map there if I put values in. Is that something that users should be able to do or are they informational only (in which case text gadgets might be less confusing) Good work!
Thank you for your test ! The example app contains just a little part of the functionalities. It is already possible to create such button, I put it on my todo list

What will miss however is a converter from different systems.
Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Fri Sep 16, 2016 4:18 pm
by djes
Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Sat Sep 17, 2016 1:18 pm
by Andre
Hi djes,
the latest improved versions from 09th + 13th September work both like charm, many thanks for it!
I already successfully implemented the PBMap into an own (currently only internal) application, used for collecting landscape and other images and selecting their correct latitude/longitude position using PBMap (OpenStreetMap) on the map. So a very worthful help for me. Credits to you and your team are already noted (as soon the complete project will be released to the public, probably first version next year...).
As I have already created a dialog with all needed gadgets before using the PBMap stuff, I've also an already existing CanvasGadget. To implement this correctly for using it with PBMap I've extended the MapGadget procedure like below (see the ElseIf statement):
Code: Select all
Procedure MapGadget(Gadget.i, X.i, Y.i, Width.i, Height.i)
If Gadget = #PB_Any
PBMap\Gadget = CanvasGadget(PBMap\Gadget, X, Y, Width, Height, #PB_Canvas_Keyboard) ;#PB_Canvas_Keyboard has to be set for mousewheel to work on windows
ElseIf Gadget < 0 ; this is an addition by Andre for adapting the PBMap module to the GeoWorldEditor (we are using an already existing CanvasGadget here! => GadgetID will be given as negative number!)
PBMap\Gadget = Abs(Gadget)
Else
PBMap\Gadget = Gadget
CanvasGadget(PBMap\Gadget, X, Y, Width, Height, #PB_Canvas_Keyboard)
EndIf
BindGadgetEvent(PBMap\Gadget, @CanvasEvents())
AddWindowTimer(PBMap\Window, PBMap\Timer, PBMap\Options\TimerInterval)
BindEvent(#PB_Event_Timer, @TimerEvents())
;AddKeyboardShortcut(#PB_Shortcut_Delete
EndProcedure
Calling the procedure like this with negative Gadget number:
PBMap::MapGadget(-#PicDB_MapCanvas, 5, 5, GadgetWidth(#PicDB_MapCanvas)-10, GadgetHeight(#PicDB_MapCanvas)-10) ; the GadgetID of the MapCanvas will be given as negative number => this avoids, that the PBMap module is creating a new CanvasGadget!!!
So again, many thanks!
I will follow all further development on this...

Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Sat Sep 17, 2016 1:43 pm
by djes
Thank you very much Andre !

Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Fri Sep 30, 2016 9:19 pm
by djes
A lot of modifications in this version, multi-trackers, select/delete on markers and trackers, text modification on trackers, geolocalisation (address required for now), and so on. I let you discover and test :
https://github.com/djes/PBMap/tree/djes
Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Sun Oct 02, 2016 10:10 pm
by Andre
Thanks djes!
For sure I haven't tested all possibilities of this great piece of code, but it's working fine, even if included in my project!
I would be happy if you can consider including my little extension to the MapGadget() function mentioned above, for using existing (previously created) CanvasGadget with PBMap. Or maybe you have a better solution...

Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Mon Oct 03, 2016 8:25 am
by djes
Thank you Andre !

I've created a BindMapGadget(Gadget.i) especially for you, I think it's more elegant than passing a negative number, I hope it will not be a problem for you this way. If you want to contribute to the project, I can make an access for you, just ask. My personal project will be to add geo-referenced images and some edit/comment possibilities.
Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Tue Oct 04, 2016 9:08 pm
by Andre
djes wrote:I've created a BindMapGadget(Gadget.i) especially for you, I think it's more elegant than passing a negative number, I hope it will not be a problem for you this way. If you want to contribute to the project, I can make an access for you, just ask. My personal project will be to add geo-referenced images and some edit/comment possibilities.
I think every solution, which I can simply include in my project, is welcome.
Currently there is no download of the new version (mentioned above) available yet, right?
As long I can't really imagine if/how the BindMapGadget() stuff will work.
Thank you for the offer about contributing to the project, but beside my very limited time (causing my own project having a development timeline of nearly 10 years now...

) I think I'm having too less knowledge about this stuff. Currently I'm probably only using a small part of the PBMap project, showing a movable/zoomable OpenStreetMap used for placing the images of landscape/sights on their exact place and getting their longitude/latitude position...
Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Tue Oct 04, 2016 9:35 pm
by djes
Ok, you're welcome if you want !
You can download one of the latest versions here :
https://github.com/djes/PBMap/tree/djes?files=1
It is regularly updated. Actually, the update concerns a better error handling in curl, alpha loading tiles, some fixes about enter key in gadgets (I hate this), and some more.
Re: PBMap - OpenStreetMap in a Canvas gadget
Posted: Wed Mar 01, 2017 4:37 pm
by djes