Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_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);
}
});
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);
}
},