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) {


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?

  • d'you have problem with cursor when you on modify control? actually if you share some screenshot it will be very helpful. Good Luck :) – Aragon Dec 6 '12 at 14:19
  • If you modify a polygon, you select it and you get handles on each corner. These handles get the same style as I set for my points. I don't want that. openlayers.org/dev/examples/modify-feature.html If you look at this example. I mean the yellow circles. They change into the same style as i set for points. – Jeroen Dec 6 '12 at 14:47

Take a look in this posting: How to change the vertex style for editing?

You have to create separate style and render intent for handles ("vertex" in above example) and set it with vertexRenderIntent option of modify control.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.