[OpenLayers-Users] WFS attributes at init()

Arnd Wippermann arnd.wippermann at web.de
Mon Jan 18 12:17:31 EST 2010


Hi,

Do you mean something like this?:

var WFSLayer = ...;
WFSLayer.events.on({
    "loadend": function() {
        var ftAttributes = WFSLayer.features[0].attributes;
        var Msg="";
        for(var key in ftAttributes)
            Msg += key + ":" + ftAttributes[key] + "\r\n";
        alert(Msg);    
    }
});
 

Arnd

-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von paweluz
Gesendet: Montag, 18. Januar 2010 14:09
An: users at openlayers.org
Betreff: [OpenLayers-Users] WFS attributes at init()


Hi!

I am able to get name of the attribute and the attribute by clicking on the
feature on map. I am trying to get only the name of the feature, and use
them in init(function), not only in method onFeatureSelect(feature) but also
in init(). Is there a way to get to them by using just the WFS_layer? Of
course I can just write the name of them like "id", "name"..... but I want
to get them always from the WFS feature, in case someone change something in
the database.  I found about one hundred pages about getting features and
presenting them on popup menu but I could not find anything about my
problem. Does anyone have an idea??

Regards,
Paul
--
View this message in context:
http://n2.nabble.com/WFS-attributes-at-init-tp4413521p4413521.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list