File tree Expand file tree Collapse file tree 2 files changed +46
-29
lines changed Expand file tree Collapse file tree 2 files changed +46
-29
lines changed Original file line number Diff line number Diff line change @@ -10,19 +10,38 @@ Here is a basic example of how to use the `LMap` and `LTileLayer` components to
10
10
11
11
``` vue
12
12
<template>
13
- <div style="height:100vh; width:100vw">
14
- <LMap
15
- ref="map"
16
- :zoom="6"
17
- :center="[47.21322, -1.559482]"
18
- >
19
- <LTileLayer
20
- url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
21
- attribution="&copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors"
22
- layer-type="base"
23
- name="OpenStreetMap"
24
- />
25
- </LMap>
26
- </div>
13
+ <LMap
14
+ style="height: 350px"
15
+ :zoom="6"
16
+ :center="[47.21322, -1.559482]"
17
+ >
18
+ <LTileLayer
19
+ url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
20
+ attribution="&copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors"
21
+ layer-type="base"
22
+ name="OpenStreetMap"
23
+ />
24
+ </LMap>
27
25
</template>
28
26
```
27
+
28
+ And here is how it should look :
29
+
30
+ <script setup >
31
+ import " leaflet/dist/leaflet.css" ;
32
+ import { LMap , LTileLayer } from " @vue-leaflet/vue-leaflet" ;
33
+ import { onMounted } from ' vue' ;
34
+
35
+ onMounted (() => {
36
+ import (' leaflet' )
37
+ })
38
+ </script >
39
+
40
+ <LMap style =" height : 350px " :zoom =" 6 " :center =" [47.21322, -1.559482] " >
41
+ <LTileLayer
42
+ url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
43
+ attribution="& ; copy; <a href=" ; https://www.openstreetmap.org/">OpenStreetMap </a > contributors"
44
+ layer-type="base"
45
+ name="OpenStreetMap"
46
+ />
47
+ </LMap >
Original file line number Diff line number Diff line change @@ -5,22 +5,20 @@ You might want to access the Leaflet global variable in your Vue component. This
5
5
The L variable is auto-imported by the module, so you can access it directly in your Vue component as shown below.
6
6
7
7
8
- ``` vue{21-23 }
8
+ ``` vue{19-21 }
9
9
<template>
10
- <div style="height:100vh; width:100vw">
11
- <LMap
12
- :zoom="6"
13
- :max-zoom="18"
14
- :center="[47.21322, -1.559482]"
15
- >
16
- <LTileLayer
17
- url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
18
- attribution="&copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors"
19
- layer-type="base"
20
- name="OpenStreetMap"
21
- />
22
- </LMap>
23
- </div>
10
+ <LMap
11
+ :zoom="6"
12
+ :max-zoom="18"
13
+ :center="[47.21322, -1.559482]"
14
+ >
15
+ <LTileLayer
16
+ url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
17
+ attribution="&copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors"
18
+ layer-type="base"
19
+ name="OpenStreetMap"
20
+ />
21
+ </LMap>
24
22
</template>
25
23
26
24
<script setup>
You can’t perform that action at this time.
0 commit comments