arcgislink/src/arcgislink.js
function setCopyrightInfo_(map) {
  var div = null;
  if (map) {
    var mvc = map.controls[G.ControlPosition.BOTTOM_RIGHT];
    if (mvc) {
      for (var i = 0, c = mvc.getLength(); i < c; i++) {
        if (mvc.getAt(i).id === 'agsCopyrights') {
          div = mvc.getAt(i);
          break;
        }
      }
    }
    //var callback = callback_(setCopyrightInfo_, null, map);
    if (!div) {
      div = document.createElement('div');
      div.style.fontFamily = 'Arial,sans-serif';
      div.style.fontSize = '10px';
      div.style.textAlign = 'right';
      div.id = 'agsCopyrights';
      map.controls[G.ControlPosition.BOTTOM_RIGHT].push(div);
      G.event.addListener(map, 'maptypeid_changed', function() {
        setCopyrightInfo_(map);
      });
    }
    var ovs = map.agsOverlays;
    var cp = [];
    var svc, type;
    if (ovs) {
      for (var i = 0, c = ovs.getLength(); i < c; i++) {
        addCopyrightInfo_(cp, ovs.getAt(i).mapService_, map);
      }
    }
    var ovTypes = map.overlayMapTypes;
    if (ovTypes) {
      for (var i = 0, c = ovTypes.getLength(); i < c; i++) {
        type = ovTypes.getAt(i);
        if (type instanceof MapType) {
          for (var j = 0, cj = type.tileLayers_.length; j < cj; j++) {
            addCopyrightInfo_(cp, type.tileLayers_[j].mapService_, map);
          }
        }
      }
    }
    type = map.mapTypes.get(map.getMapTypeId());
    if (type instanceof MapType) {
      for (var i = 0, c = type.tileLayers_.length; i < c; i++) {
        addCopyrightInfo_(cp, type.tileLayers_[i].mapService_, map);
      }
      if (type.negative) {
        div.style.color = '#ffffff';
      } else {
        div.style.color = '#000000';
      }
    }
    div.innerHTML = cp.join('<br/>');
  }
}
function setCopyrightInfo_(map) {
  var div = null;
  if (map) {
    var mvc = map.controls[G.ControlPosition.BOTTOM_RIGHT];
    if (mvc) {
      for (var i = 0, c = mvc.getLength(); i < c; i++) {
        if (mvc.getAt(i).id === 'agsCopyrights') {
          div = mvc.getAt(i);
          break;
        }
      }
    }
    //var callback = callback_(setCopyrightInfo_, null, map);
    if (!div) {
      div = document.createElement('div');
      div.style.fontFamily = 'Arial,sans-serif';
      div.style.fontSize = '10px';
      div.style.textAlign = 'right';
      div.id = 'agsCopyrights';
      map.controls[G.ControlPosition.BOTTOM_RIGHT].push(div);
      G.event.addListener(map, 'maptypeid_changed', function() {
        setCopyrightInfo_(map);
      });
    }
    var ovs = map.agsOverlays;
    var cp = [];
    var svc, type;
    if (ovs) {
      for (var i = 0, c = ovs.getLength(); i < c; i++) {
        addCopyrightInfo_(cp, ovs.getAt(i).mapService_, map);
      }
    }
    var ovTypes = map.overlayMapTypes;
    if (ovTypes) {
      for (var i = 0, c = ovTypes.getLength(); i < c; i++) {
        type = ovTypes.getAt(i);
        if (type instanceof MapType) {
          for (var j = 0, cj = type.tileLayers_.length; j < cj; j++) {
            addCopyrightInfo_(cp, type.tileLayers_[j].mapService_, map);
          }
        }
      }
    }
    type = map.mapTypes.get(map.getMapTypeId());
    if (type instanceof MapType) {
      for (var i = 0, c = type.tileLayers_.length; i < c; i++) {
        addCopyrightInfo_(cp, type.tileLayers_[i].mapService_, map);
      }
      if (type.negative) {
        div.style.color = '#ffffff';
      } else {
        div.style.color = '#000000';
      }
    }
    div.innerHTML = cp.join('<br/>');
  }
}
function setCopyrightInfo_ ( map ) { var div = null ; if ( map ) { var mvc = map . controls [ G . ControlPosition . BOTTOM_RIGHT ] ; if ( mvc ) { for ( var i = 0 , c = mvc . getLength ( ) ; i < c ; i ++ ) { if ( mvc . getAt ( i ) . id === 'agsCopyrights' ) { div = mvc . getAt ( i ) ; break ; } } } //var callback = callback_(setCopyrightInfo_, null, map);
 if ( ! div ) { div = document . createElement ( 'div' ) ; div . style . fontFamily = 'Arial,sans-serif' ; div . style . fontSize = '10px' ; div . style . textAlign = 'right' ; div . id = 'agsCopyrights' ; map . controls [ G . ControlPosition . BOTTOM_RIGHT ] . push ( div ) ; G . event . addListener ( map , 'maptypeid_changed' , function ( ) { setCopyrightInfo_ ( map ) ; } ) ; } var ovs = map . agsOverlays ; var cp = [ ] ; var svc , type ; if ( ovs ) { for ( var i = 0 , c = ovs . getLength ( ) ; i < c ; i ++ ) { addCopyrightInfo_ ( cp , ovs . getAt ( i ) . mapService_ , map ) ; } } var ovTypes = map . overlayMapTypes ; if ( ovTypes ) { for ( var i = 0 , c = ovTypes . getLength ( ) ; i < c ; i ++ ) { type = ovTypes . getAt ( i ) ; if ( type instanceof MapType ) { for ( var j = 0 , cj = type . tileLayers_ . length ; j < cj ; j ++ ) { addCopyrightInfo_ ( cp , type . tileLayers_ [ j ] . mapService_ , map ) ; } } } } type = map . mapTypes . get ( map . getMapTypeId ( ) ) ; if ( type instanceof MapType ) { for ( var i = 0 , c = type . tileLayers_ . length ; i < c ; i ++ ) { addCopyrightInfo_ ( cp , type . tileLayers_ [ i ] . mapService_ , map ) ; } if ( type . negative ) { div . style . color = '#ffffff' ; } else { div . style . color = '#000000' ; } } div . innerHTML = cp . join ( '<br/>' ) ; } }
Find copyright control in the map
@param {Object} map
Find copyright control in the map