AW: [OpenLayers-Users] modify attribut of marker

Arnd Wippermann arnd.wippermann at web.de
Sat May 21 07:57:48 EDT 2011


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: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von razibu
Gesendet: Samstag, 21. Mai 2011 11:43
An: users at openlayers.org
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
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list