[Mapea5] Scale Map

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>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/1.4.0/chroma.min.js"></script>
<div id="map1"></div>

CSS

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

JavaScript

const mapajs1 = M.map({
   container: "map1",
   wmcfile: "callejero",
   controls: ["layerswitcher"]
 });


 const polygons = new M.layer.WFS({
   url: "http://geostematicos-sigc.juntadeandalucia.es/geoserver/tematicos/ows?",
   namespace: "tematicos",
   name: "Provincias",
   legend: "Provincias",
   geometry: 'MPOLYGON'
 });


 mapajs1.addLayers([polygons]);

 const style = new M.style.Polygon({
   fill: {
     color: 'white',
     opacity: (feature, mapamio) =>  {
     		return mapamio.getZoom() > 4 ? 1 : 0;
     }

   },
   stroke: {
     color: 'green',
   }
 });
 
 
 polygons.setStyle(style.serialize());