Browse Source

Merge pull request #2929 from vvlladd28/improvement/map/google

Clear constructor Google map
pull/3930/head
Igor Kulikov 6 years ago
committed by GitHub
parent
commit
accd98676f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget2.ts
  2. 4
      ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/google-map.ts

2
ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget2.ts

@ -68,7 +68,7 @@ export class MapWidgetController implements MapWidgetInterface {
return; return;
} }
parseWithTranslation.setTranslate(this.translate); parseWithTranslation.setTranslate(this.translate);
this.map = new MapClass(this.ctx, $element, this.settings, this.ctx.$injector); this.map = new MapClass(this.ctx, $element, this.settings);
this.map.saveMarkerLocation = this.setMarkerLocation; this.map.saveMarkerLocation = this.setMarkerLocation;
if (this.settings.draggableMarker) { if (this.settings.draggableMarker) {
this.map.setDataSources(parseData(this.data)); this.map.setDataSources(parseData(this.data));

4
ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/google-map.ts

@ -32,9 +32,9 @@ interface GmGlobal {
export class GoogleMap extends LeafletMap { export class GoogleMap extends LeafletMap {
private resource: ResourcesService; private resource: ResourcesService;
constructor(ctx: WidgetContext, $container, options: UnitedMapSettings, private injector: Injector) { constructor(ctx: WidgetContext, $container, options: UnitedMapSettings) {
super(ctx, $container, options); super(ctx, $container, options);
this.resource = injector.get(ResourcesService); this.resource = ctx.$injector.get(ResourcesService);
this.loadGoogle(() => { this.loadGoogle(() => {
const map = L.map($container, {attributionControl: false}).setView(options?.defaultCenterPosition, options?.defaultZoomLevel); const map = L.map($container, {attributionControl: false}).setView(options?.defaultCenterPosition, options?.defaultZoomLevel);
(L.gridLayer as any).googleMutant({ (L.gridLayer as any).googleMutant({

Loading…
Cancel
Save