Skip to content

Commit 7590572

Browse files
committed
merge-in upstream wegue master
2 parents 08e5dee + f76a6b8 commit 7590572

36 files changed

+1817
-2173
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ node_js: stable
33
install:
44
- npm install
55
script:
6-
- npm run test
76
- npm run init:app
7+
- npm run test
88
- npm run build
99
after_success:
1010
- ./ci/update-gh-pages.sh > /dev/null 2>&1

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Prerequisites: Node.js and npm need to be available on your system.
3939
npm install
4040
```
4141

42-
- Run the init script, which creates a base application for your project in `app/WguApp.vue` and a CSS file `app/css/app.css` to place custom styling for your project.
42+
- Run the init-app script, which creates a base application (a copy of the `app-starter` dir) under `app/` to extend with custom components and resources (e.g. CSS styling) for your project.
4343

4444
``` bash
4545
# initializes the Wegue app
+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Ignore everything in this directory
2-
*
2+
#*
33
# Except this file
4-
!.gitignore
4+
#!.gitignore
5+

app-starter/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Wegue App Starter Dir
2+
This directory contains a Wegue starter app.
3+
By using the command `npm run init:app` this directory is copied to the `app/` directory.
4+
For now this copy will not overwrite files already present in the `app/` dir.
5+

app-starter/WguApp.vue

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!-- Created by init-app.js at Tue Mar 10 2020 16:02:41 GMT+0100 (GMT+01:00) -->
2+
<template>
3+
<wgu-app-tpl>
4+
<!-- insert your app slots here -->
5+
</wgu-app-tpl>
6+
</template>
7+
8+
<script>
9+
import WguAppTemplate from './WguAppTemplate.vue';
10+
export default {
11+
name: 'my-wgu-app',
12+
components: {
13+
'wgu-app-tpl': WguAppTemplate
14+
}
15+
// add Vue methods and hooks here
16+
}
17+
</script>

src/WguAppTemplate.vue app-starter/WguAppTemplate.vue

+7-7
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@
5454

5555
<script>
5656
import Vue from 'vue'
57-
import { WguEventBus } from './WguEventBus'
58-
import OlMap from './components/ol/Map'
57+
import { WguEventBus } from '../src/WguEventBus'
58+
import OlMap from '../src/components/ol/Map'
5959
import AppHeader from './components/AppHeader'
6060
import AppFooter from './components/AppFooter'
61-
import AppLogo from './components/AppLogo'
62-
import MeasureWin from './components/measuretool/MeasureWin'
63-
import LayerListWin from './components/layerlist/LayerListWin'
64-
import InfoClickWin from './components/infoclick/InfoClickWin'
65-
import MapLoadingStatus from './components/progress/MapLoadingStatus'
61+
import AppLogo from '../src/components/AppLogo'
62+
import MeasureWin from '../src/components/measuretool/MeasureWin'
63+
import LayerListWin from '../src/components/layerlist/LayerListWin'
64+
import InfoClickWin from '../src/components/infoclick/InfoClickWin'
65+
import MapLoadingStatus from '../src/components/progress/MapLoadingStatus'
6666
6767
export default {
6868
name: 'wgu-app-tpl',
File renamed without changes.

src/components/AppHeader.vue app-starter/components/AppHeader.vue

+7-7
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@
5454
<script>
5555
5656
import Vue from 'vue'
57-
import LayerListToggleButton from './layerlist/ToggleButton'
58-
import HelpWinToggleButton from './helpwin/ToggleButton'
59-
import MeasureToolToggleButton from './measuretool/ToggleButton'
60-
import InfoClickButton from './infoclick/ToggleButton'
61-
import ShareButton from './sharebutton/ShareButton'
62-
import ZoomToMaxExtentButton from './maxextentbutton/ZoomToMaxExtentButton'
63-
import Geocoder from './geocoder/Geocoder'
57+
import LayerListToggleButton from '../../src/components/layerlist/ToggleButton'
58+
import HelpWinToggleButton from '../../src/components/helpwin/ToggleButton'
59+
import MeasureToolToggleButton from '../../src/components/measuretool/ToggleButton'
60+
import InfoClickButton from '../../src/components/infoclick/ToggleButton'
61+
import ShareButton from '../../src/sharebutton/ShareButton'
62+
import ZoomToMaxExtentButton from '../../src/components/maxextentbutton/ZoomToMaxExtentButton'
63+
import Geocoder from '../../src/components/geocoder/Geocoder'
6464
6565
export default {
6666
name: 'wgu-app-header',
File renamed without changes.

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

+30-8
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@
2727
]
2828
],
2929

30-
"tileGridDefs": {
31-
"dutch_rd": {
32-
"extent": [-285401.920, 22598.080, 595401.920, 903401.920],
33-
"resolutions": [3440.640, 1720.320, 860.160, 430.080, 215.040, 107.520, 53.760, 26.880, 13.440, 6.720, 3.360, 1.680, 0.840, 0.420, 0.210],
34-
"tileSize": [256, 256]
35-
}
36-
},
37-
3830
"permalink": {
3931
"location": "search",
4032
"layers": true,
@@ -44,7 +36,37 @@
4436
"precision": 6
4537
},
4638

