Skip to content

Commit 6afc79d

Browse files
committed
Add states and cors support for development needs
1 parent a9f50c5 commit 6afc79d

File tree

8 files changed

+68
-14
lines changed

8 files changed

+68
-14
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
<mapml-viewer projection="CBMTILE" zoom="2" lat="45" lon="-90" controls>
7676
<map-caption>A pleasing map of Canada</map-caption>
7777
<layer- label="CBMT" src="https://geogratis.gc.ca/mapml/en/cbmtile/cbmt/" checked></layer->
78+
<layer- label="remote states" src="../test/e2e/data/states/states.default.mapml" checked></layer->
7879
</mapml-viewer>
7980
</body>
8081
</html>

package-lock.json

Lines changed: 32 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"jest": "jest --verbose --noStackTrace"
3737
},
3838
"devDependencies": {
39+
"@playwright/test": "^1.24.2",
3940
"diff": "^5.1.0",
4041
"express": "^4.17.1",
4142
"grunt": "^1.4.0",
@@ -54,7 +55,6 @@
5455
"jest-playwright-preset": "^1.7.0",
5556
"leaflet": "^1.9.3",
5657
"path": "^0.12.7",
57-
"@playwright/test": "^1.24.2",
5858
"playwright": "^1.24.2",
5959
"proj4": "^2.6.2",
6060
"proj4leaflet": "^1.0.2",
@@ -63,5 +63,8 @@
6363
"files": [
6464
"dist",
6565
"*.md"
66-
]
66+
],
67+
"dependencies": {
68+
"cors": "^2.8.5"
69+
}
6770
}

test/e2e/data/states/states.cbmtile.mapml

Lines changed: 8 additions & 0 deletions
Large diffs are not rendered by default.

test/e2e/data/states/states.default.mapml

Lines changed: 9 additions & 0 deletions
Large diffs are not rendered by default.

test/e2e/data/states/states.osmtile.mapml

Lines changed: 9 additions & 0 deletions
Large diffs are not rendered by default.

test/e2e/data/states/states.wgs84.mapml

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

test/server.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ const path = require("path");
44
const port = 30001;
55

66
//then loads in the index file
7+
const cors = require('cors');
8+
app.use(cors());
9+
express.static.mime.define({'text/mapml': ['mapml']});
710
app.use(express.static(path.join(__dirname, "../dist")));
811
app.use(express.static(path.join(__dirname, "e2e/core")));
912
app.use(express.static(path.join(__dirname, "e2e/api")));

0 commit comments

Comments
 (0)