Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
oEshield
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 928ff08c
authored
Sep 18, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复bug
1 parent
2eff3920
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
15 deletions
src/pages/monitor/addPoi.vue
src/pages/monitor/replay.vue
src/pages/monitor/zoneCar.vue
src/utils/mapInit.js
src/pages/monitor/addPoi.vue
View file @
928ff08
...
@@ -153,6 +153,7 @@ export default {
...
@@ -153,6 +153,7 @@ export default {
trackList
:
[],
// 历史poi点
trackList
:
[],
// 历史poi点
poiInfoWindow
:
null
,
// 当前的弹框
poiInfoWindow
:
null
,
// 当前的弹框
markerList
:
{},
// poi点标记列表
markerList
:
{},
// poi点标记列表
showMapText
:
false
,
//是否地图展示道路、标题
};
};
},
},
mounted
()
{
mounted
()
{
...
@@ -164,20 +165,14 @@ export default {
...
@@ -164,20 +165,14 @@ export default {
// 地图初始化
// 地图初始化
initMap
()
{
initMap
()
{
let
_this
=
this
;
let
_this
=
this
;
let
plugins
=
[
let
plugins
=
[
"AMap.LngLat"
,
"AMap.MassMarks"
,
"AMap.Geocoder"
];
"AMap.LngLat"
,
"AMap.AutoComplete"
,
"AMap.MassMarks"
,
"AMap.Geocoder"
,
];
_this
.
$mapInit
({
plugins
:
plugins
}).
then
((
AMap
)
=>
{
_this
.
$mapInit
({
plugins
:
plugins
}).
then
((
AMap
)
=>
{
_this
.
mapLoading
=
false
;
_this
.
mapLoading
=
false
;
window
.
AMap
=
AMap
;
window
.
AMap
=
AMap
;
_this
.
map
=
mapService
.
init
(
"map"
,
{
_this
.
map
=
mapService
.
init
(
"map"
,
{
zoom
:
15
,
zoom
:
15
,
viewMode
:
"3D"
,
showIndoorMap
:
false
,
showIndoorMap
:
false
,
showLabel
:
tru
e
,
showLabel
:
fals
e
,
});
});
_this
.
bindSearch
();
_this
.
bindSearch
();
_this
.
initMapEvent
();
_this
.
initMapEvent
();
...
@@ -346,7 +341,7 @@ export default {
...
@@ -346,7 +341,7 @@ export default {
// 绑定搜索
// 绑定搜索
bindSearch
()
{
bindSearch
()
{
const
_this
=
this
;
const
_this
=
this
;
AMap
.
plugin
(
"AMap.AutoComplete"
,
function
()
{
let
autoComplete
=
new
AMap
.
AutoComplete
({
let
autoComplete
=
new
AMap
.
AutoComplete
({
input
:
"poiMapSearch"
,
input
:
"poiMapSearch"
,
});
});
...
@@ -360,6 +355,7 @@ export default {
...
@@ -360,6 +355,7 @@ export default {
_this
.
addPoiMarker
(
_params
,
"search"
);
_this
.
addPoiMarker
(
_params
,
"search"
);
});
});
});
},
},
// 返回列表页面
// 返回列表页面
...
@@ -483,6 +479,7 @@ export default {
...
@@ -483,6 +479,7 @@ export default {
_this.getInfo();
_this.getInfo();
}
}
_this.trackList = res.data || [];
_this.trackList = res.data || [];
_this.showRoadTitle();
}
}
});
});
},
},
...
@@ -501,7 +498,7 @@ export default {
...
@@ -501,7 +498,7 @@ export default {
_obj.lng = arr[0];
_obj.lng = arr[0];
_obj.lat = arr[1];
_obj.lat = arr[1];
}
}
console.log(_obj)
console.log(_obj)
;
_this.addPoiMarker(_obj, "", true);
_this.addPoiMarker(_obj, "", true);
});
});
},
},
...
@@ -533,6 +530,13 @@ export default {
...
@@ -533,6 +530,13 @@ export default {
}, 1000);
}, 1000);
}
}
},
},
// 展示隐藏地图标题
showRoadTitle() {
let _road = new AMap.TileLayer.RoadNet();
let _title = new AMap.TileLayer();
this.map.add([_title]);
},
},
},
};
};
</
script
>
</
script
>
...
...
src/pages/monitor/replay.vue
View file @
928ff08
...
@@ -779,7 +779,7 @@ export default {
...
@@ -779,7 +779,7 @@ export default {
let
_config
=
{
version
:
"1.4.2"
};
let
_config
=
{
version
:
"1.4.2"
};
_config
.
AMapUI
=
{
_config
.
AMapUI
=
{
version
:
"1.1"
,
version
:
"1.1"
,
plugins
:
[
"
ui
/misc/PathSimplifier"
],
plugins
:
[
"/misc/PathSimplifier"
],
};
};
_this
.
$mapInit
(
_config
).
then
((
AMap
)
=>
{
_this
.
$mapInit
(
_config
).
then
((
AMap
)
=>
{
...
...
src/pages/monitor/zoneCar.vue
View file @
928ff08
...
@@ -237,11 +237,12 @@ export default {
...
@@ -237,11 +237,12 @@ export default {
"AMap.MassMarks"
,
"AMap.MassMarks"
,
"AMap.MarkerCluster"
,
"AMap.MarkerCluster"
,
"AMap.Bounds"
,
"AMap.Bounds"
,
"AMap.MouseTool"
]);
]);
_this
.
$mapInit
({
plugins
:
plugins
}).
then
((
AMap
)
=>
{
_this
.
$mapInit
({
plugins
:
plugins
}).
then
((
AMap
)
=>
{
_this
.
mapLoading
=
false
;
_this
.
mapLoading
=
false
;
window
.
AMap
=
AMap
;
window
.
AMap
=
AMap
;
_this
.
map
=
mapService
.
init
(
"map"
,
{
zoom
:
11
});
_this
.
map
=
mapService
.
init
(
"map"
,
{
zoom
:
11
,
showLabel
:
false
});
_this
.
mouseTool
=
new
AMap
.
MouseTool
(
_this
.
map
);
_this
.
mouseTool
=
new
AMap
.
MouseTool
(
_this
.
map
);
var
autoComplete
=
new
AMap
.
AutoComplete
({
var
autoComplete
=
new
AMap
.
AutoComplete
({
input
:
"tipInput"
,
input
:
"tipInput"
,
...
@@ -259,6 +260,9 @@ export default {
...
@@ -259,6 +260,9 @@ export default {
if
(
_query
.
type
==
"full"
&&
_query
.
leftLngLat
)
{
if
(
_query
.
type
==
"full"
&&
_query
.
leftLngLat
)
{
this
.
initPage
(
_query
);
this
.
initPage
(
_query
);
}
}
// 给地图添加文字图层
_this
.
map
.
add
([
new
AMap
.
TileLayer
()]);
});
});
},
},
...
...
src/utils/mapInit.js
View file @
928ff08
...
@@ -3,13 +3,13 @@ import { CONSTANT } from "@/constant";
...
@@ -3,13 +3,13 @@ import { CONSTANT } from "@/constant";
export
const
mapInit
=
params
=>
{
export
const
mapInit
=
params
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
options
=
params
||
{};
let
options
=
params
||
{};
let
plugins
=
options
.
plugins
||
CONSTANT
.
MAP_PLUGINS
;
//
let plugins = options.plugins|| CONSTANT.MAP_PLUGINS;
let
version
=
options
.
version
||
'2.0'
;
//
let version = options.version || '2.0';
if
(
window
.
AMap
){
if
(
window
.
AMap
){
resolve
(
window
.
AMap
)
resolve
(
window
.
AMap
)
return
false
;
return
false
;
}
}
let
mapConfig
=
{};
let
mapConfig
=
{
...
options
};
mapConfig
.
key
=
CONSTANT
.
MAP_KEY
;
// 申请好的Web端开发者Key,首次调用 load 时必填
mapConfig
.
key
=
CONSTANT
.
MAP_KEY
;
// 申请好的Web端开发者Key,首次调用 load 时必填
mapConfig
.
version
=
options
.
version
||
'2.0'
;;
// 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
mapConfig
.
version
=
options
.
version
||
'2.0'
;;
// 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
mapConfig
.
plugins
=
options
.
plugins
||
CONSTANT
.
MAP_PLUGINS
;
// 需要使用的的插件列表,如比例尺'AMap.Scale'等
mapConfig
.
plugins
=
options
.
plugins
||
CONSTANT
.
MAP_PLUGINS
;
// 需要使用的的插件列表,如比例尺'AMap.Scale'等
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment