PBMap - OSM, Here, Geoserver maps in a Canvas gadget

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by djes »

Glad to hear it ! :D
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by djes »

User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by djes »

New version here to test : https://github.com/djes/PBMap/tree/djes

-> better cache mechanism with thread limiting, and thread overload fixed.
vwidmer
Enthusiast
Enthusiast
Posts: 282
Joined: Mon Jan 20, 2014 6:32 pm

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by vwidmer »

Thanks for the updates.
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by djes »

New master with full cache rewrite, and new functions from yves86 allowing track modification in the future.
https://github.com/djes/PBMap
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by Andre »

Thank you for the update :D

I've successfully included it in my project.
I'm just wondering.... does have the download/display speed of the map (when moving around, zooming, etc.) has been decreased because of new functions?
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by djes »

Andre wrote:Thank you for the update :D

I've successfully included it in my project.
I'm just wondering.... does have the download/display speed of the map (when moving around, zooming, etc.) has been decreased because of new functions?
Thank you for your test.

Yes, the display is not slower, but download could be, for two reasons : first, OSM seems to have reinforced rules control, with slower bandwidth (that I've experienced), so, second, I decided to better follow the Tile Usage Policy, reducing to 2 the maximum simultaneous download slots. You can change this behavior, but be warned that it could lead to some disagreement.

I'm thinking to make this program an official implementation, maybe making a DLL...
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by Andre »

Thank you, djes, for this clarification! :)

Yes, it really seems to be the bandwidth issue, especially when I'm using a very high detail level (16-18). But this is needed for placing my GeoWorld multimedia objects to the right place on the map...

If you plan to make a DLL will it be closed source then?
Will you also support other OS than Windows then? (currently I could use the include also for the MacOS version of my editor tool)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by djes »

No, it'll always be open source, with provided binary version, to enlarge audience.
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by Andre »

djes wrote:No, it'll always be open source, with provided binary version, to enlarge audience.
Nice, thank you.

I hope, that PBMap will get more / its deserved attention by this change/addition! :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
vwidmer
Enthusiast
Enthusiast
Posts: 282
Joined: Mon Jan 20, 2014 6:32 pm

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by vwidmer »

Would it be possible to when you have multible layers turned on to make particular colors of other layers transparent?

Example: like the greyish area in the OSM tiles to be transparent so that other tiles show through more clear?

Thanks
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by djes »

I'll study that.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by djes »

The "easy" way I see is to use 2D drawing lib's CustomFilterCallback(@CallbackFiltre()) function, and instead of drawing with DrawVectorImage() , using DrawImage(). It should be really slow however if done in realtime (line 1408 of pbmap.pb). A better solution would be to convert PNG file when downloaded, creating a definitive transparent one. Then, the drawing could occur at normal speed. It shouldn't be too difficult to implement (after line 2542 of pbmap.pb, called when the download thread is finished).

Finally, the best solution would be to use a custom tile server, creating good transparent tiles from vector data. It's a bit expensive BTW.
vwidmer
Enthusiast
Enthusiast
Posts: 282
Joined: Mon Jan 20, 2014 6:32 pm

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by vwidmer »

So your saying download the tile then run a transparency filter on the downloaded file then load it to the canvas?
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by djes »

vwidmer wrote:So your saying download the tile then run a transparency filter on the downloaded file then load it to the canvas?
Mostly, download the tile, do the transparency filter on it, replace the tile file. That's all.
Post Reply