[OpenLayers-Users] Re: Feature Vector not showing the label attribute

pradeep.raj pradeep.raj at experionglobal.com
Sat Oct 15 02:35:08 EDT 2011


The issue has been resolved. It was not an issue with the feature vector.

It was an issue with the WKT format. I modified the method write in WKT.js
as follows.

write: function(features) {
        var collection, geometry, type, data, isCollection;
        if (features.constructor == Array) {
            collection = features;
            isCollection = true;
        } else {
            collection = [features];
            isCollection = false;
        }
        var pieces = [];
        if (isCollection) {
            pieces.push('GEOMETRYCOLLECTION(');
        }
        for (var i=0, len=collection.length; i<len; ++i) {
            if (isCollection && i>0) {
                pieces.push(',');
            }
            geometry = collection[i].geometry;
			*if (!geometry) {
				geometry = collection[i].feature.geometry;
			}*
            pieces.push(this.extractGeometry(geometry));
        }
        if (isCollection) {
            pieces.push(')');
        }
        return pieces.join('');
    },

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Feature-Vector-not-showing-the-label-attribute-tp6894655p6894875.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20111014/3916180c/attachment.html


More information about the Users mailing list