How to use the esri-leaflet.Util._getAttributionData function in esri-leaflet

To help you get started, we’ve selected a few esri-leaflet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Esri / esri-leaflet-vector / src / Layer.js View on Github external
_asyncAdd: function () {
    var map = this._map;
    if (map.attributionControl) {
      if (this._customTileset) {
        if (this._copyrightText) {
          // pull static copyright text for services published with Pro
          map.attributionControl.addAttribution('<span class="esri-dynamic-attribution">' + this._copyrightText + '</span>');
        }
      } else {
        // provide dynamic attribution for Esri basemaps
        Util._getAttributionData('https://static.arcgis.com/attribution/World_Street_Map', map);
        map.attributionControl.addAttribution('<span class="esri-dynamic-attribution">USGS, NOAA</span>');
        map.on('moveend', Util._updateMapAttribution);
      }
    }

    // set the background color of the map to the background color of the tiles
    map.getContainer().style.background = this._mapboxGL.options.style.layers[0].paint['background-color'];
    this._mapboxGL.addTo(map, this);
  }
});
github Esri / esri-leaflet-vector / src / Basemap.js View on Github external
onAdd: function (map) {
    this._map = map;
    Util.setEsriAttribution(map);

    if (map.attributionControl) {
      if (this._basemap === 'OpenStreetMap') {
        map.attributionControl.setPrefix('<a title="A JS library for interactive maps" href="http://leafletjs.com">Leaflet</a>');
        map.attributionControl.addAttribution('<span class="esri-dynamic-attribution">© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, map layer by Esri</span>');
      } else {
        Util._getAttributionData('https://static.arcgis.com/attribution/World_Street_Map', map);
        map.attributionControl.addAttribution('<span class="esri-dynamic-attribution">USGS, NOAA</span>');
      }
    }

    if (this._ready) {
      this._asyncAdd();
    } else {
      this.once('ready', function () {
        this._asyncAdd();
      }, this);
    }
  },