AW: AW: [OpenLayers-Users] modify attribut of marker

Arnd Wippermann arnd.wippermann at web.de
Sat May 21 11:36:02 EDT 2011


Thanks for the hint. I have eliminated the bug.

i think, you mean : var tempname = getAttribute(selectedFeature, "name");

But wouldn't it be enough, to use only

function EditMarker() 
{
    if (selectedFeature != "None")
    {
        selectedFeature.attributes["mstatus"] =
document.getElementById("mstatus").value;
        selectedFeature.attributes["icon"]    =
document.getElementById("icon").value;
    }
}

to update the attributes of the feature?

Arnd 

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von razibu
Gesendet: Samstag, 21. Mai 2011 14:31
An: users at openlayers.org
Betreff: Re: AW: [OpenLayers-Users] modify attribut of marker

The page u linked too is not really working. If you choose "edit all" and
then press refresh, all symbols disappear.

I tried the function you mentioned but the return just give "undefined"

That is the editing function

function EditMarker() {
				        if (selectedFeature != "None") {
					    var tempname =
getName(selectedFeature);
	
layer.removeFeatures(layer.selectedFeatures);
				            var features = [];
				            var myMarker = new
OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Point(selectedFeature.geometry.getBounds().getCenterLonL
at().lon,
selectedFeature.geometry.getBounds().getCenterLonLat().lat));
				            var MarkerLabel = tempname;
				            var MarkerStatus =
document.getElementById("mstatus").value;
				            var MarkerIcon =
document.getElementById("Icon").value;
				            myMarker.attributes = {
				                name: tempname,
				                mstatus: MarkerStatus,
				                icon:
"../openlayers/img/fahrzeuge/" + MarkerIcon + ".png",
				                radius: 10
				            };
				            features.push(myMarker);
				            layer.addFeatures(features);
				        }
				    }

--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/modify-attribut-of-marker-tp6389089p6
389329.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list