@swissgeo/coordinates 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/ol.cjs +1 -1
- package/dist/ol.d.ts +4 -3
- package/dist/ol.js +320 -320
- package/package.json +3 -3
- package/src/DevApp.vue +2 -1
- package/src/ol.ts +11 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swissgeo/coordinates",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Projection definition and coordinates utils for SWISSGEO projects.",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"type": "module",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"vitest": "^4.0.16",
|
|
39
39
|
"vue": "^3.5.26",
|
|
40
40
|
"vue-tsc": "^3.2.2",
|
|
41
|
-
"@swissgeo/config-
|
|
42
|
-
"@swissgeo/config-
|
|
41
|
+
"@swissgeo/config-eslint": "1.0.0",
|
|
42
|
+
"@swissgeo/config-typescript": "1.0.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"proj4": "^2.20.2"
|
package/src/DevApp.vue
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import OLTileLayer from 'ol/layer/Tile'
|
|
3
3
|
import OLMap from 'ol/Map'
|
|
4
4
|
import XYZ from 'ol/source/XYZ'
|
|
5
|
+
import proj4 from 'proj4'
|
|
5
6
|
import { onMounted } from 'vue'
|
|
6
7
|
|
|
7
8
|
import { getLV95TileGrid, getLV95View, registerSwissGeoProjections as registerOL } from '@/ol'
|
|
@@ -11,7 +12,7 @@ const pixelKarteFarbeURL = 'https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelka
|
|
|
11
12
|
|
|
12
13
|
function setupOpenLayers() {
|
|
13
14
|
|
|
14
|
-
registerOL()
|
|
15
|
+
registerOL(proj4)
|
|
15
16
|
|
|
16
17
|
const pixelKarteFarbe = new OLTileLayer({
|
|
17
18
|
source: new XYZ({
|
package/src/ol.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/** @module swissgeo/coordinates/ol */
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import { register } from "ol/proj/proj4";
|
|
5
|
-
import WMTSTileGrid from "ol/tilegrid/WMTS";
|
|
6
|
-
import proj4 from "proj4";
|
|
3
|
+
import type proj4 from 'proj4'
|
|
7
4
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
5
|
+
import { View } from 'ol'
|
|
6
|
+
import { register } from 'ol/proj/proj4'
|
|
7
|
+
import WMTSTileGrid from 'ol/tilegrid/WMTS'
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
import { LV95 } from '@/proj'
|
|
10
|
+
import { LV95_RESOLUTIONS } from '@/proj/SwissCoordinateSystem'
|
|
11
|
+
import registerProj4 from '@/registerProj4'
|
|
12
|
+
|
|
13
|
+
export function registerSwissGeoProjections(proj4Instance: typeof proj4) {
|
|
14
|
+
registerProj4(proj4Instance)
|
|
15
|
+
register(proj4Instance)
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
function indexOfMaxResolution(layerMaxResolution: number): number {
|