Skip to content

Commit

Permalink
Use projection 2056 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Sep 9, 2019
1 parent 90a995b commit 2333981
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 25 deletions.
4 changes: 2 additions & 2 deletions api/src/constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
import EPSG2056 from '@geoblocks/proj/src/EPSG_2056.js';


/**
Expand All @@ -17,7 +17,7 @@ export default /** @type {APIConfig} */({
themesUrl: 'https://www.example.com',

// The projection of the map
projection: EPSG21781,
projection: EPSG2056,

// The resolutions list.
resolutions: [250, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.25, 0.1, 0.05],
Expand Down
6 changes: 3 additions & 3 deletions contribs/gmf/apps/desktop/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ class Controller extends AbstractDesktopController {
*/
constructor($scope, $injector) {
super({
srid: 21781,
srid: 2056,
mapViewConfig: {
center: [632464, 185457],
center: [2632464, 1185457],
zoom: 3,
resolutions: [250, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.25, 0.1, 0.05],
constrainResolution: true,
extent: [485071.54, 75346.36, 828515.78, 299941.84],
extent: [2485071.54, 175346.36, 2828515.78, 1299941.84],
}
}, $scope, $injector);

Expand Down
8 changes: 8 additions & 0 deletions contribs/gmf/apps/desktop/contextualdata.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<table>
<tr>
<td translate>
Swiss grid (LV95)
</td>
<td>
{{coord_2056|ngeoNumberCoordinates:0:'{x} / {y}'}}
</td>
</tr>
<tr>
<td translate>
Swiss grid (LV03)
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/apps/desktop/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
gmf-contextualdata=""
gmf-contextualdata-displayed="mainCtrl.contextdataActive"
gmf-contextualdata-map="::mainCtrl.map"
gmf-contextualdata-projections="::[21781, 4326]"
gmf-contextualdata-projections="::[2056, 21781, 4326]"
ngeo-map-query=""
ngeo-map-query-map="::mainCtrl.map"
ngeo-map-query-active="mainCtrl.queryActive"
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/apps/desktop_alt/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ class Controller extends AbstractDesktopController {
*/
constructor($scope, $injector) {
super({
srid: 21781,
srid: 2056,
mapViewConfig: {
center: [632464, 185457],
center: [2632464, 1185457],
zoom: 3,
resolutions: [250, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.25, 0.1, 0.05],
constrainResolution: true,
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/apps/iframe_api/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class Controller extends AbstractAPIController {
*/
constructor($scope, $injector) {
super({
srid: 21781,
srid: 2056,
mapViewConfig: {
center: [632464, 185457],
center: [2632464, 1185457],
zoom: 3,
resolutions: [250, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.25, 0.1, 0.05]
}
Expand Down
8 changes: 8 additions & 0 deletions contribs/gmf/apps/iframe_api/contextualdata.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<table>
<tr>
<td translate>
Swiss grid (LV95)
</td>
<td>
{{coord_2056|ngeoNumberCoordinates:0:'{x} / {y}'}}
</td>
</tr>
<tr>
<td translate>
Swiss grid (LV03)
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/apps/mobile/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class Controller extends AbstractMobileController {
constructor($scope, $injector) {
super({
autorotate: false,
srid: 21781,
srid: 2056,
mapViewConfig: {
center: [632464, 185457],
center: [2632464, 1185457],
zoom: 3,
resolutions: [250, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.25, 0.1, 0.05]
}
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/apps/mobile_alt/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class Controller extends AbstractMobileController {
super({
autorotate: true,
mapPixelRatio: 1,
srid: 21781,
srid: 2056,
mapViewConfig: {
center: [632464, 185457],
center: [2632464, 1185457],
zoom: 3,
resolutions: [250, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.25, 0.1, 0.05]
}
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/apps/oeedit/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class Controller extends AbstractDesktopController {
*/
constructor($scope, $injector, $timeout) {
super({
srid: 21781,
srid: 2056,
mapViewConfig: {
center: [632464, 185457],
center: [2632464, 1185457],
zoom: 3,
resolutions: [250, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.25, 0.1, 0.05]
}
Expand Down
8 changes: 8 additions & 0 deletions contribs/gmf/apps/oeedit/contextualdata.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<table>
<tr>
<td translate>
Swiss grid (LV95)
</td>
<td>
{{coord_2056|ngeoNumberCoordinates:0:'{x} / {y}'}}
</td>
</tr>
<tr>
<td translate>
Swiss grid (LV03)
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/apps/oeedit/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
gmf-contextualdata=""
gmf-contextualdata-displayed="mainCtrl.contextdataActive"
gmf-contextualdata-map="::mainCtrl.map"
gmf-contextualdata-projections="::[21781, 4326]"
gmf-contextualdata-projections="::[2056, 21781, 4326]"
ngeo-map-query=""
ngeo-map-query-map="::mainCtrl.map"
ngeo-map-query-active="mainCtrl.queryActive"
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/contextualdata/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const module = angular.module('gmfContextualdata', [
* <gmf-map gmf-map-map="mainCtrl.map"
* gmf-contextualdata
* gmf-contextualdata-map="::mainCtrl.map"
* gmf-contextualdata-projections="::[21781,4326]">
* gmf-contextualdata-projections="::[2056,21781,4326]">
*
* The content of the popover is managed in a partial that must be defined
* using the `gmfContextualdatacontentTemplateUrl` value. See
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/controllers/AbstractAPIController.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class AbstractAPIController extends AbstractAppController {
*/
constructor(config, $scope, $injector) {
const viewConfig = {
projection: olProj.get(`EPSG:${config.srid || 21781}`)
projection: olProj.get(`EPSG:${config.srid || 2056}`)
};
Object.assign(viewConfig, config.mapViewConfig || {});

Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/controllers/AbstractAppController.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export function AbstractAppController(config, map, $scope, $injector) {
groupValues: /** @type {string[]} **/ ($injector.get('gmfSearchGroups')),
groupActions: /** @type {Array<import('gmf/search/component.js').gmfSearchAction>} **/(
$injector.get('gmfSearchActions')),
projection: `EPSG:${config.srid || 21781}`,
projection: `EPSG:${config.srid || 2056}`,
url: /** @type {string} **/ ($injector.get('fulltextsearchUrl'))
}];

Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/controllers/AbstractMobileController.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class AbstractMobileController extends AbstractAppController {
*/
constructor(config, $scope, $injector) {
const viewConfig = {
projection: olProj.get(`EPSG:${config.srid || 21781}`)
projection: olProj.get(`EPSG:${config.srid || 2056}`)
};
Object.assign(viewConfig, config.mapViewConfig || {});

Expand Down
1 change: 1 addition & 0 deletions src/search/createGeoJSONBloodhound.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ module.value('ngeoSearchCreateGeoJSONBloodhound', createGeoJSONBloodhound);
* '',
* undefined,
* ol.proj.get('EPSG:3857'),
* ol.proj.get('EPSG:2056'),
* ol.proj.get('EPSG:21781'),
* {
* remote: {
Expand Down
8 changes: 4 additions & 4 deletions src/source/AsitVD.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const asitVDResolutions = [
* @hidden
*/
const asitVDTileGrid = new olTilegridWMTS({
extent: [420000, 30000, 900000, 350000],
extent: [2420000, 130000, 2900000, 1350000],
resolutions: asitVDResolutions,
matrixIds: asitVDResolutions.map((value, index) => `${index}`)
});
Expand All @@ -46,12 +46,12 @@ export default class extends olSourceWMTS {
super({
attributions: 'géodonnées &copy; Etat de Vaud & &copy; contributeurs OpenStreetMap',
url: 'https://ows{1-4}.asitvd.ch/wmts/1.0.0/{Layer}/default/default/0/' +
'21781/{TileMatrix}/{TileRow}/{TileCol}.png',
projection: 'EPSG:21781',
'2056/{TileMatrix}/{TileRow}/{TileCol}.png',
projection: 'EPSG:2056',
requestEncoding: 'REST',
layer: options.layer,
style: 'default',
matrixSet: '21781',
matrixSet: '2056',
format: 'image/png',
tileGrid: asitVDTileGrid
});
Expand Down

0 comments on commit 2333981

Please sign in to comment.