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 am drawing vector lines, using GeoJSON, in my web application that uses Openlayers. I want the line to be displayed in yellow color with black border. I am using the following for the line styling:

my_layer = new OpenLayers.Layer.Vector("my_layer", {
            styleMap: new OpenLayers.StyleMap(new OpenLayers.Style({
                    fillColor: "#ffff00",
                    strokeWidth: 6,
                    strokeColor: "#000000"            
            }))
        });

But 'fillcolor' does not affect line symbology. How can I achieve that effect?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

You can't fill a line so you need to draw a thick black line and then a thin yellow line.

share|improve this answer
    
How can I add more than one style property to a single layer. Should it be 'Rule Based Styling'? –  thelastray Nov 23 '11 at 7:11
    
you need two layers or it won't work properly at the joins. –  iant Nov 23 '11 at 8:57
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.