Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
SuperMan
Commits
2ed67d83
Commit
2ed67d83
authored
Jan 18, 2023
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地图修改
parent
db16d7df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
Map.vue
...nts/busManagement/CharteringManagement/components/Map.vue
+17
-17
No files found.
src/components/busManagement/CharteringManagement/components/Map.vue
View file @
2ed67d83
...
...
@@ -60,24 +60,24 @@ export default {
},
search
()
{
var
that
=
this
var
map
=
new
BMap
.
Map
(
`allmap_
${
that
.
id
}${
that
.
type
}
_
${
that
.
index
}
`
)
var
map
=
new
BMap
.
Map
(
`allmap_
${
that
.
id
}${
that
.
type
}
_
${
that
.
index
}
`
,
{
enableMapClick
:
false
}
)
var
local
=
new
BMap
.
LocalSearch
(
map
,
{
// 智能搜索
onSearchComplete
:
function
()
{
if
(
local
.
getResults
()
&&
local
.
getResults
().
getPoi
(
0
)
&&
local
.
getResults
().
getPoi
(
0
).
point
)
{
that
.
userlocation
=
local
.
getResults
().
getPoi
(
0
).
point
// 获取第一个智能搜索的结果
that
.
point
.
lat
=
that
.
userlocation
.
lat
that
.
point
.
lng
=
that
.
userlocation
.
lng
//
map.centerAndZoom(that.userlocation, 15)
map
.
centerAndZoom
(
that
.
userlocation
,
15
)
map
.
addOverlay
(
new
BMap
.
Marker
(
that
.
userlocation
))
// 添加标注
}
}
})
local
.
search
(
that
.
city
)
//
map.addEventListener('click', function (e, target) {
//
// var point = new BMap.Point(e.point.lng, e.point.lat) // 创建点坐标,汉得公司的经纬度坐标
//
// map.centerAndZoom(point, 11)
//
// that.point = e.point
//
})
map
.
addEventListener
(
'click'
,
function
(
e
,
target
)
{
// var point = new BMap.Point(e.point.lng, e.point.lat) // 创建点坐标,汉得公司的经纬度坐标
// map.centerAndZoom(point, 11)
// that.point = e.point
})
var
gc
=
new
BMap
.
Geocoder
();
map
.
addEventListener
(
'mousedown'
,
function
(
type
)
{
var
pt
=
type
.
point
;
...
...
@@ -91,7 +91,7 @@ export default {
this
.
$nextTick
(
function
()
{
var
that
=
this
// 创建Map实例
var
map
=
new
BMap
.
Map
(
`allmap_
${
that
.
id
}${
that
.
type
}
_
${
that
.
index
}
`
)
var
map
=
new
BMap
.
Map
(
`allmap_
${
that
.
id
}${
that
.
type
}
_
${
that
.
index
}
`
,
{
enableMapClick
:
false
}
)
// 获取当前位置
var
geolocation
=
new
BMap
.
Geolocation
();
...
...
@@ -100,6 +100,7 @@ export default {
var
mk
=
new
BMap
.
Marker
(
r
.
point
);
map
.
addOverlay
(
mk
);
map
.
panTo
(
r
.
point
);
// map.mapClick = false
that
.
address_detail
=
addComp
.
province
+
""
+
addComp
.
city
+
""
+
addComp
.
district
+
""
+
addComp
.
street
+
""
+
addComp
.
streetNumber
that
.
point
.
lng
=
r
.
point
.
lng
that
.
point
.
lat
=
r
.
point
.
lat
...
...
@@ -111,12 +112,11 @@ export default {
}
});
// 点击地图
// map.addEventListener('click', function (e, target) {
// // console.log('4545')
// // var point = new BMap.Point(e.point.lng, e.point.lat) // 创建点坐标,汉得公司的经纬度坐标
// // map.centerAndZoom(point, 11)
// // that.point = e.point
// })
map
.
addEventListener
(
'click'
,
function
(
e
,
target
)
{
// var point = new BMap.Point(e.point.lng, e.point.lat) // 创建点坐标,汉得公司的经纬度坐标
// map.centerAndZoom(point, 11)
// that.point = e.point
})
var
gc
=
new
BMap
.
Geocoder
();
map
.
addEventListener
(
'mousedown'
,
function
(
type
)
{
// map.centerAndZoom(type.point, 11)
...
...
@@ -129,10 +129,10 @@ export default {
})
// 初始化地图,设置中心点坐标,
if
(
that
.
point
.
lat
)
{
//
var point = new BMap.Point(that.point.lat, that.point.lng) // 创建点坐标
//
map.centerAndZoom(point, 11)
var
point
=
new
BMap
.
Point
(
that
.
point
.
lat
,
that
.
point
.
lng
)
// 创建点坐标
map
.
centerAndZoom
(
point
,
11
)
}
else
{
//
map.centerAndZoom(new BMap.Point(104.073652, 30.664369), 11);
map
.
centerAndZoom
(
new
BMap
.
Point
(
104.073652
,
30.664369
),
11
);
}
map
.
enableScrollWheelZoom
()
if
(
that
.
Address
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment