[Cartoweb-users] Edit layer

Albert Casanovas casanovas at k2sistemas.com.br
Thu May 29 09:13:34 EDT 2008


Hi Giovanni,

Let me see if I understood right, you need to use the demoEdit but instead of using a postGis connection you want to modify a shape file, to do that I can see two solutions:

1. Export the shapefile to the postGis database to use it with the demoEdit

http://mapserver.gis.umn.edu/docs/reference/mapscript/index_html#shapefileobj

2. Modify the plugin of the demoEdit to allow the edition of the shapefile instead of using the database, for that you would need to use the php mapscript reference. I am not really sure how can this be done

http://mapserver.gis.umn.edu/docs/reference/mapscript/index_html#shapefileobj

By another hand, if you need to modify any part of the mapfile in execution time, you can use the mapOverlay plugin of cartoweb:

http://www.cartoweb.org/doc/cw3.2/xhtml/dev.mapoverlay.html

People from the forum, feel free to correct me if I'm wrong about this.


Regards,
Albert

  ----- Original Message ----- 
  From: Giovanni Virdis 
  To: Albert Casanovas 
  Sent: Thursday, May 29, 2008 5:14 AM
  Subject: R: [Cartoweb-users] Edit layer


  Hi Albert,

   

  Thanks for your help if is possible can you help me in other proble.

   

  I have a shape file and I want configure the map file to update the data of this file.

  I must modify the METADATA part.

  I look the example of the editDemo but in this case the data are load from db connection is possible create a similar solution with a shape file?

   

  Regards

   

  Giovanni

   


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

  Da: Albert Casanovas [mailto:casanovas at k2sistemas.com.br] 
  Inviato: mercoledì 28 maggio 2008 15.46
  A: Giovanni Virdis; cartoweb-users at lists.maptools.org; cartoweb-dev at lists.maptools.org; Cartoweb-users-request at lists.maptools.org
  Oggetto: Re: [Cartoweb-users] Edit layer

   

  Hi Giovanni,

   

  We have implemented a solution for what you are trying to do. When you select the layer it displays the information and then you can click a button to add aditional information to it, extending the metadata outside of the mapfile:

   

  First you have to do an icon for the button and put it in the edit/htdocs/gfx (in our case it was named 'edit_series.gif'

   

  Then in the dhtmlEdit.js file in the function Map.prototype.editTableAddRow you have to replace the last part by the following:

   

    // rencenter on feature
    if (aFeature.operation != 'insert') {
     
   //Recenter
      var image = createInput(td, 'edit_recenter', '', 'image');
      image.src = xGetElementById("edit_recenter").src;
      image.border = "0";
      image.href = "#";
      image.onclick = function() {
        var id_recenter_ids = xGetElementById('id_recenter_ids');
        if (id_recenter_ids == null)
          var input = createInput(myform, 'id_recenter_ids', aFeature.id, 'hidden');
        else
          id_recenter_ids.value = aFeature.id;
        
        var id_recenter_layer = xGetElementById('id_recenter_layer');
        if (id_recenter_layer == null)
          var input = createInput(myform, 'id_recenter_layer', myform.edit_layer.value, 'hidden');
        else
          id_recenter_layer.value = myform.edit_layer.value;
        doSubmit();
      }
   
   //xAppendChild(td, image);
    xAppendChild(row, td);
   
   var td = xCreateElement("td");
   
   //Editar Serie
   var image2 = createInput(td, 'edit_series', '', 'image');
      image2.src = xGetElementById("edit_series").src;
      image2.border = "0";
      image2.href = "#";
      image2.onclick = function(){
    window.open ("http://localhost/cartoweb3/htdocs/agroGeo/talhao.php?id="+aFeature.id,"","width=680,height=500,resizable=1,scrollbars=1"); 
   }
   //xAppendChild(td, image2);
    }
    
    xAppendChild(row, td);
    xAppendChild(tbody, row);

   

   

  Hope it helps,

   

  Regards,

  Albert

   

    ----- Original Message ----- 

    From: Giovanni Virdis 

    To: cartoweb-users at lists.maptools.org ; cartoweb-dev at lists.maptools.org ; Cartoweb-users-request at lists.maptools.org 

    Sent: Wednesday, May 28, 2008 8:23 AM

    Subject: [Cartoweb-users] Edit layer

     

    If is possible i want create a popup menu on the selected layer to edit the layer and show a toolbar to manage the object in the map 


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

    _______________________________________________
    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/20080529/808ce52f/attachment-0001.html


More information about the Cartoweb-users mailing list