Skip to content

Commit ff4ae43

Browse files
committed
fix: build error
1 parent c16de1f commit ff4ae43

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

docs/examples/image-27770.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Display an image with a custom defined projection (e.g., EPSG:27770).
1515
<meta name="viewport" content="width=device-width, initial-scale=1" />
1616
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" />
1717
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
18+
<script src="https://unpkg.com/proj4/dist/proj4.js"></script>
1819
<script src="https://unpkg.com/@naivemap/maplibre-gl-image-layer"></script>
1920
<style>
2021
* {
@@ -31,6 +32,13 @@ Display an image with a custom defined projection (e.g., EPSG:27770).
3132
<body>
3233
<div id="map"></div>
3334
<script>
35+
proj4.defs(
36+
'EPSG:27700',
37+
'+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
38+
'+x_0=400000 +y_0=-100000 +ellps=airy ' +
39+
'+towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 ' +
40+
'+units=m +no_defs'
41+
)
3442
const map = new maplibregl.Map({
3543
container: 'map',
3644
style: 'https://www.naivemap.com/demotiles/style.json',
@@ -43,15 +51,8 @@ Display an image with a custom defined projection (e.g., EPSG:27770).
4351
}
4452
})
4553
map.on('load', () => {
46-
proj4.defs(
47-
'EPSG:27700',
48-
'+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
49-
'+x_0=400000 +y_0=-100000 +ellps=airy ' +
50-
'+towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 ' +
51-
'+units=m +no_defs'
52-
)
53-
const layer4326 = new ImageLayer('image-layer', {
54-
url: 'https://www.naivemap.com/mapbox-gl-js-cookbook/assets/images/4326.png',
54+
const layer = new ImageLayer('image-layer', {
55+
url: './images/2000px-British_National_Grid.png',
5556
projection: 'EPSG:27700',
5657
coordinates: [
5758
[0, 1300000], // top-left
@@ -61,7 +62,7 @@ Display an image with a custom defined projection (e.g., EPSG:27770).
6162
]
6263
})
6364
64-
map.addLayer(layer4326)
65+
map.addLayer(layer)
6566
})
6667
</script>
6768
</body>

docs/examples/image.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Display an image with a custom projection (e.g., EPSG:4326).
4444
})
4545
map.on('load', () => {
4646
const layer4326 = new ImageLayer('image-layer', {
47-
url: 'https://www.naivemap.com/mapbox-gl-js-cookbook/assets/images/4326.png',
47+
url: './images/Terrain_CQ.png',
4848
projection: 'EPSG:4326',
4949
coordinates: [
5050
[105.289838, 32.204171], // top-left

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"typedoc": "pnpm -r typedocs",
2020
"gen-docs-example": "node ./scripts/gen-docs-example.js",
2121
"docs:example": "pnpm gen-docs-example",
22-
"docs:dev": "pnpm build && concurrently \"pnpm typedoc\" \"vitepress dev docs\"",
22+
"docs:dev": "pnpm build && concurrently \"pnpm typedoc --watch\" \"vitepress dev docs\"",
2323
"docs:build": "pnpm build && pnpm typedoc && pnpm docs:example && vitepress build docs",
2424
"docs:preview": "vitepress preview docs",
2525
"test": "vitest",

packages/maplibre-gl-echarts-layer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"scripts": {
3131
"build": "vite build",
32-
"typedocs": "pnpm typedoc --watch"
32+
"typedocs": "pnpm typedoc"
3333
},
3434
"peerDependencies": {
3535
"echarts": "^5.0.0",

packages/maplibre-gl-image-layer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"scripts": {
3131
"build": "vite build",
32-
"typedocs": "pnpm typedoc --watch"
32+
"typedocs": "pnpm typedoc"
3333
},
3434
"peerDependencies": {
3535
"proj4": "^2.8.0",

0 commit comments

Comments
 (0)