Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm having problems adding and moving features on a clustered (wfs) layer. When I add a new feature all the clustered ones disappear from view. Plus much hacking needed to actually save the new feature. Bit of code:

    map = new OpenLayers.Map('map', {
        projection: "EPSG:900913",
        displayProjection: "EPSG:4326",
});
var base = new OpenLayers.Layer.OSM();

filterStrategy = new OpenLayers.Strategy.Filter();

cluster = new OpenLayers.Strategy.Cluster();

protocol = new OpenLayers.Protocol.WFS({
    version: "1.1.0",
    url: "/geoserver/test/wfs",
    featurePrefix: "test",
    featureNS :  "test",
    featureType: "XXXX",
    geometryName: 'geom',
});

wfs = new OpenLayers.Layer.Vector("Vector", {
    projection: "EPSG:4326",
    strategies: [ 
        new OpenLayers.Strategy.Fixed(),
        filterStrategy,
        cluster
    ],
    protocol: protocol,
});

map.addLayers([ base, wfs ]);

drawControl = new OpenLayers.Control.DrawFeature(
    wfs,  OpenLayers.Handler.Point,                  
    { 
         featureAdded: featureAdded,
    }
);

map.addControl( drawControl );

function featureAdded(feature) {
    alert("feature added!");
}

I have similar problems if I want to move a feature.

Any help appreciated

Mini

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.