Control callback

This commit is contained in:
Fernando Blat 2017-06-17 16:16:49 +02:00
parent 1ac24f0a57
commit 47d28eb498

View file

@ -105,22 +105,22 @@ $.getJSON("data/zonas.geojson", function(zon_data){
else if (type == "C") fillColor = "#31a354"; else if (type == "C") fillColor = "#31a354";
else fillColor = "#f7f7f7"; //no data else fillColor = "#f7f7f7"; //no data
return { color: "#999", weight: 0, fillColor: fillColor, fillOpacity: .6}; return { color: "#999", weight: 0, fillColor: fillColor, fillOpacity: .6};
}, },
onEachFeature: function (feature, layer){ onEachFeature: function (feature, layer){
layer.bindPopup( "<strong> Nombre: " + feature.properties.Nombre + "</strong><br/>" + "<strong> Tipo: </strong>" + feature.properties.D_Tipo + "<br/>" + "<strong> Estado: </strong>" +feature.properties.D_Estado) layer.bindPopup( "<strong> Nombre: " + feature.properties.Nombre + "</strong><br/>" + "<strong> Tipo: </strong>" + feature.properties.D_Tipo + "<br/>" + "<strong> Estado: </strong>" +feature.properties.D_Estado)
} }
} ).addTo(mymap); }).addTo(mymap);
var legend = L.control({position: 'bottomright'});
legend.onAdd = function (mymap) {
var div = L.DomUtil.create('div', 'info legend');
div.innerHTML = "<i style='background: #e5f5e0'> </i>Poblados de Colonización <br> Colonias Penitenciarias <br> Embalses";
return div;
};
legend.addTo(mymap);
}); });
var legend = L.control({position: 'bottomright'});
legend.onAdd = function (mymap) {
var div = L.DomUtil.create('div', 'info legend');
div.innerHTML = "<i style='background: #e5f5e0'> </i>Poblados de Colonización <br> Colonias Penitenciarias <br> Embalses";
return div;
};
legend.addTo(mymap);
</script> </script>
</body> </body>