@swissgeo/coordinates 1.0.0 → 1.0.2
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 +10 -3
- package/dist/{registerProj4-BuUOcPpF.cjs → index-D7Gdk-1d.cjs} +6 -6
- package/dist/{registerProj4-CwR_kPOz.js → index-DZ4q3KlK.js} +1932 -1987
- package/dist/index.cjs +5 -5
- package/dist/index.js +605 -551
- package/dist/ol.cjs +1 -1
- package/dist/ol.d.ts +2 -4
- package/dist/ol.js +480 -3988
- package/package.json +1 -1
- package/src/DevApp.vue +10 -3
- package/src/ol.ts +7 -14
package/README.md
CHANGED
|
@@ -85,18 +85,25 @@ const center = extentUtils.getExtentCenter(extentLV95)
|
|
|
85
85
|
The package provides specialized helpers for OpenLayers in `@swissgeo/coordinates/ol`.
|
|
86
86
|
|
|
87
87
|
```typescript
|
|
88
|
-
import {
|
|
88
|
+
import { getLV95ViewConfig, getLV95TileGrid, registerProj4, registerSwissGeoProjections } from '@swissgeo/coordinates/ol'
|
|
89
89
|
import TileLayer from 'ol/layer/Tile'
|
|
90
90
|
import Map from 'ol/Map'
|
|
91
|
+
import View from 'ol/View'
|
|
91
92
|
import XYZ from 'ol/source/XYZ'
|
|
93
|
+
import { register } from 'ol/proj/proj4'
|
|
94
|
+
import proj4 from 'proj4'
|
|
92
95
|
|
|
93
96
|
// 1. Register projections in proj4 and OpenLayers
|
|
94
|
-
|
|
97
|
+
registerProj4(proj4);
|
|
98
|
+
register(proj4);
|
|
95
99
|
|
|
96
100
|
// 2. Use helpers to create View and TileGrid
|
|
97
101
|
const map = new Map({
|
|
98
102
|
target: 'map',
|
|
99
|
-
view:
|
|
103
|
+
view: new View({
|
|
104
|
+
...getLV95ViewConfig(),
|
|
105
|
+
// any other view configuration
|
|
106
|
+
}),
|
|
100
107
|
layers: [
|
|
101
108
|
new TileLayer({
|
|
102
109
|
source: new XYZ({
|