iTowns Géoportail Ext : Attributions

utilisation de : itowns.control.Attributions

by Géoportail IGNF

HTML

<script src="https://github.com/iTowns/itowns/releases/download/v2.28.0/itowns.js"></script>
<script src="https://ignf.github.io/geoportal-extensions/itowns-latest/dist/GpPluginItowns.js"></script>
<link rel="stylesheet" href="https://ignf.github.io/geoportal-extensions/itowns-latest/dist/GpPluginItowns.css">
<body>
  <div id="viewerDiv">
    <button id="tiltButton">
      jsFiddle bug - click on this text to activate tilt (ctrl + left click)
      <br>
      Do not integrate this button to your own non-jsFiddle pages
    </button>
  </div>
  <div id="info"></div>
</body>

CSS

html {
  height: 100%;
}

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

#viewerDiv {
  margin: auto auto;
  width: 100%;
  height: 400px;
  padding: 0;
}

#tiltButton {
  background-color: white;
  position: absolute;
  top: 20px;
  left: 50px;
}

#info {
  padding: 5px;
  width: 100%;
  height: 20px;
  font-family: "monospace";
  font-size: 10px;
}

JavaScript

const positionOnGlobe = { longitude: 2.3465, latitude: 48.88, altitude: 25000000 };

// creates viewerDiv and iTowns globeView
const viewerDiv = document.getElementById('viewerDiv');
const globeView = new itowns.GlobeViewExtended(viewerDiv, positionOnGlobe);

            var config = {};
            config.source = new itowns.WMTSSource({
                "url": "https://wxs.ign.fr/decouverte/geoportail/wmts",
                "crs": "EPSG:3857",
                "networkOptions": {
                    "crossOrigin": "anonymous"
                },
                "format": "image/jpeg",
                "attribution": {
                    "name": "IGN",
                    "url": "http://www.ign.fr/"
                },
                "name": "ORTHOIMAGERY.ORTHOPHOTOS",
                "tileMatrixSet": "PM",
                "tileMatrixSetLimits": {
                    "2": {
                        "minTileRow": 0,
                        "maxTileRow": 4,
                        "minTileCol": 0,
                        "maxTileCol": 4
                    },
                    "3": {
                        "minTileRow": 0,
                        "maxTileRow": 8,
                        "minTileCol": 0,
                        "maxTileCol": 8
                    },
                    "4": {
                        "minTileRow": 0,
                        "maxTileRow": 16,
                        "minTileCol": 0,
                        "maxTileCol": 16
                    },
                    "5": {
                        "minTileRow": 0,
                        "maxTileRow": 32,
                        "minTileCol": 0,
                        "maxTileCol": 32
                    },
                    "6": {
                        "minTileRow": 1,
                        "maxTileRow": 64,
                        "minTileCol": 0,
                        "maxTileCol": 64
                    },
                    "7": {
                        "minTileRow": 3,
...