Skip to main content
added 261 characters in body
Source Link
Cliff
  • 129
  • 1
  • 11

I need to hatch polygons (loaded from a GeoJSON) in a leaflet webmap. Until now I have this:

//Style of each polygon
function style(feature){
    return {
        opacity : 1,
        color: 'black',
        fillOpacity: 0.7,
        fillColor: getColorCode(feature.properties.Status)};
    }

My problem is that I have the fillColor as background color and the hatched color should be grey. Since the fillColor is a property, I am not sure how to inject the hatched color. By this I mean something like this:

enter image description here

The difference is however that I have for example a yellow fillColor and that on top of that the "hatched color" should be blue.

I need to hatch polygons (loaded from a GeoJSON) in a leaflet webmap. Until now I have this:

//Style of each polygon
function style(feature){
    return {
        opacity : 1,
        color: 'black',
        fillOpacity: 0.7,
        fillColor: getColorCode(feature.properties.Status)};
    }

My problem is that I have the fillColor as background color and the hatched color should be grey. Since the fillColor is a property, I am not sure how to inject the hatched color.

I need to hatch polygons (loaded from a GeoJSON) in a leaflet webmap. Until now I have this:

//Style of each polygon
function style(feature){
    return {
        opacity : 1,
        color: 'black',
        fillOpacity: 0.7,
        fillColor: getColorCode(feature.properties.Status)};
    }

My problem is that I have the fillColor as background color and the hatched color should be grey. Since the fillColor is a property, I am not sure how to inject the hatched color. By this I mean something like this:

enter image description here

The difference is however that I have for example a yellow fillColor and that on top of that the "hatched color" should be blue.

Source Link
Cliff
  • 129
  • 1
  • 11

Hatch polygons in Leaflet

I need to hatch polygons (loaded from a GeoJSON) in a leaflet webmap. Until now I have this:

//Style of each polygon
function style(feature){
    return {
        opacity : 1,
        color: 'black',
        fillOpacity: 0.7,
        fillColor: getColorCode(feature.properties.Status)};
    }

My problem is that I have the fillColor as background color and the hatched color should be grey. Since the fillColor is a property, I am not sure how to inject the hatched color.