1

I'm using Leaflet with Esri.WorldShadedRelief. As far as I understand I need to set the Leaflet attribution as follows: 'Tiles © Esri — Source: Esri' How ever when I try to set it up, it doesn't change. I'm using AngularJS.

My Leaflet defaults:

defaults: {
    keyboard: false,
    dragging: false,
    worldCopyJump: false,
    doubleClickZoom: false,
    scrollWheelZoom: false,
    tap: false,
    touchZoom: false,
    zoomControl: false,
    zoomsliderControl: false,
    zoomControlPosition: 'topleft',
    attributionControl: true,
    attribution: 'Tiles © Esri — Source: Esri',
    controls: {
        layers: {
            visible: true,
            position: 'topright',
            collapsed: true,
        },
    }
},
tiles: {
    url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}'
}
Pasindu Weerakoon
  • 588
  • 1
  • 11
  • 39
Chen
  • 148
  • 1
  • 10

1 Answers1

2

You can use addAttribution to the map object via attributionControl:

map.attributionControl.addAttribution('Tiles © Esri — Source: Esri');

This will change it globally and not for a specific layer.

dougajmcdonald
  • 19,231
  • 12
  • 56
  • 89
  • I'm using Angularjs, I've no reference to the map. I tried to get a reference to the map with no success. – Chen Aug 25 '18 at 12:43