Skip to content

Commit 7147cb1

Browse files
authored
Merge pull request #454 from fschmenger/fix_typo_DragDop
Fix typo drag dop
2 parents 9d4d3b0 + 7d76f73 commit 7147cb1

7 files changed

Lines changed: 22 additions & 12 deletions

File tree

app-starter/public/static/app-conf-sidebar.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
"mapZoom": 2,
2424
"mapCenter": [0, 0],
25-
"mapGeodataDragDop": {
26-
"formats": ["GeoJSON", "KML"],
25+
"mapGeodataDragDrop": {
26+
"formats": ["GeoJSON","KML"],
2727
"zoomToData": true,
2828
"replaceData": true,
2929
"displayInLayerList": true

app-starter/public/static/app-conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
"mapZoom": 2,
2424
"mapCenter": [0, 0],
25-
"mapGeodataDragDop": {
25+
"mapGeodataDragDrop": {
2626
"formats": ["GeoJSON", "KML"],
2727
"zoomToData": true,
2828
"replaceData": true,

docs/wegue-configuration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This describes the Wegue application configuration, which is modelled as JSON do
1818
| **mapZoom** | Initial zoom level of the map | `"mapZoom": 2` |
1919
| **mapCenter** | Initial center of the map in map projection | `"mapCenter": [0, 0]` |
2020
| mapProjection | Configuration object for CRS / projection used for the map | see [mapProjection](wegue-configuration?id=mapprojection) |
21-
| mapGeodataDragDop | Configuration object for geodata file drag/drop functionality on the map. Only by setting the config this function will be enabled. | see [mapGeodataDragDop](wegue-configuration?id=mapGeodataDragDop) |
21+
| mapGeodataDragDrop | Configuration object for geodata file drag/drop functionality on the map. Only by setting the config this function will be enabled. | see [mapGeodataDragDrop](wegue-configuration?id=mapGeodataDragDrop) |
2222
| mapHover | Configuration object containing application wide parameters for hover tooltips on the map. | see [mapHover](wegue-configuration?id=mapHover)
2323
| **modules** | Array of module configuration objects | See [modules](module-configuration) |
2424
| **mapLayers** | Array of map layer configuration objects | See [mapLayers](map-layer-configuration) |
@@ -207,9 +207,9 @@ In a Layer configuration a specific tilegrid can be refered to as follows, using
207207
}
208208
```
209209

210-
### mapGeodataDragDop
210+
### mapGeodataDragDrop
211211

212-
Setting the property `mapGeodataDragDop` in the main Wegue configuration will enable geodata file drag/drop functionality on the map.
212+
Setting the property `mapGeodataDragDrop` in the main Wegue configuration will enable geodata file drag/drop functionality on the map.
213213

214214
The following configurations can be set:
215215

@@ -440,7 +440,7 @@ Example configurations can be found in the `app-starter/static` directory. Below
440440

441441
"mapZoom": 2,
442442
"mapCenter": [0, 0],
443-
"mapGeodataDragDop": {
443+
"mapGeodataDragDrop": {
444444
"formats": ["GeoJSON", "KML"],
445445
"zoomToData": true,
446446
"replaceData": true,

src/components/ol/Map.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default {
4444
tileGridDefs: this.$appConfig.tileGridDefs || {},
4545
tileGrids: {},
4646
permalink: this.$appConfig.permalink,
47-
mapGeodataDragDop: this.$appConfig.mapGeodataDragDop,
47+
mapGeodataDragDrop: this.$appConfig.mapGeodataDragDrop,
4848
// mapping format string to OL module / class
4949
formatMapping: {
5050
GPX,
@@ -130,7 +130,7 @@ export default {
130130
});
131131
132132
// add geodata drag-drop support according to config
133-
if (this.mapGeodataDragDop) {
133+
if (this.mapGeodataDragDrop) {
134134
const dragAndDropInteraction = this.setupGeodataDragDrop();
135135
interactions.push(dragAndDropInteraction);
136136
}
@@ -301,7 +301,7 @@ export default {
301301
* features in a vector layer
302302
*/
303303
setupGeodataDragDrop () {
304-
const mapDdConf = this.mapGeodataDragDop;
304+
const mapDdConf = this.mapGeodataDragDrop;
305305
const formats = mapDdConf.formats.filter(formatStr => {
306306
return this.formatMapping[formatStr];
307307
}).map(fs => {

src/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const migrateAppConfig = function (appConfig) {
112112
'browserTitle': 'app.browserTitle',
113113
'footerTextLeft': 'app.footerTextLeft',
114114
'footerTextRight': 'app.footerTextRight',
115-
'mapGeodataDragDop\\.layerName': 'mapLayers.wgu-drag-drop-layer.name',
115+
'mapGeodataDragDrop\\.layerName': 'mapLayers.wgu-drag-drop-layer.name',
116116
'modules.\\.wgu-attributetable\\.selectorLabel': 'wgu-attributetable.selectorLabel',
117117
'modules\\.wgu-geocoder\\.placeHolder': 'wgu-geocoder.placeHolder',
118118
'modules\\.wgu-infoclick\\.mediaInfoLinkText': 'wgu-infoclick.mediaInfoLinkText',
@@ -193,6 +193,12 @@ const migrateAppConfig = function (appConfig) {
193193
}
194194
};
195195

196+
// Warning for deprecated mapGeodataDragDop.
197+
if (appConfig.mapGeodataDragDop) {
198+
console.warn('The configuration path ".mapGeodataDragDop" is deprecated, ' +
199+
'instead declare a path ".mapGeodataDragDrop"');
200+
}
201+
196202
return appConfig;
197203
}
198204

tests/unit/specs/components/ol/Map.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('ol/Map.vue', () => {
7676
expect(vm.tileGridDefs).to.be.empty;
7777
expect(vm.tileGrids).to.be.empty;
7878
expect(vm.permalink).to.be.undefined;
79-
expect(vm.mapGeodataDragDop).to.be.undefined;
79+
expect(vm.mapGeodataDragDrop).to.be.undefined;
8080
expect(vm.dragDropLayerCreated).to.be.false;
8181
expect(vm.formatMapping).to.be.an('object');
8282
expect(Object.keys(vm.formatMapping)).to.have.lengthOf(5);

upgrade-notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ Even if you used the stock configuration files, as some linting rules were added
125125
The majority of those can be fixed automatically by running the `npm run lint:fix` command.
126126
If you want to momentarily bypass some advanced errors to test your upgraded app or want to adapt linting rules to better suit your preferences, you can modify the `eslint.config.js` file as needed.
127127

128+
### Other Changes
129+
130+
`mapGeodataDragDop` property of the main `Wegue` application configuration was renamed `mapGeodataDragDrop`. Please update your configuration files accordingly.
131+
128132
## v1 -> v2
129133

130134
### Vue-CLI

0 commit comments

Comments
 (0)