[OpenLayers-Users] Layer.features.lenght

Tondo gpktondo at gmail.com
Tue Sep 4 12:46:02 PDT 2012


Hi

I add features to empty vector layer:

var _drawFeatures = function (i, h) {
//i = some input, if not null adds content, h = handler eg. point, path,
polygon
    if (_vector.features.length >= 1) {
        _vector.removeAllFeatures({ silent: true });
        _vector.redraw();
    }
    if (i != null) {
        _vector.addFeatures(i);
    } else {
        _modifyCtrl.deactivate();
        _drawCtrl.handler = new OpenLayers.Handler[h](_drawCtrl,
_drawCtrl.callbacks, _drawCtrl.handlerOptions);
        _drawCtrl.activate();
    }
};

_vector.events.on(
    {
        featureadded: function (feature) {
            _drawCtrl.deactivate();
            _modifyCtrl.activate();
            _modifyCtrl.selectFeature(feature);
        }
    }
);

If I add point, _vector.features.lenght = 1, if area with 3 verticies,
_vector.features is an array of 7 features, one area, six points... Is this
OK?

Thanks,
Tom



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Layer-features-lenght-tp4999770.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list