Symbolizing Layer based on other Layer

I am using GeoDjango and Openlayers API.

I wanted to style the points(vector layer, MultiPoint Field) depending on the vector layer’s color.

Like on this image for exampleenter image description here

If it is within the vector layer, it should be yellow.

This is how I style my vector layer map:

  var context = {
      getColour: function (feature) {
          var hazardtype = feature.attributes.hazard;
          if (hazardtype == 'Low') {
              var color = '#FFFF00';
              return color;
          } else if (hazardtype == 'Medium') {
              var color = '#FFA500';
              return color;
          } else {
              var color = '#ff0000';
              return color;
          }

      }
  };

  var context_label = {
      getName: function (feature) {
          return feature.attributes["name"];
      }
  };

var style = new OpenLayers.Style(template, {context: context});
var styleMap = new OpenLayers.StyleMap({'default': style});


Download symbolizing.layer.based.on.other.layer.zip
Direct Link


Download


Download symbolizing.layer.based.on.other.layer.zip
Mediafire


Download


Download symbolizing.layer.based.on.other.layer.zip
Filedropper


Download

Both comments and pings are currently closed.

Comments are closed.