From c93e1188ae58b25985e2d480e46d5ac95604ab24 Mon Sep 17 00:00:00 2001 From: Martin Peters Date: Fri, 21 Jun 2019 09:57:47 +0200 Subject: [PATCH] feat(controls): added input for customAttributions to attribution-control directive --- .../src/lib/control/attribution-control.directive.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/ngx-mapbox-gl/src/lib/control/attribution-control.directive.ts b/projects/ngx-mapbox-gl/src/lib/control/attribution-control.directive.ts index 865f50062..7f5780e53 100644 --- a/projects/ngx-mapbox-gl/src/lib/control/attribution-control.directive.ts +++ b/projects/ngx-mapbox-gl/src/lib/control/attribution-control.directive.ts @@ -9,6 +9,7 @@ import { ControlComponent } from './control.component'; export class AttributionControlDirective implements OnInit { /* Init inputs */ @Input() compact?: boolean; + @Input() customAttribution?: string | string[]; constructor( private MapService: MapService, @@ -20,10 +21,13 @@ export class AttributionControlDirective implements OnInit { if (this.ControlComponent.control) { throw new Error('Another control is already set for this control'); } - const options: { compact?: boolean } = {}; + const options: { compact?: boolean, customAttribution?: string | string[] } = {}; if (this.compact !== undefined) { options.compact = this.compact; } + if (this.customAttribution !== undefined) { + options.customAttribution = this.customAttribution; + } this.ControlComponent.control = new AttributionControl(options); this.MapService.addControl(this.ControlComponent.control, this.ControlComponent.position); });