39+
"tileGridDefs": {
40+
"dutch_rd": {
41+
"extent": [-285401.920, 22598.080, 595401.920, 903401.920],
42+
"resolutions": [3440.640, 1720.320, 860.160, 430.080, 215.040, 107.520, 53.760, 26.880, 13.440, 6.720, 3.360, 1.680, 0.840, 0.420, 0.210],
43+
"tileSize": [256, 256]
44+
}
45+
},
46+
4747
"mapLayers": [
48+
{
49+
"type": "WFS",
50+
"lid": "dutch-nat-parks",
51+
"name": "WFS (Dutch National Parks PDOK)",
52+
"url": "https://geodata.nationaalgeoregister.nl/nationaleparken/wfs",
53+
"typeName": "nationaleparken:nationaleparken",
54+
"version": "2.0.0",
55+
"maxFeatures": 10,
56+
"formatConfig": {
57+
},
58+
"format": "GeoJSON",
59+
"projection": "EPSG:28992",
60+
"loadOnlyVisible": true,
61+
"visible": false,
62+
"selectable": true,
63+
"style": {
64+
"strokeColor": "white",
65+
"strokeWidth": 2,
66+
"fillColor": "rgba(155,153,51,0.5)"
67+
},
68+
"attributions": "<a href='https://www.pdok.nl' target='_blank'>PDOK</a> by Dutch Kadaster"
69+
},
4870
{
4971
"type": "WMS",
5072
"lid": "pdok-natura2000-wms",

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

+23
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,29 @@
4242
"fillColor": "rgba(155,153,51,0.5)"
4343
}
4444
},
45+
{
46+
"type": "WFS",
47+
"lid": "gas-wfs",
48+
"name": "Gas Stations WFS",
49+
"url": "https://ows.terrestris.de/geoserver/osm/wfs",
50+
"typeName": "osm:osm-fuel",
51+
"version": "2.0.0",
52+
"maxFeatures": 50,
53+
"formatConfig": {
54+
},
55+
"format": "GML3",
56+
"loadOnlyVisible": true,
57+
"visible": false,
58+
"selectable": true,
59+
"style": {
60+
"radius": 6,
61+
"strokeColor": "blue",
62+
"strokeWidth": 2,
63+
"fillColor": "rgba(155,153,51,0.5)"
64+
},
65+
"attributions": "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors."
66+
},
67+
4568
{
4669
"type": "VECTOR",
4770
"lid": "earthquakes",

app-starter/static/css/app.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* Created by init-app.js at Thu Aug 08 2019 15:59:47 GMT+0200 (GMT+02:00) */
File renamed without changes.

app/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Wegue App Dir
2+
This directory will contain your Wegue Application.
3+
By using the command `npm run init:app` this directory is populated with
4+
the contents from the `app-starter/` dir.
5+
6+
You can develop your Wegue app by modifying/adding files here, under the `app/` dir, for example:
7+
8+
* modifying the core `.vue` files like `app/WguApp.vue` and `app/WguAppTemplate.vue`
9+
* placing or modifying custom/app-specific components under `app/components`
10+
* placing or modifying static content like configuration, data, icons and css under `app/static`.
11+
12+
The default config file is `app/static/app-conf.json`.

build/dev-server.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,14 @@ app.use(devMiddleware)
6262
app.use(hotMiddleware)
6363

6464
// serve pure static assets
65-
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
66-
app.use(staticPath, express.static('./static'))
65+
// var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
66+
// app.use(staticPath, express.static('./static'))
67+
68+
console.log(config.dev.assetsPublicPath);
69+
// assetsSubDirectory: 'static',
70+
// assetsPublicPath: './',
71+
var staticPath2 = path.posix.join(config.dev.assetsPublicPath, 'static')
72+
app.use(staticPath2, express.static('./app/static'))
6773

6874
var uri = 'http://localhost:' + port
6975

build/utils.js

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ exports.cssLoaders = function (options) {
1616
loader: 'css-loader',
1717
options: {
1818
minimize: process.env.NODE_ENV === 'production',
19+
url: process.env.NODE_ENV !== 'production',
1920
sourceMap: options.sourceMap
2021
}
2122
}

build/webpack.base.conf.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ module.exports = {
2020
: config.dev.assetsPublicPath
2121
},
2222
resolve: {
23-
extensions: ['.js', '.vue', '.json'],
23+
extensions: ['*', '.js', '.vue', '.json'],
2424
alias: {
2525
'vue$': 'vue/dist/vue.esm.js',
2626
'@': resolve('src'),
27+
'APP': resolve('app'),
2728
},
2829
symlinks: false
2930
},
@@ -33,7 +34,7 @@ module.exports = {
3334
test: /\.(js|vue)$/,
3435
loader: 'eslint-loader',
3536
enforce: 'pre',
36-
include: [resolve('src'), resolve('test')],
37+
include: [resolve('app'), resolve('src'), resolve('test')],
3738
options: {
3839
formatter: require('eslint-friendly-formatter')
3940
}
@@ -46,7 +47,7 @@ module.exports = {
4647
{
4748
test: /\.js$/,
4849
loader: 'babel-loader',
49-
include: [resolve('src'), resolve('test'), resolve('node_modules/ol')],
50+
include: [resolve('app'), resolve('src'), resolve('test'), resolve('node_modules/ol')],
5051
},
5152
{
5253
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,

build/webpack.prod.conf.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,12 @@ var webpackConfig = merge(baseWebpackConfig, {
110110
}),
111111
// copy custom static assets
112112
new CopyWebpackPlugin([
113+
// copy project- / app-specific static assets, overwrite
113114
{
114-
from: path.resolve(__dirname, '../static'),
115+
from: path.resolve(__dirname, '../app/static'),
115116
to: config.build.assetsSubDirectory,
117+
force: true,
116118
ignore: ['.*']
117-
},
118-
// copy project- / app-specific static assets
119-
{
120-
context: path.resolve(__dirname, '../app/static'),
121-
from: "*",
122-
to: config.build.assetsSubDirectory
123119
}
124120
])
125121
]

0 commit comments

Comments
 (0)