CP-999-02

Consumo recursos - LINEAS

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>

          <button type="button" onclick="desX()">deshacer</button>
    </div>
		
<div id="map"></div>

CSS

<style rel="stylesheet">
      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 carreteras = new M.layer.WFS({
  name: "Carreteras",
  url: "https://clientes.guadaltel.es/desarrollo/geossigc/wfs?",
  namespace: "mapea",
  name: "mapb_vc1_100",
  legend: "mapb_vc1_100",
  getfeatureinfo: "plain",
  geometry: 'LINE',
  extract: true,
});


mapajs.addLayers(carreteras);
carreteras.on(M.evt.LOAD, () => alert('carreteras cargados'));


// ///////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////
//
//cloropleth LINE

let stylesLine = [
    new M.style.Line({
    stroke: {
      color: 'cyan',
      width: 1
    },
    fill: {
      color: "black",
      width: 2
    }
  }),
  new M.style.Line({
    stroke: {
      color: '#337CEB',
      width: 3
    },
    fill: {
      color: "black",
      width: 2
    }
  }),
  new M.style.Line({
    stroke: {
      color: '#1f58ad',
      width: 5
    },
    fill: {
      color: "black",
      width: 2
    }
  }),
  new M.style.Line({
    stroke: {
      color: '#130668',
      width: 8
    },
    fill: {
      color: "black",
      width: 2
    }
  })
];

let choroplethl = new M.style.Choropleth("length", stylesLine, M.style.quantification.JENKS());


function choropleth() {
  let tiempo_ini = calculafecha();
  carreteras.setStyle(choroplethl);
  let tiempo_fin = calculafecha();
  calculadif(tiempo_ini, tiempo_fin);

}

//...