Closed sgrillon14 closed 6 years ago
The ngx-leaflet plugin doesn't affect this. You should look at Leaflet itself for this. But, I wouldn't be surprised if they don't allow you to get rid of it.
This is what I do:
ngOnInit() {
this.options = {
layers: [
tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution:
'My attribution <a href="http://test.com" target="_blank">My Link</a>'
})
],
zoom: 5,
center: latLng(46.879966, -121.726909),
attributionControl: false
};
}
onMapReady(map: Map) {
this.map = map;
this.map.addControl(
control.attribution({
position: 'bottomright',
prefix: ''
})
);
}
This solution ready, thanks @alexgoldstone
(leafletMapReady)="onMapReady($event);"
[leafletOptions]="options"
import { Layer, tileLayer, Map, control } from 'leaflet';
...
options: any = {};
constructor() {
this.options['attributionControl'] = false;
}
...
onMapReady(map: Map) {
map.addControl(
control.attribution({
position: 'bottomright',
prefix: ''
})
);
}
Put the following code:
document.getElementsByClassName( 'leaflet-control-attribution' )[0].style.fontSize = '0px';
hello , any suggestion to do the same in R environment? thank you
Official docs:
http://leafletjs.com/reference-1.0.0.html#map-attributioncontrol