Style Category

by solcursomapea

HTML

<link rel="stylesheet" href="https://mapea4-sigc.juntadeandalucia.es/assets/css/mapea.ol.min.css">
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/js/mapea.ol.min.js"></script>
<script src="https://mapea4-sigc.juntadeandalucia.es/js/configuration.js"></script>
<div id="map">
</div>

CSS

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

JavaScript

var map = M.map({
      'container': 'map',
      "controls": ["layerswitcher"],
      layers: ["OSM"]
    });


    let centros = new M.layer.WFS({
      name: "Centros ASSDA",
      url: "https://clientes.guadaltel.es/desarrollo/geossigc/wfs?",
      namespace: "mapea",
      name: "centrosassda",
      getfeatureinfo: "plain",
      geometry: 'POINT',
    });
    map.addLayers(centros);
    let style = new M.style.Category("tipologia", {
      "CENTRO RESIDENCIAL": new M.style.Point({
        fill: {
          color: "red"
        },
        radius: 10
      }),
      "CENTRO DE DÍA": new M.style.Point({
        fill: {
          color: "black",
        },
        radius: 12
      }),
      "other": new M.style.Point({
      	fill: {
        	color: "blue"
        },
        radius: 8
      })
    });
    centros.setStyle(style);