Commit accd98676f2e836c3193637ca0d8f038ad466492
Committed by
GitHub
Merge pull request #2929 from vvlladd28/improvement/map/google
Clear constructor Google map
Showing
2 changed files
with
3 additions
and
3 deletions
@@ -68,7 +68,7 @@ export class MapWidgetController implements MapWidgetInterface { | @@ -68,7 +68,7 @@ export class MapWidgetController implements MapWidgetInterface { | ||
68 | return; | 68 | return; |
69 | } | 69 | } |
70 | parseWithTranslation.setTranslate(this.translate); | 70 | parseWithTranslation.setTranslate(this.translate); |
71 | - this.map = new MapClass(this.ctx, $element, this.settings, this.ctx.$injector); | 71 | + this.map = new MapClass(this.ctx, $element, this.settings); |
72 | this.map.saveMarkerLocation = this.setMarkerLocation; | 72 | this.map.saveMarkerLocation = this.setMarkerLocation; |
73 | if (this.settings.draggableMarker) { | 73 | if (this.settings.draggableMarker) { |
74 | this.map.setDataSources(parseData(this.data)); | 74 | this.map.setDataSources(parseData(this.data)); |
@@ -32,9 +32,9 @@ interface GmGlobal { | @@ -32,9 +32,9 @@ interface GmGlobal { | ||
32 | export class GoogleMap extends LeafletMap { | 32 | export class GoogleMap extends LeafletMap { |
33 | private resource: ResourcesService; | 33 | private resource: ResourcesService; |
34 | 34 | ||
35 | - constructor(ctx: WidgetContext, $container, options: UnitedMapSettings, private injector: Injector) { | 35 | + constructor(ctx: WidgetContext, $container, options: UnitedMapSettings) { |
36 | super(ctx, $container, options); | 36 | super(ctx, $container, options); |
37 | - this.resource = injector.get(ResourcesService); | 37 | + this.resource = ctx.$injector.get(ResourcesService); |
38 | this.loadGoogle(() => { | 38 | this.loadGoogle(() => { |
39 | const map = L.map($container, {attributionControl: false}).setView(options?.defaultCenterPosition, options?.defaultZoomLevel); | 39 | const map = L.map($container, {attributionControl: false}).setView(options?.defaultCenterPosition, options?.defaultZoomLevel); |
40 | (L.gridLayer as any).googleMutant({ | 40 | (L.gridLayer as any).googleMutant({ |