File tree Expand file tree Collapse file tree 9 files changed +64
-18
lines changed Expand file tree Collapse file tree 9 files changed +64
-18
lines changed Original file line number Diff line number Diff line change @@ -10,16 +10,16 @@ import nav from './nav'
10
10
import sidebar from './sidebar'
11
11
12
12
export default defineConfig ( {
13
- title : ' ' ,
14
- description : 'coding-playground是一个vitepress的起始模板 ' ,
13
+ title : 'Coding Playground ' ,
14
+ description : 'Coding Playground 是一个代码案例集合库,用于存放各种实用的代码示例和最佳实践。 ' ,
15
15
base : '/coding-playground' ,
16
16
lastUpdated : true ,
17
17
head : [
18
18
[
19
19
'link' ,
20
20
{
21
21
rel : 'icon' ,
22
- href : './vue-icon .svg' ,
22
+ href : 'https://cn.vuejs.org/logo .svg' ,
23
23
} ,
24
24
] ,
25
25
[
@@ -31,7 +31,7 @@ export default defineConfig({
31
31
] ,
32
32
] ,
33
33
themeConfig : {
34
- logo : '/logo.svg' ,
34
+ // logo: '/logo.svg',
35
35
nav,
36
36
sidebar,
37
37
socialLinks : [ { icon : 'github' , link : 'https://github.com/coderhyh/coding-playground' } ] ,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export default <DefaultTheme.Sidebar>[
19
19
{ text : 'Mapbox入门' , link : '/packages/gis/mapbox/getting-started' } ,
20
20
{ text : '点击飞行效果' , link : '/packages/gis/mapbox/fly-to' } ,
21
21
{ text : '地球自转效果' , link : '/packages/gis/mapbox/rotation' } ,
22
+ { text : '添加图片' , link : '/packages/gis/mapbox/add-img' } ,
22
23
] ,
23
24
} ,
24
25
]
Original file line number Diff line number Diff line change 1
1
---
2
- title : coding-playground入手指南
3
- titleTemplate : vitepress的起始模板
2
+ title : Coding Playground
3
+ titleTemplate : coding-playground
4
4
---
5
5
6
- # coding-playground
6
+ # Coding Playground
7
7
8
- coding-playground是一个vitepress的起始模板
9
-
10
- ## ✨ 特性
11
-
12
- - 🏄🏼♂️ 结构简洁实用
8
+ 这是一个代码案例集合库,用于存放各种实用的代码示例和最佳实践。
Original file line number Diff line number Diff line change 19
19
"node" : " >=18.18.2"
20
20
},
21
21
"scripts" : {
22
- "build" : " npm run clean && vue-tsc --noEmit && vite build" ,
23
22
"lint" : " eslint packages/ --fix" ,
24
- "docs: dev" : " vitepress dev" ,
25
- "docs: build" : " vitepress build" ,
26
- "docs: preview" : " vitepress preview" ,
23
+ "dev" : " vitepress dev" ,
24
+ "build" : " vitepress build" ,
25
+ "preview" : " vitepress preview" ,
27
26
"postinstall" : " npx simple-git-hooks"
28
27
},
29
28
"dependencies" : {
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" h-500px" >
3
+ <div ref =" mapRef" class =" h-100% w-100%" />
4
+ </div >
5
+ </template >
6
+
7
+ <script setup lang="ts">
8
+ import mapboxgl from ' mapbox-gl'
9
+ import { MapboxEnum } from ' ~/enums/mapbox'
10
+
11
+ mapboxgl .accessToken = MapboxEnum .ACCESS_TOKEN
12
+ const mapRef = ref <HTMLDivElement >()
13
+ const map = ref <mapboxgl .Map >()
14
+
15
+ onMounted (() => {
16
+ map .value = new mapboxgl .Map ({
17
+ container: mapRef .value ! ,
18
+ style: ' mapbox://styles/mapbox/standard' ,
19
+ center: [120.153576 , 30.287459 ],
20
+ projection: ' globe' ,
21
+ zoom: 1 ,
22
+ })
23
+
24
+ map .value .on (' style.load' , () => {
25
+ map .value ?.addSource (' image' , {
26
+ type: ' image' ,
27
+ url: ' /coding-playground/avatar.jpg' ,
28
+ coordinates: [
29
+ [120.153576 , 30.287459 ],
30
+ [120.153576 + 10 , 30.287459 ],
31
+ [120.153576 + 10 , 30.287459 + 10 ],
32
+ [120.153576 , 30.287459 + 10 ],
33
+ ],
34
+ })
35
+
36
+ map .value ?.addLayer ({
37
+ id: ' image' ,
38
+ source: ' image' ,
39
+ type: ' raster' ,
40
+ })
41
+ })
42
+ })
43
+ </script >
Original file line number Diff line number Diff line change
1
+ # 添加图片
2
+
3
+ :::preview 说明 || Mapbox 添加图片
4
+
5
+ demo-preview=./demo.vue
6
+
7
+ :::
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" relative h-500px" >
3
- <div class =" absolute left-5px top-5px z-999 w200px" >
3
+ <div class =" absolute left-5px top-5px z-1 w200px" >
4
4
<el-button type =" primary" @click =" flyTo([121.5, 31.23])" >
5
5
To 上海
6
6
</el-button >
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" relative h-500px" >
3
- <div class =" absolute left-5px top-5px z-999 w200px" >
3
+ <div class =" absolute left-5px top-5px z-1 w200px" >
4
4
<el-select v-model =" mapStyle" placeholder =" Select Map Style" size =" small" @change =" changeMapStyle" >
5
5
<el-option label =" 标准" value =" standard" />
6
6
<el-option label =" 街道" value =" streets-v12" />
You can’t perform that action at this time.
0 commit comments