Skip to main content
naming
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

I just made and Ajax callback that has three categories to simbolizesymbolize my geojsonGeoJSON. It works:

var geojson = new L.geoJson(data, { 
 style: function (feature) { 
      var c; 
       switch (feature.properties.dpv_cal) { 
        case 'Natural': 
        c = '#ffffff'; 
        break; 
        case 'Mejorada':
        c = '#db6adb'; 
        break; 
        case 'Pavimentada': 
        c = '#ff0127'; 
        break; 
        default: 
        c = 'grey'; 
       }
       return {color: c, opacity: 1, weight: 2}; 
   }
   }).addTo(map);

I just made and Ajax callback that has three categories to simbolize my geojson. It works:

var geojson = new L.geoJson(data, { 
 style: function (feature) { 
      var c; 
       switch (feature.properties.dpv_cal) { 
        case 'Natural': 
        c = '#ffffff'; 
        break; 
        case 'Mejorada':
        c = '#db6adb'; 
        break; 
        case 'Pavimentada': 
        c = '#ff0127'; 
        break; 
        default: 
        c = 'grey'; 
       }
       return {color: c, opacity: 1, weight: 2}; 
   }
   }).addTo(map);

I just made and Ajax callback that has three categories to symbolize my GeoJSON. It works:

var geojson = new L.geoJson(data, { 
 style: function (feature) { 
      var c; 
       switch (feature.properties.dpv_cal) { 
        case 'Natural': 
        c = '#ffffff'; 
        break; 
        case 'Mejorada':
        c = '#db6adb'; 
        break; 
        case 'Pavimentada': 
        c = '#ff0127'; 
        break; 
        default: 
        c = 'grey'; 
       }
       return {color: c, opacity: 1, weight: 2}; 
   }
   }).addTo(map);
added 10 characters in body
Source Link

I just made and Ajax callback that has three categories to simbolize my geojson. It works:

var geojson = new L.geoJson(data, { 
 style: function (feature) { 
      var c; 
       switch (feature.properties.dpv_cal) { 
        case 'Natural': 
        c = '#ffffff'; 
        break; 
        case 'Mejorada':
        c = '#db6adb'; 
        break; 
        case 'Pavimentada': 
        c = '#ff0127'; 
        break; 
        default: 
        c = 'grey'; 
       }
       return {color: c, opacity: 1, weight: 2}; 
   }
   }).addTo(map);

I just made and Ajax callback that has three categories to simbolize my geojson:

var geojson = new L.geoJson(data, { 
 style: function (feature) { 
      var c; 
       switch (feature.properties.dpv_cal) { 
        case 'Natural': 
        c = '#ffffff'; 
        break; 
        case 'Mejorada':
        c = '#db6adb'; 
        break; 
        case 'Pavimentada': 
        c = '#ff0127'; 
        break; 
        default: 
        c = 'grey'; 
       }
       return {color: c, opacity: 1, weight: 2}; 
   }
   }).addTo(map);

I just made and Ajax callback that has three categories to simbolize my geojson. It works:

var geojson = new L.geoJson(data, { 
 style: function (feature) { 
      var c; 
       switch (feature.properties.dpv_cal) { 
        case 'Natural': 
        c = '#ffffff'; 
        break; 
        case 'Mejorada':
        c = '#db6adb'; 
        break; 
        case 'Pavimentada': 
        c = '#ff0127'; 
        break; 
        default: 
        c = 'grey'; 
       }
       return {color: c, opacity: 1, weight: 2}; 
   }
   }).addTo(map);
Source Link

I just made and Ajax callback that has three categories to simbolize my geojson:

var geojson = new L.geoJson(data, { 
 style: function (feature) { 
      var c; 
       switch (feature.properties.dpv_cal) { 
        case 'Natural': 
        c = '#ffffff'; 
        break; 
        case 'Mejorada':
        c = '#db6adb'; 
        break; 
        case 'Pavimentada': 
        c = '#ff0127'; 
        break; 
        default: 
        c = 'grey'; 
       }
       return {color: c, opacity: 1, weight: 2}; 
   }
   }).addTo(map);