[mapguide-users] Error with MGOS 2.0 and Fusion

Andre Schoonbee andresch at iway.na
Fri Sep 4 05:47:54 EDT 2009


I'm trying to create a custom query for a layer filtering when the map
loads. Basically the code I'm executing in the var fusionInitialized
function is: 

var map = Fusion.getWidgetById('Map'); 
var options = {}; 
options.maxFeatures = 0; 
options.layers = '(Points)'; 
options.filter = '(PointNr LIKE \'%007%\')'; 
map.query(options); 

However, the query execution throws an exception: 

Fusion Error: 
WARNING: Exception occurred in AJAX callback. 
Message: invalid label 
Location: http://localhost:8008/mapguide/fusion/MapGuide/MapGuide.js (774) 
Response: ERROR: Argument is null. 
Argument is null. 
Exception occurred in method MgResourceIdentifier.CheckName at line 624 in
file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\common\platformbase\Ser
vices/ResourceIdentifier.cpp 

- MgMap.Open line 457 file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\common\mapguidecommon\M
apLayer/Map.cpp 
- MgResourceIdentifier.CheckName line 624 file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\common\platformbase\Ser
vices/ResourceIdentifier.cpp 


I have debugged the query process from MapGuide.js  - query :
function(options) - adding the alert massage as shown below: 
//.... 
var ajaxOptions = { 
            onSuccess: OpenLayers.Function.bind(this.processQueryResults,
this, zoomTo), 
            parameters: params}; 
/* >>>>>> */ alert('mapname:
'+params.mapname+'\nsessionid:'+params.sessionid+'\nlayers:
'+params.layers+'\nfilter: '+params.filter); 
        Fusion.ajaxRequest(loadmapScript, ajaxOptions); 
//...... 

The message shows that at the execution of the query both the mapname and
sessionid are not defined for the map 

mapname: undefined 
sessionid:undefined 
layers: (Points) 
filter: (PointNr LIKE '%007%') 

Q: Since the fusionInitialized is registered to be executed on
Fusion.Event.FUSION_INITIALIZED, what is the problem with the above test ? 
My idea was that the map should have been fully loaded by then and the
filter queried ok. 

Thank you,



More information about the mapguide-users mailing list