I've a vector layer with a bunch of draw controls on it. You can add polygons, points and you can modify polygon.
Now I changed the style of the points so they have a nice pin-like image. But them I noticed when I select the modify polygon tool and select a polygon, the handles on the polygon are also replaced by my point-image. How do I fix that?
this.panel = new OpenLayers.Control.Panel({
allowDepress: true,
autoActivate: false
});
this.controls = {
"polygon": new OpenLayers.Control.DrawFeature(this.layer, OpenLayers.Handler.Polygon, {
"title": "New Zone"
}),
"POI": new OpenLayers.Control.DrawFeature(this.layer, OpenLayers.Handler.Point, {
"title": "New POI",
"displayClass": "olControlDrawPoi"
}),
"modify": new OpenLayers.Control.ModifyFeature(this.layer, {
"standalone": false,
"title": "Edit Zone"
}),
"clear": new OpenLayers.Control.Button({
displayClass: "olControlClearLayer",
trigger: myLocations.clearLayer,
title: "Clearlayer"
})
};
for (key in this.controls) {
this.panel.addControls(this.controls[key]);
}
myMap.map.addControl(this.panel);
I tried adding the style in the Point Handler but that has no effect. I also tried to set a feature property so I can use a symbolizer in the style, but i can't figure out how to add this property before the feature is actually drawn. (so this works, but only after a layer.redraw().
So I want to have defautl styling for the polygons and its handels when its in modify mode, but I do want a nice marker image for my newly drawn points.
Any ideas?