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

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
smishra
User
User
Posts: 70
Joined: Tue Jun 06, 2006 3:39 pm
Location: Maryland US

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by smishra »

Just downloaded and took a look at PBMap. It is great! Thanks...

Is there a way to use a tile server that gives aerial imagery? I looked at Open Street Map site and they say there is high resolution imagery available from

http://wiki.openstreetmap.org/wiki/USGS ... thoimagery

I was trying to see if we can add that as an option to PBMap. I am new to this, so if how to add aerial imagery is immediately obvious to more experienced people let me know, else I will keep trying different options.
smishra
User
User
Posts: 70
Joined: Tue Jun 06, 2006 3:39 pm
Location: Maryland US

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by smishra »

Hunting around I saw mapquest used to provide a URL to access satellite imagery tiles but that has been discontinued as of July 2016
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 »

Thank you for your comment. :)

Yes, it is possible to add any tiled layer available. What we have provided is a sample of two layers, one with osm and one with nautical infos. It should be possible to add aerial imagery, with minimum knowledge.

We haven't included google or other imagery for copyright reasons, and to promote open source technology, but you can do whatever you want with the code for your own purposes.

I'll take a look to include your linked layer.
smishra
User
User
Posts: 70
Joined: Tue Jun 06, 2006 3:39 pm
Location: Maryland US

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by smishra »

Satellite imagery seems to be available from a variety of providers. Their URL formats differ slightly and they require a key. For low usage, keys are available for free after signup.

See for example,

https://developer.here.com/rest-apis/do ... e-map.html

One simple way to handle this would be to add

Key string field to Layer structure

and extend the URL so that it has placeholders for x,y,z and key which are replaced by actual tile x,y,z and key using ReplaceString

Bing uses quad trees instead of x,y,z but if we handle only tile x,y,z it will keep everything simpler for now.
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 »

You will find the latest code on this place : https://github.com/djes/PBMap/tree/djes
  • HERE support included, don't forget to register on on the HERE site (aerial view as example)
  • Nasty dragging bug fixed
  • Improved layer support
Please test and report bugs...
smishra
User
User
Posts: 70
Joined: Tue Jun 06, 2006 3:39 pm
Location: Maryland US

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by smishra »

Wow, that was quck! You are awesome 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:You will find the latest code on this place : https://github.com/djes/PBMap/tree/djes
  • HERE support included, don't forget to register on on the HERE site (aerial view as example)
  • Nasty dragging bug fixed
  • Improved layer support
Please test and report bugs...
I have tested here on Win10 the included (PBMap.pb) example, and also included the updated codes into my project (GeoWorldEditor).
And it works awesome, thank you very much! :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
smishra
User
User
Posts: 70
Joined: Tue Jun 06, 2006 3:39 pm
Location: Maryland US

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by smishra »

I have tested your code djes and it works great!

I am thinking of working on following features

- Limited KML import. I primarily deal with tracks in KML so I would add support for that.

- The user would be able to edit tracks around and save them. Sort of like vector editing in CartoonEdit but the vectors would be saved as geographic coordinates. If we could get the source of a program like CartoonEdit that would be great.

- I am thinking of adding an interface that will allow other programs that generate geographic data to interact with it. If I made a command line interface it would enable both humans and other programs to interact with it using stdio /stdin interface. Maybe we could expose commands like load file, save file, move to and so on. At a later time we could add Lua scripting also

Any inputs would be appreciated.
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 »

What could I say other than : great! If you want an access to the pbmap repository, just ask.

The gpx tracks are somewhat similar to kml. Shape support would also be useful. It could be implemented inside pbmap, with something similar to the marker edition mode...
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 »

I'm just wondering, if the PBMap module can crash if there are problems getting all the needed map tiles (fast enough)!?

First when included in my program, but then also tested it standalone with the included example in the PBMap module itself:

1.) When included in my project I got an 'Image not intialized' error at line 1109

Code: Select all

              DrawVectorImage(ImageID(*timg\nImage), 255)
2.) When tested it standalone with the original PBMap example I get a crash without further notice (compiled executable ended unexpected...).

Both happens when I zoom in into the city centre of 'Salzburg' in 'Austria' (bordering country south of Germany). It seems there are some problems getting all map tiles at a high zoom level...
Here is also a Wikipedia article with coordinates in the top-right corner: https://en.wikipedia.org/wiki/Salzburg_Cathedral

See here: Image => big: https://pl.vc/ve4io

Anyone else getting such problems?
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 »

Thank you for your bug report. After some stress test, it seems that the new HTTPProxy() function should not be called in a thread. It was not its place however, I've moved it and there's no bug anymore. I've fixed some little things too. Could you test this new version here ? https://github.com/djes/PBMap/tree/djes

Thank you !
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: PBMap - OpenStreetMap in a Canvas gadget

Post by Josh »

Andre wrote:Both happens when I zoom in into the city centre of 'Salzburg' in 'Austria'
This can't be a good app, if it crash 500 m from my home :wink:
sorry for my bad english
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 »

Josh wrote:
Andre wrote:Both happens when I zoom in into the city centre of 'Salzburg' in 'Austria'
This can't be a good app, if it crash 500 m from my home :wink:
;)

Andre> Sync had failed, if you still have bugs, please try again 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:
Josh wrote:
Andre wrote:Both happens when I zoom in into the city centre of 'Salzburg' in 'Austria'
This can't be a good app, if it crash 500 m from my home :wink:
;)

Andre> Sync had failed, if you still have bugs, please try again on https://github.com/djes/PBMap/tree/djes
Hi djes,

thanks for the update - I just tried this 2nd new upload (I'm at home only later in evening...). :D
But unfortunately it crashs again, already if I'm using the example included in PBMap.pb itself.
Starting at the location near Auckland (New Zealand), zooming out and moving the focus to Europe / Austria, and finally zooming in into the city centre of the old town in Salzburg (near cathedral) it crashes "unexpected"...
So the problem 2) as written above is still existing.... I'm wondering if anyone else could try too!?

About the problem 1) I had the idea, if there could be a clash between ImageIDs of my program and the PBMap include (probably using both the same ImageID's?) - my problems began, as soon I reached >100 images (starting with ImageID = 0) in my program. But after some crashes it worked, so there seems to be no general problem. That's why I think you're right with searching the bug related to threads...

@Josh: :lol:
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 »

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 !
Post Reply