Skip to content

Commit c93e118

Browse files
FreakyBytesWykks
authored andcommitted
feat(controls): added input for customAttributions to attribution-control directive
1 parent 0a60463 commit c93e118

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

projects/ngx-mapbox-gl/src/lib/control/attribution-control.directive.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { ControlComponent } from './control.component';
99
export class AttributionControlDirective implements OnInit {
1010
/* Init inputs */
1111
@Input() compact?: boolean;
12+
@Input() customAttribution?: string | string[];
1213

1314
constructor(
1415
private MapService: MapService,
@@ -20,10 +21,13 @@ export class AttributionControlDirective implements OnInit {
2021
if (this.ControlComponent.control) {
2122
throw new Error('Another control is already set for this control');
2223
}
23-
const options: { compact?: boolean } = {};
24+
const options: { compact?: boolean, customAttribution?: string | string[] } = {};
2425
if (this.compact !== undefined) {
2526
options.compact = this.compact;
2627
}
28+
if (this.customAttribution !== undefined) {
29+
options.customAttribution = this.customAttribution;
30+
}
2731
this.ControlComponent.control = new AttributionControl(options);
2832
this.MapService.addControl(this.ControlComponent.control, this.ControlComponent.position);
2933
});

0 commit comments

Comments
 (0)