Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

Your Answer


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.