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

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
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:Thank you for your test, I'll try to do what you explain tomorrow. If you have some time, could you try with cleaned image cache? There's a button to do that in the example interface. Thank you again !
You're welcome, I have to say thank you! :D

And I think you got the problem: after clearing the disk-cache, where has been collected around 44 MByte in >3100 image stored in >500 sub-folder, the PBMap example works without a crash. :mrgreen:

So maybe a 'counter' (counting the files in the temp folder) would probably help, automatically warning the user to clear the cache if some limit has been reached...
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 »

Good to know, I'll try to implement something like 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 »

I've implemented a tile lifetime management, preview as usual on https://github.com/djes/PBMap/tree/djes
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:I've implemented a tile lifetime management, preview as usual on https://github.com/djes/PBMap/tree/djes
I've implemented this new update into my project and it (still) works well :D
But I haven't seen the "clean-up of the image cache" in action yet...

Just a reminder (as I'm adding the following code each time to the MapGadget() procedure again): I would be happy, if there would be support for already created CanvasGadgets (what I have to initialize already at Dialog creation in my project) by giving their GadgetID as parameter to MapGadget(). Currently I've done it with the trick, that I'm giving the GadgetID as negative value, handled by the following code the MapGadget() function:

Code: Select all

    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)
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:
djes wrote:I've implemented a tile lifetime management, preview as usual on https://github.com/djes/PBMap/tree/djes
I've implemented this new update into my project and it (still) works well :D
But I haven't seen the "clean-up of the image cache" in action yet...

Just a reminder (as I'm adding the following code each time to the MapGadget() procedure again): I would be happy, if there would be support for already created CanvasGadgets (what I have to initialize already at Dialog creation in my project) by giving their GadgetID as parameter to MapGadget(). Currently I've done it with the trick, that I'm giving the GadgetID as negative value, handled by the following code the MapGadget() function:

Code: Select all

    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)
There's for a long time the

Code: Select all

BindMapGadget(Gadget.i)
procedure, made especially for you... Doesn't it make the job?
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: There's for a long time the

Code: Select all

BindMapGadget(Gadget.i)
procedure, made especially for you... Doesn't it make the job?
Sorry, I forgot about this... :? But thank you! :D

I still need to check, if it would work (haven't used the Bindxxx commands very often until now, sometimes they seems to be not flexible enough because of limited/fixed parameters etc....).
As I will be on vacations the next week, I make a short break from programming. Will be back soon! :P
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: As I will be on vacations the next week, I make a short break from programming. Will be back soon! :P
Wow ! I think you choose the best option to visit this nice place on all its diversity :D
Enjoy !
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:
Andre wrote: As I will be on vacations the next week, I make a short break from programming. Will be back soon! :P
Wow ! I think you choose the best option to visit this nice place on all its diversity :D
Enjoy !
Thank you :mrgreen:

It's a postponed honeymoon in the fifth year of our marriage... :D
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 »

Worth the wait, worth the marriage, or both! It gets me confused :mrgreen:
vwidmer
Enthusiast
Enthusiast
Posts: 282
Joined: Mon Jan 20, 2014 6:32 pm

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by vwidmer »

How would I use this with GeoServer with a tile url like:

Code: Select all

http://domain.tld/getmap?PARAMS=LAYERS=config_1_1_0&TRANSPARENT=FALSE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A6859&BBOX=-597611.97676758,4297032.4863364,-597306.22865448,4297338.2344495&WIDTH=256&HEIGHT=256&TEST=-597611.97676758,4297032.4863364,-597306.22865448,4297338.2344495&ZOOM=14&v=1
Do I just change the OSM urls with this map server or do I have to make different functions?

I am still trying to understand how everything works.

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 »

Let me study a bit the thing and I'll answer you soon.
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've implemented a basic geoserver/geocache support based on google maps service, as it's the most similar to our approach (see there http://geowebcache.org/docs/current/services/gmaps.html)

Could you download and test the new version here ? Thank you ! https://github.com/djes/PBMap/tree/djes
vwidmer
Enthusiast
Enthusiast
Posts: 282
Joined: Mon Jan 20, 2014 6:32 pm

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by vwidmer »

@djes: Thanks alot I am trying your code seems to be pulling and probably would work but think the cordinates are different then what its expecting.

It getting somthing like "4042,2498" and think its expecting something more like "1251552.61125,4604309.34"

Think its using EPSG 6859 projection.
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:@djes: Thanks alot I am trying your code seems to be pulling and probably would work but think the cordinates are different then what its expecting.

It getting somthing like "4042,2498" and think its expecting something more like "1251552.61125,4604309.34"

Think its using EPSG 6859 projection.
Is it possible de change the projection ? We're using the common google projection http://www.maptiler.org/google-maps-coo ... rojection/, and our code derived from http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames.

Changing the projection is possible (and should occur at some point), but it would need a big rework.
vwidmer
Enthusiast
Enthusiast
Posts: 282
Joined: Mon Jan 20, 2014 6:32 pm

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by vwidmer »

@djes: Ok so I found out how to call it using the standard OSM way and its working great. Very nice.
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
Post Reply