Maptip Error before first map image is loaded

5 messages Options
Embed this post
Permalink
Anders Selberg

Maptip Error before first map image is loaded

Reply Threaded More More options
Print post
Permalink
Hi all!

I'm dabbling with a couple of applications running on MGOS 2.0.2 and Fusion 1.1.1 and have come across a problem with the maptip. Or, at least maptip is what I suspect. Here's what happens:  

If (and only if) I keep the mouse pointer in the map while the application is loading, I get a fusion error message like this:

Fusion Error:
FATAL: xml2json: invalid XML document: MgInvalidArgumentException : http://oskar49/mapguide/mapagent/mapagent.fcgi?version=1.0.0&locale=sv&clientagent=Fusion%20Viewer&operation=QUERYMAPFEATURES&session=8b7cf644-ffff-ffff-8000-005056b13353_en_7F0000010AFC0AFB0AFA&mapname=Samh%C3%A4llsservice49dcaaa454ed3&geometry=POLYGON((132819.306122449%206365591.102040816%2C%20132819.306122449%206365317.022809124%2C%20133093.38535414165%206365317.022809124%2C%20133093.38535414165%206365591.102040816%2C%20132819.306122449%206365591.102040816))&maxFeatures=1&persist=0&selectionVariant=INTERSECTS&layerNames=&layerAttributeFilter=5

In Firebug I can see this response:
<html>
<head>
<title>MgInvalidArgumentException</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
</head>
<body>
<h2>Invalid argument(s):
The value cannot be less than or equal to zero.</h2>
Invalid argument(s):
The value cannot be less than or equal to zero.
Exception occurred in method MgServerRenderingService.RenderForSelection at line 1041 in file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\rendering\ServerRenderingService.cpp
</body>
</html>

This only seems to happen in the time gap between when all the fusion stuff has been loaded and when the first map image is recieved and shown in the map. I get this maybe once every two or three times, and it seems to be irrespective of browser (tried it in IE6, IE7, FF3, Opera 9), and of what application I use, template-based or my own applications.

I've tried using different map definitions too with different layer settings (selectible, visible, maptip etc) but can't really see any patterns.

Has anyone else come across this, or have any clues what to look for? Maybe it's wrong of me to think that this has to do with the maptip at all?


Regards,

Anders Selberg,
Oskarshamn, Sweden
Benoit Begin

Re: Maptip Error before first map image is loaded

Reply Threaded More More options
Print post
Permalink
Open up the MapTip.js file inside of www\fusion\widgets\ and modify the function named: showMaptip: function(r).

the line: if (map == null) should be if (map == null || map.isBusy())

This will prevent this error from happening. You pretty much have to modify the code to fix the bug, but at least it works! I don't know if this also works if Fusion is used on top of MapServer. It was just a quick hack I made so this error didn't occur in my own projects.

Anders Selberg wrote:
Hi all!

I'm dabbling with a couple of applications running on MGOS 2.0.2 and Fusion 1.1.1 and have come across a problem with the maptip. Or, at least maptip is what I suspect. Here's what happens:  

If (and only if) I keep the mouse pointer in the map while the application is loading, I get a fusion error message like this:
Mike Adair

Re: Maptip Error before first map image is loaded

Reply Threaded More More options
Print post
Permalink
Hi Benoit,

Thanks for catching that, I've seen that error and suspected that it was
from something like that.
Can you enter issues like these in the Fusion Trac system please?  It
helps to keep track of what needs to be fixed.
http://trac.osgeo.org/fusion/

Thanks,

Mike

Benoit Begin wrote:

> Open up the MapTip.js file inside of www\fusion\widgets\ and modify the
> function named: showMaptip: function(r).
>
> the line: if (map == null) should be if (map == null || map.isBusy())
>
> This will prevent this error from happening. You pretty much have to modify
> the code to fix the bug, but at least it works! I don't know if this also
> works if Fusion is used on top of MapServer. It was just a quick hack I made
> so this error didn't occur in my own projects.
>
>
> Anders Selberg wrote:
>  
>> Hi all!
>>
>> I'm dabbling with a couple of applications running on MGOS 2.0.2 and
>> Fusion 1.1.1 and have come across a problem with the maptip. Or, at least
>> maptip is what I suspect. Here's what happens:  
>>
>> If (and only if) I keep the mouse pointer in the map while the application
>> is loading, I get a fusion error message like this:
>>
>>    
>
>  

--
   Michael Adair
   Senior Software Architect
   DM Solutions Group Inc.

   Office: (613) 565-5056 x26
   [hidden email]
   http://www.dmsolutions.ca
   http://research.dmsolutions.ca


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Anders Selberg

Re: Maptip Error before first map image is loaded

Reply Threaded More More options
Print post
Permalink
In reply to this post by Benoit Begin
Thanks Benoit, that solved it.

I wasn't sure if this was my mistake or a bug since I hadn't seen it in
the forum, I mean, it seems like the first thing you would notice opening
a Fusion app. =) But still, big thanks.

Just out of curiosity though, does anyone know why this happens?


//Anders


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Mike Adair

Re: Maptip Error before first map image is loaded

Reply Threaded More More options
Print post
Permalink
It happens because mouse events are triggered before the map is
initialized with LoadMap.php.  Widgets like that need to wait until the
MAP_LOADED event gets fired.

Mike

Anders Selberg wrote:

> Thanks Benoit, that solved it.
>
> I wasn't sure if this was my mistake or a bug since I hadn't seen it in
> the forum, I mean, it seems like the first thing you would notice opening
> a Fusion app. =) But still, big thanks.
>
> Just out of curiosity though, does anyone know why this happens?
>
>
> //Anders
>
>
> _______________________________________________
> fusion-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
>  

--
   Michael Adair
   Senior Software Architect
   DM Solutions Group Inc.

   Office: (613) 565-5056 x26
   [hidden email]
   http://www.dmsolutions.ca
   http://research.dmsolutions.ca


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users