Hi,

you get access to the attributes by feature.attributes["name"]


function getAttribute(feature, key)
{
    return(feature.attributes[key]);
}

Example with editing attributes
http://gis.ibbeck.de/ginfo/apps/OLExamples/OL29/WFS_with_multiple_featureTyp
es.asp

Arnd 

-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von razibu
Gesendet: Samstag, 21. Mai 2011 11:43
An: [email protected]
Betreff: [OpenLayers-Users] modify attribut of marker

Hi, everbody.

How can i access a attribute of a marker? In this case "name" and "mstatus"?

Example:

var A8532 = new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Point(13.26911, 52.40355).transform(P4326, P900913));
                                A8532.attributes = {
                    name: "85/32",
                    mstatus: "0",
                    icon: "../openlayers/img/fahrzeuge/ktw.png",
                    radius: 20
                };

That's my marker. What i want to do is, read the "mstatus" into a html
field, replace the number by hand and then save it.

At the moment i have to write the hole name and status by myself everytime.

In use:
http://maps.pytalhost.de/starter/google.html

Code:
http://pastebin.ca/2066166


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

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to