Skip to content

Commit

Permalink
Fix types in misc
Browse files Browse the repository at this point in the history
Convert extended ol classes to es6 classes

Replace JQLite by JQuery
  • Loading branch information
sbrunner committed Jan 23, 2019
1 parent 184a346 commit a1841f6
Show file tree
Hide file tree
Showing 95 changed files with 5,346 additions and 5,808 deletions.
175 changes: 85 additions & 90 deletions contribs/gmf/apps/desktop/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import gmfControllersAbstractDesktopController from 'gmf/controllers/AbstractDes
import appBase from '../appmodule.js';
import EPSG2056 from '@geoblocks/proj/src/EPSG_2056.js';
import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
import {inherits as olUtilInherits} from 'ol/util.js';
import Raven from 'raven-js/src/raven.js';
import RavenPluginsAngular from 'raven-js/plugins/angular.js';

Expand All @@ -22,100 +21,96 @@ if (!window.requestAnimationFrame) {
window.location = 'http://geomapfish.org/';
}

/**
* @param {angular.IScope} $scope Scope.
* @param {angular.auto.IInjectorService} $injector Main injector.
* @constructor
* @extends {import("gmf/controllers/AbstractDesktopController.js").default}
* @ngInject
* @export
*/
function Controller($scope, $injector) {
gmfControllersAbstractDesktopController.call(this, {
srid: 21781,
mapViewConfig: {
center: [632464, 185457],
zoom: 3,
resolutions: [250, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.25, 0.1, 0.05]
}
}, $scope, $injector);

/**
* @type {Array.<string>}
* @export
*/
this.searchCoordinatesProjections = [EPSG21781, EPSG2056, 'EPSG:4326'];

/**
* @type {!Array.<number>}
* @export
*/
this.scaleSelectorValues = [250000, 100000, 50000, 20000, 10000, 5000, 2000, 1000, 500, 250, 100, 50];

/**
* @type {Array.<string>}
* @export
*/
this.elevationLayers = ['aster', 'srtm', 'srtm-partial'];

/**
* @type {Object.<string, import("gmf/raster/component.js").default.LayerConfig>}
* @export
*/
this.elevationLayersConfig = {};

/**
* @type {string}
* @export
*/
this.selectedElevationLayer = this.elevationLayers[0];

/**
* @type {Object.<string, ProfileLineConfiguration>}
* @export
*/
this.profileLinesconfiguration = {
'aster': {color: '#0000A0'},
'srtm': {color: '#00A000'},
'srtm-partial': {color: '#FF66FF'},
};

class Controller extends gmfControllersAbstractDesktopController {
/**
* @type {Array.<MousePositionProjection>}
* @export
* @param {angular.IScope} $scope Scope.
* @param {angular.auto.IInjectorService} $injector Main injector.
*/
this.mousePositionProjections = [{
code: EPSG2056,
label: 'CH1903+ / LV95',
filter: 'ngeoNumberCoordinates::{x}, {y} m'
}, {
code: EPSG21781,
label: 'CH1903 / LV03',
filter: 'ngeoNumberCoordinates::{x}, {y} m'
}, {
code: 'EPSG:4326',
label: 'WGS84',
filter: 'ngeoDMSCoordinates:2'
}];

// Allow angular-gettext-tools to collect the strings to translate
/** @type {angular.gettext.gettextCatalog} */
const gettextCatalog = $injector.get('gettextCatalog');
gettextCatalog.getString('Add a theme');
gettextCatalog.getString('Add a sub theme');
gettextCatalog.getString('Add a layer');

if ($injector.has('sentryUrl')) {
const options = $injector.has('sentryOptions') ? $injector.get('sentryOptions') : undefined;
const raven = new Raven();
raven.config($injector.get('sentryUrl'), options)
.addPlugin(RavenPluginsAngular)
.install();
constructor($scope, $injector) {
super({
srid: 21781,
mapViewConfig: {
center: [632464, 185457],
zoom: 3,
resolutions: [250, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.25, 0.1, 0.05]
}
}, $scope, $injector);

/**
* @type {Array.<string>}
* @export
*/
this.searchCoordinatesProjections = [EPSG21781, EPSG2056, 'EPSG:4326'];

/**
* @type {!Array.<number>}
* @export
*/
this.scaleSelectorValues = [250000, 100000, 50000, 20000, 10000, 5000, 2000, 1000, 500, 250, 100, 50];

/**
* @type {Array.<string>}
* @export
*/
this.elevationLayers = ['aster', 'srtm', 'srtm-partial'];

/**
* @type {Object.<string, import("gmf/raster/component.js").default.LayerConfig>}
* @export
*/
this.elevationLayersConfig = {};

/**
* @type {string}
* @export
*/
this.selectedElevationLayer = this.elevationLayers[0];

/**
* @type {Object.<string, ProfileLineConfiguration>}
* @export
*/
this.profileLinesconfiguration = {
'aster': {color: '#0000A0'},
'srtm': {color: '#00A000'},
'srtm-partial': {color: '#FF66FF'},
};

/**
* @type {Array.<MousePositionProjection>}
* @export
*/
this.mousePositionProjections = [{
code: EPSG2056,
label: 'CH1903+ / LV95',
filter: 'ngeoNumberCoordinates::{x}, {y} m'
}, {
code: EPSG21781,
label: 'CH1903 / LV03',
filter: 'ngeoNumberCoordinates::{x}, {y} m'
}, {
code: 'EPSG:4326',
label: 'WGS84',
filter: 'ngeoDMSCoordinates:2'
}];

// Allow angular-gettext-tools to collect the strings to translate
/** @type {angular.gettext.gettextCatalog} */
const gettextCatalog = $injector.get('gettextCatalog');
gettextCatalog.getString('Add a theme');
gettextCatalog.getString('Add a sub theme');
gettextCatalog.getString('Add a layer');

if ($injector.has('sentryUrl')) {
const options = $injector.has('sentryOptions') ? $injector.get('sentryOptions') : undefined;
const raven = new Raven();
raven.config($injector.get('sentryUrl'), options)
.addPlugin(RavenPluginsAngular)
.install();
}
}
}

olUtilInherits(Controller, gmfControllersAbstractDesktopController);

const module = angular.module('Appdesktop', [
appBase.name,
gmfControllersAbstractDesktopController.name,
Expand Down

0 comments on commit a1841f6

Please sign in to comment.