Cadaster WMS

Cercalia add a WMS Spain Cadaster

Cadaster WMS

<!DOCTYPE html>
<html>
  <head>
    <title>Cadaster WMS</title>
    <script src="https://maps.cercalia.com/maps/loader.js?key=YOUR_API_KEY&v=5&lang=en&theme=1976d2"></script>
  </head>
  <body>
    <div id="map" class="map"></div>
    <script>
      var map;
      document.addEventListener('cercalia-ready', function() {
        map = new cercalia.Map({
          center: new cercalia.LonLat(2.1645563154039884,41.39186556882939),
          zoom: 16,
          target: 'map'
        });

        var wmsServers = [
          location.protocol + '//c1.cercalia.com/cgi-bin/mapserv?map=/usr/nexus/catastro/catastro.map',
          location.protocol + '//c2.cercalia.com/cgi-bin/mapserv?map=/usr/nexus/catastro/catastro.map',
          location.protocol + '//c4.cercalia.com/cgi-bin/mapserv?map=/usr/nexus/catastro/catastro.map',
          location.protocol + '//c6.cercalia.com/cgi-bin/mapserv?map=/usr/nexus/catastro/catastro.map'
        ];

        var projectionCode = map.getProjectionCode();
        var wmsParams = {
          'SERVICE': 'WMS',
          'VERSION': '1.1.1',
          'REQUEST': 'GetMap',
          'FORMAT': 'image/png',
          'LAYERS': 'default',
          'SRS': projectionCode,
          'PROJECTION': projectionCode,
          'WIDTH': '256',
          'HEIGHT': '256',
          'EXCEPTIONS': 'application/vnd.ogc.se_inimage'
        };

        var options = {};
        var wmsLayer = new cercalia.WMS('Cadaster', wmsServers, wmsParams, options);

        map.addLayer(wmsLayer);
      });
    </script>
  </body>
</html>