[Cartoweb-users] Edit plugin recenter and edit

Oliver Christen oliver.christen at camptocamp.com
Wed Nov 28 03:26:55 EST 2007


Hi

DemoCS ? you mean the "Direct access" dropdown menu at the top?

So what you want to do is:
by selecting a object in a dropdown menu, it would:
1) recenter on the object
2) trigger the edition so the feature is loaded from database and activated in the dhtml so you can edit it

for 1) you simply use the existing recenter filters (http://www.cartoweb.org/doc_head/docbook/xhtml/dev.newplugin.html#dev.newplugin.special.filters)

for 2) you can use the 
"edit_layer_id" and
"edit_features_ids"
parameters
these are undocument and the truth is I just discovered them when trying to answer you question. I will complet the documentation.

BUT, these two parameters (edit_layer_id and edit_features_ids) are intended to be used via the url (for example: http://www.cartoweb.org/demos/demoEdit.php?edit_layer_id=edit_point&edit_features_ids=459)

So, if you want to use them in a plugin so you can do the recenter and the edit selection at once, you will have to extend a little bit the edit plugin.
http://www.cartoweb.org/doc_head/docbook/xhtml/dev.newplugin.html#dev.newplugin.adapting.extending
the only function you need to extend is handleHttpPostRequest !

More specificaly, copy the content of edit's handleHttpGetRequest into your extended edit plugin's handleHttpPostRequest
(well, in fact not copy as the "if (isset ($_GET[...]))" will obviously not work when using POST but the idea is to check if the two parameters are in the $request object and if yes, recover the values and store them in variables)

Once you have extended the edit plugin, all you need is then to, in your other plugin (the one that will manage the recenter and edit feature activation) set all the parameters needed via the filterPostRequest function (your plugin class will have to implement filterProvider)

if you want an example, simply look at the plugin "outline" ClientOutline.php function filterGetRequest and see documentation http://www.cartoweb.org/doc_head/docbook/xhtml/dev.newplugin.html#dev.newplugin.special.filters

good luck

Regards
Oliver
  ----- Original Message ----- 
  From: Broun Uganda 
  To: cartoweb-users at lists.maptools.org 
  Sent: Tuesday, November 27, 2007 1:50 PM
  Subject: [Cartoweb-users] Edit plugin recenter and edit



  Dear All,
  I would like to implement a recenter in a way that allows me to edit the feature i select.
  Example would be something like. Query database and find a feature house14 in layer Houses, recenter and select this house14 for editing. How would i be able to achieve this? I can see DemoCS example does something similar with a preset list of features but i don't access to this example.
  Thank you
  Broun Uganda




------------------------------------------------------------------------------
  Discover the new Windows Vista Learn more! 


------------------------------------------------------------------------------


  _______________________________________________
  Cartoweb-users mailing list
  Cartoweb-users at lists.maptools.org
  http://lists.maptools.org/mailman/listinfo/cartoweb-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20071128/343b4ac0/attachment-0002.html


More information about the Cartoweb-users mailing list