Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
map-demo
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2023-07-24 14:15:23 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
00a5736a169e93b76ed5036539192c6913d73eaf
00a5736a
1 parent
432dd9d7
fix 导航路径测试调整
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
182 additions
and
9 deletions
src/common/inner_router.js
src/views/index.vue
src/views/inner.vue
src/common/inner_router.js
0 → 100644
View file @
00a5736
/*
* @Date: 2023-07-21 14:25:45
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-07-24 11:25:29
* @FilePath: /map-demo/src/common/inner_router.js
* @Description: 文件描述
*/
const
testInfo
=
[
{
id
:
0
,
path
:
[
[
120.588288
,
31.314212
],
[
120.587711
,
31.314184
],
[
120.587694
,
31.314368
],
[
120.587662
,
31.314585
],
[
120.587474
,
31.314573
],
[
120.587453
,
31.314773
],
[
120.58765
,
31.314786
],
[
120.587453
,
31.314773
],
[
120.587422
,
31.314937
],
[
120.587233
,
31.314961
],
[
120.587205
,
31.315508
],
[
120.587197
,
31.315602
],
[
120.587564
,
31.315631
],
[
120.587197
,
31.315602
],
[
120.586621
,
31.315511
],
[
120.586368
,
31.315492
],
[
120.586123
,
31.315362
],
[
120.585778
,
31.31531
],
],
distance
:
''
,
},
{
id
:
1
,
path
:
[
[
120.588288
,
31.314212
],
[
120.587711
,
31.314184
],
[
120.587694
,
31.314368
],
[
120.587662
,
31.314585
],
[
120.587474
,
31.314573
],
[
120.587453
,
31.314773
],
[
120.58765
,
31.314786
],
[
120.587453
,
31.314773
],
[
120.587422
,
31.314937
],
[
120.586936
,
31.314948
],
[
120.58654
,
31.315012
],
[
120.586161
,
31.314977
],
],
distance
:
''
,
},
{
id
:
2
,
path
:
[
[
120.588219
,
31.314222
],
[
120.587721
,
31.314186
],
[
120.587696
,
31.314375
],
[
120.587737
,
31.314572
],
[
120.588236
,
31.314615
],
[
120.58826
,
31.314719
],
[
120.588251
,
31.314771
],
[
120.588204
,
31.314767
],
[
120.588186
,
31.314927
],
[
120.588172
,
31.315067
],
],
distance
:
''
,
},
{
id
:
3
,
path
:
[
[
120.588191
,
31.314226
],
[
120.587711
,
31.314177
],
[
120.587691
,
31.314343
],
[
120.587239
,
31.314309
],
[
120.586816
,
31.314399
],
[
120.586747
,
31.314405
],
[
120.586738
,
31.314469
],
[
120.585985
,
31.314409
],
[
120.585984
,
31.314337
],
[
120.585887
,
31.314318
],
[
120.585895
,
31.314159
],
[
120.585598
,
31.314131
],
[
120.585412
,
31.314195
],
[
120.585225
,
31.314164
],
[
120.585152
,
31.314032
],
[
120.585234
,
31.313942
],
[
120.585311
,
31.313884
],
[
120.585415
,
31.313934
],
[
120.585601
,
31.313955
],
[
120.585889
,
31.313961
],
[
120.586052
,
31.31397
],
[
120.586081
,
31.313569
],
[
120.586081
,
31.313569
],
[
120.585678
,
31.313533
],
[
120.586081
,
31.313569
],
[
120.586083
,
31.31353
],
[
120.58643
,
31.313572
],
[
120.586083
,
31.31353
],
[
120.586094
,
31.3134
],
[
120.585709
,
31.313362
],
[
120.586094
,
31.3134
],
[
120.586101
,
31.313334
],
[
120.586365
,
31.31335
],
[
120.586101
,
31.313334
],
[
120.586118
,
31.313165
],
],
distance
:
''
,
},
{
id
:
4
,
path
:
[
[
120.588303
,
31.314235
],
[
120.58725
,
31.314125
],
[
120.587255
,
31.314047
],
[
120.587095
,
31.314031
],
[
120.587096
,
31.313934
],
[
120.586729
,
31.313905
],
[
120.586678
,
31.314393
],
],
distance
:
''
,
},
{
id
:
5
,
path
:
[
[
120.588303
,
31.314235
],
[
120.58725
,
31.314125
],
[
120.587255
,
31.314047
],
[
120.587095
,
31.314031
],
[
120.587096
,
31.313934
],
[
120.586729
,
31.313905
],
[
120.586811
,
31.313178
],
[
120.58668
,
31.313163
],
],
distance
:
''
,
},
{
id
:
6
,
path
:
[
[
120.588303
,
31.314235
],
[
120.58725
,
31.314125
],
[
120.587255
,
31.314047
],
[
120.587095
,
31.314031
],
[
120.587131
,
31.313915
],
[
120.587165
,
31.313619
],
[
120.587178
,
31.313514
],
[
120.58725
,
31.31352
],
],
distance
:
''
,
},
// {
// id: 2,
// path: [
// ],
// distance: '',
// },
];
// 照壁[120.587882,31.312884]-双桥[120.588164,31.31305]-牌坊[120.587823,31.313276]-山门[120.587811,31.313508]-鼓楼[120.5875,31.31407]-公共厕所[120.587103,31.314234]-包子铺[120.586912,31.314195]-开水房[120.586812,31.314049];
// 照壁[120.587882,31.312884]-双桥[120.588164,31.31305]-牌坊[120.587823,31.313276]-山门[120.587811,31.313508]-鼓楼[120.5875,31.31407]-天王殿[120.58769,31.314535]-素食馆[120.587352,31.314496]-罗汉堂[120.587176,31.314839]-集云轩[120.587113,31.314473]-般若堂[120.586966,31.314526]-茶室[120.58681,31.314981]-湖心亭[120.58653,31.315118]-神鼋[120.586157,31.315011];
// 照壁[120.587882,31.312884]-双桥[120.588164,31.31305]-牌坊[120.587823,31.313276]-山门[120.587811,31.313508]-钟楼[120.587985,31.31411]-天王殿[120.58769,31.314535]-客堂、行政办公室[120.58798,31.314679]-观音殿[120.58791,31.314799]-大雄宝殿[120.587621,31.31513]-老念佛堂[120.587295,31.315548]-挂单寮[120.587574,31.315582]-地藏殿[120.587853,31.315603];
export
default
testInfo
;
src/views/index.vue
View file @
00a5736
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-07-
19 17:05:37
* @LastEditTime: 2023-07-
21 14:29:26
* @FilePath: /map-demo/src/views/index.vue
* @Description: 地图主体页面
-->
...
...
@@ -660,6 +660,7 @@ export default {
});
let lngLat = [120.587234, 31.314147]; // 左边
// const lngLat = [120.588178, 31.314396]; // 右边
// console.log(this.current_lng ,this.current_lat);
// 构建路线结构
// 如果建筑不在导航路径上面需要单独处理, 直接查询建筑离哪个导航路径最近显示出来
const route_obj = array.length ? array: my_router;
...
...
@@ -800,13 +801,19 @@ export default {
showInfoClick(e) {
// console.log(e);
var zoom = this.map.getZoom(); //获取当前地图级别
// var text =
// "您在 [" +
// e.lnglat.getLng() +
// "," +
// e.lnglat.getLat() +
// "] 的位置单击了地图!当前层级" +
// zoom;
var text =
"
您在
[" +
"[" +
e.lnglat.getLng() +
"," +
e.lnglat.getLat() +
"] 的位置单击了地图!当前层级" +
zoom;
"]"
console.log(text);
// 点击空白处 关闭弹框
this.closeInfoWindow();
...
...
src/views/inner.vue
View file @
00a5736
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-07-
19 17:06:18
* @LastEditTime: 2023-07-
21 14:32:47
* @FilePath: /map-demo/src/views/inner.vue
* @Description: 地图主体页面
-->
...
...
@@ -120,7 +120,7 @@
import coord from '@/common/map_data'
import map_max from '@/common/max'
import map_yard from '@/common/yard'
import my_router from '@/common/
my
_router'
import my_router from '@/common/
inner
_router'
import map_members from '@/common/members'
import _ from 'lodash';
import $ from 'jquery';
...
...
@@ -870,13 +870,19 @@ export default {
showInfoClick(e) {
// console.log(e);
var zoom = this.map.getZoom(); //获取当前地图级别
// var text =
// "您在 [" +
// e.lnglat.getLng() +
// "," +
// e.lnglat.getLat() +
// "] 的位置单击了地图!当前层级" +
// zoom;
var text =
"
您在
[" +
"[" +
e.lnglat.getLng() +
"," +
e.lnglat.getLat() +
"] 的位置单击了地图!当前层级" +
zoom;
"],"
console.log(text);
// 点击空白处 关闭弹框
this.closeInfoWindow();
...
...
Please
register
or
login
to post a comment