File tree Expand file tree Collapse file tree 9 files changed +30
-28
lines changed Expand file tree Collapse file tree 9 files changed +30
-28
lines changed Original file line number Diff line number Diff line change 1+ <script setup>
2+ defineProps ({
3+ name: {
4+ type: String ,
5+ required: true ,
6+ },
7+ isCodeView: {
8+ type: Boolean ,
9+ default: true ,
10+ },
11+ })
12+ </script >
13+
114<template >
215 <div class =" code-view-wrapper" >
316 <component :is =" `map-${name}`" ></component >
4- <a v-if =" isCodeView" class =" link" :href =" $withBase(`/example/${name}.html`)" target =" _blank"
5- >查看代码</a
6- >
17+ <a v-if =" isCodeView" class =" link" :href =" $withBase(`/example/${name}.html`)" target =" _blank" >查看代码</a >
718 </div >
819</template >
920
10- <script >
11- export default {
12- props: {
13- name: {
14- type: String ,
15- required: true ,
16- },
17- isCodeView: {
18- type: Boolean ,
19- default: true ,
20- },
21- },
22- }
23- </script >
24-
2521<style lang="scss" scoped>
2622.code-view-wrapper {
2723 position : relative ;
2824 margin : 10px 0 ;
25+
2926 .link {
3027 position : absolute ;
3128 right : 10px ;
Original file line number Diff line number Diff line change 99</template >
1010
1111<script >
12- import { v4 as uuidv4 } from ' uuid'
1312import mapboxgl from ' mapbox-gl'
1413import HomeControl from ' ../control/HomeControl'
1514import { TK , STYLE } from ' ../../utils/constant'
@@ -39,7 +38,7 @@ export default {
3938 map: null ,
4039 maploaded: false ,
4140 mapDefaultOptions: {
42- container: uuidv4 ( ),
41+ container: Math . random (). toString ( 16 ). substring ( 2 ),
4342 style: STYLE .DEFAULT ,
4443 center: [104.294538 , 35.860092 ],
4544 zoom: 2.4 ,
Original file line number Diff line number Diff line change 11<script setup>
2- import baseMap from ' ./base-map.vue'
32import { STYLE } from ' @/utils/constant'
3+ import baseMap from ' ../base-map.vue'
44
55const mapOptions = {
66 style: STYLE .SATELLITE ,
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export default defineUserConfig({
2727 theme : defaultTheme ( {
2828 logo : '/assets/logo.png' ,
2929 navbar : [
30- { text : '快速开始' , link : '/getting-started /' } ,
30+ { text : '快速开始' , link : '/starter /' } ,
3131 { text : '样式规范' , link : '/style-spec/' } ,
3232 { text : '地图服务' , link : '/service/' } ,
3333 { text : '空间数据' , link : '/data/' } ,
@@ -44,10 +44,10 @@ export default defineUserConfig({
4444 sidebarDepth : 2 ,
4545 // sidebar: 'auto',
4646 sidebar : {
47- '/getting-started /' : [
47+ '/starter /' : [
4848 {
4949 text : '快速开始' ,
50- link : '/getting-started /' ,
50+ link : '/starter /' ,
5151 } ,
5252 {
5353 text : '术语' ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ heroText: Mapbox GL JS Cookbook
55tagline : 地理信息可视化
66actions :
77 - text : 快速开始
8- link : /getting-started /
8+ link : /starter /
99 type : primary
1010 - text : 样式规范
1111 link : /style-spec/
Original file line number Diff line number Diff line change 1+ <ClientOnly >
2+ <common-code-view name =" starter-globe " :is-code-view =" false " />
3+ </ClientOnly >
4+
5+ @[ code vue] ( ../.vuepress/components/map/starter/globe.vue )
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ const map = new mapboxgl.Map({
2929})
3030```
3131
32- <map-start />
32+ <ClientOnly >
33+ <common-code-view name =" starter-globe " />
34+ </ClientOnly >
3335
3436> 示例:[ Display a globe on a webpage] ( https://docs.mapbox.com/mapbox-gl-js/example/simple-map/ )
File renamed without changes.
Original file line number Diff line number Diff line change 4040 "geojson-validation" : " ^1.0.2" ,
4141 "mapbox-gl" : " ^2.9.1" ,
4242 "proj4" : " ^2.8.0" ,
43- "three" : " ^0.132.2" ,
44- "uuid" : " ^8.3.2"
43+ "three" : " ^0.132.2"
4544 }
4645}
You can’t perform that action at this time.
0 commit comments