It is currently Tue Mar 09, 2021 9:30 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 144 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10
Author Message
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Sat Jul 13, 2019 1:58 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1873
Location: Germany (Saxony, Deutscheinsiedel)
I'm using the PBMap regularly too (in my internal GeoWorldEditor, showed before), so thanks again to djes and team! :D

I know the crashes too. They happen from time to time, even if I regularly clear the cache (by standard at program end).
But I can't find any specific reason or a way to reproduce.... probably it has something to do with high traffic on the OSM servers (it's only a thought, because the crash happens during day/evening but not later in the night).

_________________
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Mon Jul 15, 2019 10:17 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1804
Location: Pas-de-Calais, France
Thank you Andre. It shouldn't crash anyway. I'll take a look.


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Thu Jul 18, 2019 3:30 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1804
Location: Pas-de-Calais, France
I've corrected some parts of the code there in the 'djes' branch : https://github.com/djes/PBMap/blob/djes/PBMap.pb

Sadly, I think there's a PB bug in the PB's internal PNG image library, leading to a crash when a malformed PNG file is loaded. I've already had something similar in the past. I've sent a bug report, I'm waiting for a fix. It should be possible to use another image library, but I think it easier to wait.

By now, could you test the updated code ? Thank you !


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Thu Jul 18, 2019 11:06 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Sep 21, 2007 5:52 am
Posts: 3579
Location: New Zealand
haven't tested it on a range of pngs but workaround for now, check to see if IEND tag is set in the image

Code:
Procedure _LoadImage(ImageNumber,File.s)
  Protected fn,pat,pos
  pat = $444E4549
  fn= ReadFile(#PB_Any,file)
  If fn
    pos = Lof(fn)
    FileSeek(fn,pos-8)
    res = ReadLong(fn)
    CloseFile(fn)
    If res = pat
      ProcedureReturn LoadImage(ImageNumber,file) 
    EndIf   
  EndIf   
EndProcedure   


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Fri Jul 19, 2019 9:01 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1804
Location: Pas-de-Calais, France
Thank you Idle ! It could do the trick and be faster than pngcheck. I'll test today. I've also added a function to delete incomplete file, even if we don't have by now the possibility without another request to know size of downloaded file.


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Fri Jul 19, 2019 10:16 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1804
Location: Pas-de-Calais, France
Code updated with idle's trick. Merged into master.


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Fri Jul 19, 2019 9:18 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1873
Location: Germany (Saxony, Deutscheinsiedel)
Thank you very much idle and djes! (and thanks too for the credits in your Readme :-) - you're the ones, who deserve them - later in my project :D)

I've included the updated PBMap.pb code into my GeoWorldEditor.
It runs fine.... if it helps in the long term to avoid the randomly crashes we will see... but your approach to make tests for valid map tiles before loading them as image sounds like a good idea :D

_________________
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Thu Jan 14, 2021 10:31 am 
Offline
User
User

Joined: Tue Jun 30, 2020 6:22 am
Posts: 36
Has somebody implemented OpenWeather(or any other) precipitation map layers in PBMap?

Lukas


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Sun Jan 17, 2021 11:42 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1804
Location: Pas-de-Calais, France
Did you try to change the demo application ?

Edit : BTW, I just found that including the demo in the module can be difficult to understand. And the demo code is maybe a bit confusing with too many options... I just separated the basic demo, and if I have time I'll do a very basic demo.

Could you test by altering the demo.pb code at the line 300 :
Code:
PBMap::AddOSMServerLayer(#Map, "OpenSeaMap", 3, "http://t1.openseamap.org/seamark/") ; Add a special osm overlay map on layer nb 3
Change the URL as explained in https://openweathermap.org/current
Quote:
api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={API key}
Don't include lat and long as it's PBMap's job. So you should have
Code:
PBMap::AddOSMServerLayer(#Map, "OpenWeatherMap", 3, "http://api.openweathermap.org/data/2.5/weather?appid=your_key") ; Add a special openweathermap overlay map on layer nb 3

The code is there : https://github.com/djes/PBMap


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 144 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye