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

All times are UTC + 1 hour




Post new topic Reply to topic  [ 144 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10  Next
Author Message
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Sat Mar 03, 2018 11:22 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1804
Location: Pas-de-Calais, France
Great ! I love to work like this. I can't code by now, but in Pbmap.pb you can change the refresh() function like this
Code:
Procedure Refresh(MapGadget.i)
    Protected *PBMap.PBMap = PBMaps(Str(MapGadget))
    *PBMap\Redraw = #True
    ; Drawing()
  EndProcedure
SetActiveGadget() shouldn't change the returned GetActiveWindow() value. I think it's a PB bug.


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Sat Mar 03, 2018 7:29 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1804
Location: Pas-de-Calais, France
Last bugs should be corrected. I have included your example in the branch, would you agree to include it in the master ?

https://github.com/djes/PBMap/tree/djes


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Sun Mar 04, 2018 12:10 am 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1873
Location: Germany (Saxony, Deutscheinsiedel)
djes wrote:
Last bugs should be corrected. I have included your example in the branch, would you agree to include it in the master ?

https://github.com/djes/PBMap/tree/djes

Thank you very much, djes! The 2 panel / 2 maps example works like a charm now :D
(It should do also in my GeoWorldEditor, but this still need to be adapted to the new syntax...)

And of course - feel free to add the new PBMap example to the master :mrgreen:

By the way: the mentioned SetActiveGadget() problem is now also gone (since the latest PBMap update), don't know why, but I couldn't reproduce it in small test code... (else I would have made a bug-report).

Edit: I just finished the adaption of my project source according to the new PBMap syntax, and also this 'real world' with two PBMap CanvasGadgets runs now stable. Now I only need to do some 'stress tests' with working 2-3 hours with the editor, to check if there are some randomly crashes (see my earlier reports) left.... but for now: awesome work, djes! :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: Sun Mar 04, 2018 12:32 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1804
Location: Pas-de-Calais, France
Good to hear ! :)
Let me know about your tests so that I can update the main. :mrgreen:


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Fri Mar 16, 2018 8:36 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1873
Location: Germany (Saxony, Deutscheinsiedel)
This evening I wanted to do the 'stress test' and I got randomly "invaiid memory-access" crashes (at line 1470 in PBMap include) again. So this should have nothing to do with the latest changes, but with an earlier problem instead!?

There is no unique way to recreate the crash, it occurs especially if I'm re-using the same map position several times (= calling the canvas in my application with the same coordinates), and clicking in the map for a new position...

If it's of any help here are two screenshots of my application and of my PB IDE at the point of the crash:
Image Image

Edit: next time I got a crash at line 1464
Code:
                DrawVectorImage(ImageID(*timg\nImage), 255 * *PBMap\Layers()\Alpha)


Maybe you can provide a "Debug" version of PBMap, which helps to find the bug?

Thank you :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: Fri Mar 16, 2018 10:04 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1804
Location: Pas-de-Calais, France
So bad... Are you using a timer? Debug can be activated by using verbose mode and compiling in console mode...


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Fri Mar 16, 2018 10:18 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1873
Location: Germany (Saxony, Deutscheinsiedel)
djes wrote:
So bad... Are you using a timer? Debug can be activated by using verbose mode and compiling in console mode...

No timer (at least I don't know/find one).

But I'm using threads for a busy window (but this is only called when a sub-window with GeoNames is open and searching/filling listicon) and for filling the listicons in the main window (right side, when a country is selected in the combobox then all related admin. divisions, mountains, etc. are filled into the listicons).

Do you see a problem for PBMap because of this?

(Btw. in previous post I've added another point where the invalid memory access occurs.)

_________________
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: Sat Mar 17, 2018 2:40 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1804
Location: Pas-de-Calais, France
If threads are protected and not using PBMap resources without protection, no problem.

I've corrected the debug mode, which forced me to specify which window was used. See your multiple pbmap example.


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Sat Mar 17, 2018 4:33 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1873
Location: Germany (Saxony, Deutscheinsiedel)
Hi djes,

I've installed your latest PBMap update here and have seen the active Console window logging the image accesses (?) of PBMap.

Do you mean, that I should also add
Code:
    PBMap::SetOption(#Map, "Verbose", "1")

to my tool for debugging purposes?


Sorry to say, but I'm not really familar with using threads. So if you mean with "protected" the use of semaphores and mutexes - no I don't have... :oops:

I didn't know that the threaded listicon updates according to combobox changes would have any influence on the PBMap ressources and its Canvas gadget displaying the map. Does it?
At least from the point of crash noted above (invalid memory access with the OSM images) I couldn't imagine any correlation...

_________________
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: Sat Mar 17, 2018 8:05 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1804
Location: Pas-de-Calais, France
Using the verbose option will give you full debug detail in the console window. It's then possible to track the latest action leading to a hang.

I can't say it your thread is leading to a bug. I don't think it's because of a PBMap conflict but thread bugs are sometimes difficult to track. Could you simply try to not create your thread, to easily see if the bug still occurs ? If yes, your thread is not the cause.


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Sun Mar 18, 2018 11:05 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1873
Location: Germany (Saxony, Deutscheinsiedel)
djes wrote:
Could you simply try to not create your thread, to easily see if the bug still occurs ? If yes, your thread is not the cause.

I've adapted my GeoWorldEditor to use the threaded combobox filling only optional. I'm currently testing with this threads disabled. No problems so far.... :D I will report again after some more 'stress tests'...

_________________
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: Sun Jun 10, 2018 3:23 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jan 20, 2014 6:32 pm
Posts: 252
I am trying to get the cords under the mouse but seems to be coming back a little off should this be right?

Debug Pixel2Lat(CanvasMouseX)
Debug Pixel2Lon(CanvasMouseY)

_________________
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


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Sun Jun 10, 2018 8:21 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1873
Location: Germany (Saxony, Deutscheinsiedel)
@djes: Just forgot to say, that my GeoWorldEditor is running like a charm after deactivating the threaded listicon filling. So the PBMap include is now running always fine, even in heavy stress-tests / production mode. Thank you for this! :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: Mon Jun 11, 2018 6:33 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1804
Location: Pas-de-Calais, France
vwidmer wrote:
I am trying to get the cords under the mouse but seems to be coming back a little off should this be right?

Debug Pixel2Lat(CanvasMouseX)
Debug Pixel2Lon(CanvasMouseY)

Seems right to me.
Andre wrote:
@djes: Just forgot to say, that my GeoWorldEditor is running like a charm after deactivating the threaded listicon filling. So the PBMap include is now running always fine, even in heavy stress-tests / production mode. Thank you for this! :D
Thank you Andre !


Top
 Profile  
Reply with quote  
 Post subject: Re: PBMap - OSM, Here, Geoserver maps in a Canvas gadget
PostPosted: Mon Jun 11, 2018 9:25 am 
Offline
Addict
Addict
User avatar

Joined: Thu Feb 09, 2006 11:27 pm
Posts: 2567
Just wanted to check the Pixel2LatLon conversations but when doing a lot of double clicks on the map I will get memory access errors here (code from djes branch):

Code:
[09:48:58] Waiting for executable to start...
[09:48:57] Executable type: Windows - x86  (32bit, Unicode, Thread)
[09:48:58] Executable started.
[09:51:23] [ERROR] Line: 1241
[09:51:23] [ERROR] Invalid memory access. (read error at address 4294967293)
[09:53:48] The debugged executable quit unexpectedly.
[09:57:21] Waiting for executable to start...
[09:57:21] Executable type: Windows - x86  (32bit, Unicode, Thread)
[09:57:21] Executable started.
[09:58:19] [ERROR] Line: 1143
[09:58:19] [ERROR] Invalid memory access. (read error at address 4294967293)
[09:58:45] The debugged executable quit unexpectedly.

Concerning the conversion routine - the procedure 'Pixel2LatLon' looks correct for me, I'd only remove one redundant Mod (as well as in 'ClipLongitude'):

Code:
x=7
n=6

Debug Mod(Mod(x / n * 360.0, 360.0) + 360.0, 360.0) - 180
Debug Mod(x / n * 360.0+360.0, 360.0) - 180;  <<<  : )
Debug Mod((1+x/n)*360,360)-180

Debug ""

y=7

Debug Degree(ATan(SinH(#PI * (1.0 - 2.0 * y / n))))
Debug Degree(ASin(TanH(#PI * (1.0 - 2.0 * y / n))))
Debug Degree(2*ATan(Exp(#PI*(1.0- 2.0 * y/n))) -#PI/2)


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 8 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