[Cartoweb-users] Edit layer
Albert Casanovas
casanovas at k2sistemas.com.br
Wed May 28 09:42:04 EDT 2008
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/20080528/bf1213f1/attachment-0001.html
More information about the Cartoweb-users
mailing list