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'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?

share|improve this question
    
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
add comment

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

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

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