Hi,

the following hints assume that you use the wfs-t example and add the
following to your config, I suggest above the <EditPoint> node:

    <MovePoint id="movePoint">
      <scriptFile>MovePoint.js</scriptFile>
      <buttonBar>mainButtonBar</buttonBar>
      <targetModel>featureCollection</targetModel>
      <mouseHandler>mainMouseClick</mouseHandler>
      <class>RadioButton</class>
      <enabledSrc>/images/EditPointEnable.png</enabledSrc>
      <disabledSrc>/images/EditPointDisable.png</disabledSrc>
      <transactionResponseModel>transaction</transactionResponseModel>
      <webServiceUrl>../../../geoserver/wfs</webServiceUrl>
      <targetContext>mainMap</targetContext>
      <featureXpath>//gml:coordinates</featureXpath>
      <defaultModelUrl>template_cities.xml</defaultModelUrl>
    </MovePoint>

Then do as I said: take EditPoint.js, save it in the wfs-t demo folder
as MovePoint.js, rename the main function to MovePoint, and specify
the following to override the doAction() method from
EditButtonBase.js:

  this.loadDefaultModel = function(objRef) {
    var str = new
XMLSerializer().serializeToString(objRef.targetModel.doc.selectSingleNode('//gml:featureMember'));
    var doc = Sarissa.getDomDocument();
    objRef.targetModel.doc = (new DOMParser()).parseFromString(str, "text/xml");
    objRef.targetModel.setParam('refresh');
  }

To use it, you first press the SelectFeature button in the demo. Then
you select the city you want to move. Then you press your MovePoint
button, click to the new coordinate of the city. And finally, you
click SaveModel to save your changes.

That's it.

Regards,
Andreas.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
mapbuilder-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel

Reply via email to