CP-999-03

Consumo recursos - POLIGONOS

by SIGC

HTML

<script src="https://sigc.desarrollo.guadaltel.es/mapea5/js/mapea.ol.min.js"></script>
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea5/assets/css/mapea.ol.min.css">
<script src="https://sigc.desarrollo.guadaltel.es/mapea5/js/configuration.js"></script>
<div id="cloropleth" class="container">
  <button type="button" onclick="choropleth()">choropleth</button>
  <button type="button" onclick="desX()">deshacer</button>
</div>

<div id="categoryStyle" class="container">
  <button type="button" onclick="categoryStyle()">categoryStyle</button>
  <button type="button" onclick="desX()">deshacer</button>
</div>

<div id="Proportional" class="container">
  <button type="button" onclick="Proportional()">Proportional</button>
  <button type="button" onclick="desX()">deshacer</button>
</div>


<div id="map"></div>

CSS

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

JavaScript

var mapajs = M.map({
  'container': 'map',
  "controls": ["layerswitcher", "mouse", "scale", "overviewmap", "panzoombar", "scaleline", ],
  "getfeatureinfo": "plain"
});


var municipios = new M.layer.WFS({
  name: "Municipios",
  url: "https://clientes.guadaltel.es/desarrollo/geossigc/wfs?",
  namespace: "mapea",
  name: "da_municipio_pol",
  legend: "Municipios - CATEGORĂŤAS",
  geometry: 'POLYGON',
});

mapajs.addLayers(municipios);

municipios.on(M.evt.LOAD, () => alert('municipios cargados'));


// ///////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////


// //cloro polygons

let stylesPolygon = [
  new M.style.Polygon({
    fill: {
      color: 'cyan'
    },
    stroke: {
      color: 'cyan',
      width: 1
    }
  }),
  new M.style.Polygon({
    fill: {
      color: '#337CEB'
    },
    stroke: {
      color: '#337CEB',
      width: 1
    }
  }),
  new M.style.Polygon({
    fill: {
      color: '#1f58ad'
    },
    stroke: {
      color: '#1f58ad',
      width: 1
    }
  }),
  new M.style.Polygon({
    fill: {
      color: '#130668'
    },
    stroke: {
      color: '#130668',
      width: 1
    }
  })
];

let choroplethpol = new M.style.Choropleth("area", stylesPolygon, M.style.quantification.JENKS());

function choropleth() {
  let tiempo_ini = calculafecha();
  municipios.setStyle(choroplethpol);
  let tiempo_fin = calculafecha();
  calculadif(tiempo_ini, tiempo_fin);
}

//
// ///////////////////////////////////////////////////////////////////////////////////////
//...