let mapajs = M.map({
'container': 'map',
"controls": ["layerswitcher"],
"layer": ["OSM"]
});
let layer = new M.layer.GeoJSON({
name: "Municipios",
url: "https://clientes.guadaltel.es/desarrollo/geossigc/wfs?outputFormat=application/json&request=getfeature&typeNames=mapea:da_municipio_pol&version=1.3.0",
});
let layer2 = new M.layer.GeoJSON({
name: "Municipios2",
url: "https://clientes.guadaltel.es/desarrollo/geossigc/wfs?outputFormat=application/json&request=getfeature&typeNames=mapea:da_municipio_pol&version=1.3.0",
});
let layer3 = new M.layer.GeoJSON({
name: "Municipios3",
url: "https://clientes.guadaltel.es/desarrollo/geossigc/wfs?outputFormat=application/json&request=getfeature&typeNames=mapea:da_municipio_pol&version=1.3.0",
});
mapajs.addLayers([layer]);
layer2.setStyle(new M.style.Point({
fill: {
color: 'red'
},
radius: 5
}));
/**
* attribute: Parametro por el cual se calcula la proporcion en los features
* maxRadius: Parametro que define el radio maximo de la proporcion
* minRadius: Parametro que define el radio minimo de la proporcion
*/
let options = {
attribute: "gid",
maxRadius: 25,
minRadius: 8
};
layer.on(M.evt.LOAD, function() {
layer.getFeatures().forEach(f => f.setAttribute('porcentaje', Math.round(Math.random() * 100)));
layer.setStyle(choropleth);
layer.setStyle(new M.style.Proportional(options.attribute, options.minRadius, options.maxRadius));
});
let choropleth = new M.style.Choropleth("porcentaje", ["#0edfd0", "#ee440d"], () => [50, 80, 100]);
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.