File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 6
6
<NuxtLink to =" /" >Home</NuxtLink >
7
7
</li >
8
8
<li >
9
- <NuxtLink to =" /map/search" >Map</NuxtLink >
9
+ <NuxtLink to =" /map/map" >Map</NuxtLink >
10
+ </li >
11
+ <li >
12
+ <NuxtLink to =" /map/geojson" >GeoJson</NuxtLink >
10
13
</li >
11
14
</ul >
12
15
</nav >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div style =" height :100vh ; width :100vw " >
3
+ <h1 >GeoJson Example</h1 >
4
+ <LMap
5
+ :zoom =" zoom"
6
+ :max-zoom =" 18"
7
+ :center =" [47.21322, -1.559482]"
8
+ >
9
+ <LTileLayer
10
+ url =" https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
11
+ attribution =" & ; copy; <a href=" ; https://www.openstreetmap.org/" ; >OpenStreetMap</a> contributors"
12
+ layer-type =" base"
13
+ name =" OpenStreetMap"
14
+ />
15
+ <LGeoJson
16
+ :geojson =" geojson"
17
+ :options-style =" geoStyler"
18
+ />
19
+ </LMap >
20
+ </div >
21
+ </template >
22
+
23
+ <script setup>
24
+ import { ref , onMounted } from ' vue'
25
+ const zoom = ref (6 )
26
+ const geojson = ref (undefined )
27
+ const geoStyler = (feature ) => ({
28
+ opacity: feature .properties .code / 100000 ,
29
+ })
30
+
31
+ onMounted (async () => {
32
+ const response = await fetch (
33
+ " https://rawgit.com/gregoiredavid/france-geojson/master/regions/pays-de-la-loire/communes-pays-de-la-loire.geojson"
34
+ );
35
+ geojson .value = await response .json ();
36
+ });
37
+ </script >
File renamed without changes.
You can’t perform that action at this time.
0 commit comments