AnsweredAssumed Answered

html, copyright in Attribution at 4.x

Question asked by bflessner on Apr 24, 2017
Latest reply on Apr 25, 2017 by bsvensson-esristaff

I'm attempting to use a 3rd party (Mapbox) basemap in 4.3 JavaScript API. I need to include copyright and links in the map attribution as per Mapbox's policy. I've included the html as a string in the layers copyright property, but the string is not 'translated' into html and instead shows the html as text.

  var basemap = new WebTileLayer({
    urlTemplate: "...",
    copyright: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="https://www.mapbox.com/map-feedback/">Mapbox</a>'
  });
  map.add(basemap);

Output:

screen capture of copyright shown as text, not html

 

The behavior can also be seen in this sample (click the attribution to see the Stamen copyright shown as text): ArcGIS API for JavaScript Sandbox 

 

This was valid in the 3.x API, how do I do this at 4.x?

Outcomes