1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/frontend/app/ui/settings/map/map.settings.component.ts
2019-07-20 19:52:47 +02:00

49 lines
1.7 KiB
TypeScript

import {Component} from '@angular/core';
import {MapSettingsService} from './map.settings.service';
import {SettingsComponent} from '../_abstract/abstract.settings.component';
import {AuthenticationService} from '../../../model/network/authentication.service';
import {NavigationService} from '../../../model/navigation.service';
import {NotificationService} from '../../../model/notification.service';
import {ClientConfig} from '../../../../../common/config/public/ConfigClass';
import {I18n} from '@ngx-translate/i18n-polyfill';
import {Utils} from '../../../../../common/Utils';
@Component({
selector: 'app-settings-map',
templateUrl: './map.settings.component.html',
styleUrls: ['./map.settings.component.css',
'./../_abstract/abstract.settings.component.css'],
providers: [MapSettingsService],
})
export class MapSettingsComponent extends SettingsComponent<ClientConfig.MapConfig> {
public mapProviders: { key: number, value: string }[] = [];
public MapProviders = ClientConfig.MapProviders;
constructor(_authService: AuthenticationService,
_navigation: NavigationService,
_settingsService: MapSettingsService,
notification: NotificationService,
i18n: I18n) {
super(i18n('Map'), _authService, _navigation, <any>_settingsService, notification, i18n, s => s.Client.Map);
this.mapProviders = Utils.enumToArray(ClientConfig.MapProviders);
}
addNewLayer() {
this.settings.customLayers.push({
name: 'Layer-' + this.settings.customLayers.length,
url: ''
});
}
removeLayer(layer: ClientConfig.MapLayers) {
this.settings.customLayers.splice(this.settings.customLayers.indexOf(layer), 1);
}
}