Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
baidu_map
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
mahui
baidu_map
Commits
494aa191
Commit
494aa191
authored
Jun 22, 2020
by
mahui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据更新
parent
1edd46f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
map.vue
src/components/map.vue
+14
-3
No files found.
src/components/map.vue
View file @
494aa191
...
...
@@ -1852,7 +1852,7 @@
// self.map.openInfoWindow(infoWindow, coordinate); //开启信息窗口
});
},
getBoundary
:
function
(
map
,
bool
,
index
)
{
getBoundary
(
map
,
bool
,
index
)
{
let
self
=
this
;
let
bdary
=
new
BMap
.
Boundary
();
bdary
.
get
(
'临安区'
,
function
(
rs
)
{
//获取行政区域
...
...
@@ -1879,8 +1879,10 @@
map
.
addOverlay
(
ply
);
}
let
marker
;
let
position
=
''
;
for
(
let
item
of
self
.
search_data
)
{
marker
=
new
BMap
.
Point
(
item
.
position
.
split
(
','
)[
0
],
item
.
position
.
split
(
','
)[
1
]);
position
=
self
.
bd_encrypt
(
item
.
position
.
split
(
','
)[
0
],
item
.
position
.
split
(
','
)[
1
]);
marker
=
new
BMap
.
Point
(
position
.
split
(
','
)[
0
],
position
.
split
(
','
)[
1
]);
self
.
mapShow
(
marker
,
item
,
item
.
type
==
'横畈'
?
2
:
1
);
// if(Array.isArray(item.data)){
// for(let j of item.data){
...
...
@@ -1891,6 +1893,15 @@
// }
}
});
},
bd_encrypt
(
gg_lng
,
gg_lat
)
{
var
X_PI
=
Math
.
PI
*
3000.0
/
180.0
;
var
x
=
gg_lng
,
y
=
gg_lat
;
var
z
=
Math
.
sqrt
(
x
*
x
+
y
*
y
)
+
0.00002
*
Math
.
sin
(
y
*
X_PI
);
var
theta
=
Math
.
atan2
(
y
,
x
)
+
0.000003
*
Math
.
cos
(
x
*
X_PI
);
var
bd_lng
=
z
*
Math
.
cos
(
theta
)
+
0.0065
;
var
bd_lat
=
z
*
Math
.
sin
(
theta
)
+
0.006
;
return
bd_lng
+
','
+
bd_lat
;
}
}
});
...
...
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