Opened 17 years ago

Last modified 7 years ago

#114 new defect

Problem adding WMS dynamically

Reported by: lieuwe Owned by: mapbender_dev@…
Priority: major Milestone:
Component: wms Version: 2.4.2
Keywords: add WMS Cc:

Description

I have MapBender application where users can add WMS dynamically. Map files are generated from user input and geo-data in postgis. The MapBender gui is enclosed in a outer iframe (myFrame). Everything works ok in MapBender 2.1, but not anymore since we migrated to MapBender 2.4.2. We want to make use the extra functionality in MB 2.4.2.

Here is the javascript code where the WMS is added. <script language="javascript"> function addWMS(caps){

var oMyFrame=parent.mainCenter.framesmyFrame; var oLoadData=oMyFrame.self.framesloadData; var oTreeGDE=oMyFrame.self.framestreeGDE; var oMapframe=oMyFrame.self.framesmapframe1; url = "http://mxs092:8081/mapbender/php/mod_createJSObjFromXML.php?caps=" + escape(caps); oLoadData.document.location.href = url; oTreeGDE.document.location.reload(); oMapframe.parent.mb_mapObjaddWMSmapframe1;

} </script>

The above code works ok in MB 2.1

In MB 2.4.2 the following error appears "The property or method is not supported by this object". The error i think is caused by the call "parent.mod_addWMS_refresh();" in the MapBender module mod_createJSObjFromXML.php. The parent in this case is the outer iframe which encloses the MapBender gui. This iframe does not know the function mod_addWMS_refresh which is defined in the javascript mod_addWMSgeneralFunctions.js. The function mod_addWMS_refresh in turn calls another function mb_mapObjaddWMS defined in map.js, which i think does some housekeeping for adding WMS layers to an internal array of WMS objects.

Can someone tell how i call the external java functions mod_addWMS_refresh and mb_mapObjaddWMS outside the MapBender context, for example in a php script, where a request is done like http://mxs092:8081/mapbender/php/mod_createJSObjFromXML.php?caps=" + escape(caps)

Change History (3)

comment:1 by christoph, 17 years ago

Component: administrationwms

Thanks for using Trac.

Maybe your problem is related to this one?

http://trac.osgeo.org/mapbender/ticket/101

comment:2 by christoph, 16 years ago

Milestone: 3.0 release

comment:3 by astrid_emde, 7 years ago

Milestone: 3.0 release

Ticket retargeted after milestone deleted

Note: See TracTickets for help on using tickets.