[Mapbender-dev] WMC: limitation number of Layers/WMSor mb_mapObj[ind].toJSONString() while saving?

Christoph Baudson christoph.baudson at wheregroup.com
Wed Feb 20 09:31:34 EST 2008


Samson, Marko schrieb:
>> -----Original Message-----
>> From: mapbender_dev-bounces at lists.osgeo.org 
>> [mailto:mapbender_dev-bounces at lists.osgeo.org] On Behalf Of 
>> Christoph Baudson
>> Sent: Wednesday, February 20, 2008 11:19 AM
>> To: Mapbender Developer List
>> Subject: Re: [Mapbender-dev] WMC: limitation number of 
>> Layers/WMSor mb_mapObj[ind].toJSONString() while saving?
>>
>> Samson, Marko schrieb:
>>     
>>> Hi Devs,
>>>
>>> is there a limitation by number of WMS or layers respectively the 
>>> lenght of the "mapObject":mb_mapObj[ind].toJSONString() part in 
>>> mod_savewmc.php?
>>> I have a GUI/application with 21 WMS with perhaps 3 Layers 
>>>       
>> each. When 
>>     
>>> I save a WMC, the head of the XML looks normal, but after the 
>>> Extensions part, the Layerlist is missing and it looks like this:
>>> .
>>> .
>>> <Name>Mapbender
>>>
>>>       
>> WMC</Name><Title>test</Title><KeywordList><Keyword>Mapbender</Keyword>
>>     
>>> <K
>>>
>>>       
>> eyword>WMC</Keyword></KeywordList><Extension/></General><LayerList/></
>>     
>>> eyword>Vi
>>> ewContext>
>>>
>>> After reducing the number to 3 wms, the xml document looks 
>>>       
>> alright to 
>>     
>>> me. Seems to be a limitation or problem of
>>> "mapObject":mb_mapObj[ind].toJSONString() at 
>>>       
>> mod_savewmc.php line 82?!
>>     
>>>   
>>>       
>> Thanks for your interesting remark.
>>
>> I think was wondering the same some time ago, and I remember 
>> faintly it has something to do with the server side, the 
>> decoding of the JSON string of the mapObj.
>>
>> Either the problem (as I remember it) was not .toJSONString() 
>> in JavaScript, but the Services_JSON class in PHP, or more 
>> likely it was something weird regarding stripslashes etc. 
>> that I considered unresolvable at that time (with the time 
>> frame I had then). It depends on the magic_quotes_gpc setting 
>> in php.ini (which is "on" by default), and it might be that 
>> the script works if it is "off". It would be nice if it 
>> worked either way, so maybe we just have to add stripslashes 
>> at the server side to make it work for the default setting.
>>
>> What is your settings for magig_quotes_gpc?
>>     
>
>
> It was "on" and is now "off", but without a change. mmh
>   

Maybe go to "php/mod_insertWmcIntoDb.php" and check line 32

$mapObject = $json->decode($_REQUEST["mapObject"]);

This may be the source of all evil.

Maybe try to take a look at $mapObject via var_dump.

If you have PHP > 5.2 you might want to use the php-native JSON function 
json_decode (or is it decode_json?).

Please let us know if you are inding sth. significant

Thanks for your time

Christoph
>
>   
>> If you could check again this would be brilliant. I hope this 
>> helps at least a little bit.
>>
>> Thanks,
>>
>>  Christoph
>>     
>>> BTW: I ofen get this message when loading a 'normal' 
>>>       
>> wmc-xmlfile with
>>     
>>> MB2.4.4:
>>>
>>> syntax error mb_listWMCs.php (line 26) 
>>> window.opener.mb_registerMapObj(old_mapObj[i].frameName,
>>> old_mapObj[i].element...
>>>
>>> 25 if (old_mapObj[i].frameName != 'overview') {
>>> 26 window.opener.mb_registerMapObj(old_mapObj[i].frameName,
>>> old_mapObj[i].elementName, null, , );
>>> 27
>>>
>>>       
>> window.opener.document.getElementById(old_mapObj[i].frameName).style.w
>>     
>>> id
>>> th = ;
>>> 28
>>>
>>>       
>> window.opener.document.getElementById(old_mapObj[i].frameName).style.h
>>     
>>> ei
>>> ght = ;
>>> 29 }
>>>
>>> Is this a known problem? Whats wrong? When I save a wmc at 
>>>       
>> gui1 with 
>>     
>>> germany and mb_users wms and load it, everything works fine 
>>>       
>> (except of 
>>     
>>> the overview).
>>>
>>> Greetings,
>>> Marko
>>> _______________________________________________
>>> Mapbender_dev mailing list
>>> Mapbender_dev at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapbender_dev
>>>   
>>>       
>> _______________________________________________
>> Mapbender_dev mailing list
>> Mapbender_dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapbender_dev
>>
>>     
> _______________________________________________
> Mapbender_dev mailing list
> Mapbender_dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapbender_dev
>   



More information about the Mapbender_dev mailing list