Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety-progress
Project
Project
Details
Activity
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
耿迪迪
gassafety-progress
Commits
39edb35e
Commit
39edb35e
authored
Mar 16, 2022
by
wuqinghua
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
4610f2da
78459def
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
h5player.min.js
gassafetyprogress-web/public/h5player/h5player.min.js
+1
-1
map.js
gassafetyprogress-web/src/utils/mapClass/map.js
+35
-1
No files found.
gassafetyprogress-web/public/h5player/h5player.min.js
View file @
39edb35e
This source diff could not be displayed because it is too large. You can
view the blob
instead.
gassafetyprogress-web/src/utils/mapClass/map.js
View file @
39edb35e
/*
* @Author: your name
* @Date: 2022-01-11 13:45:12
* @LastEditTime: 2022-03-
03 11:51:16
* @LastEditTime: 2022-03-
15 13:50:27
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/utils/mapClass.js
...
...
@@ -14,6 +14,8 @@ import { pipeColor, svgUrl, svgAlarm } from "@/utils/mapClass/config.js";
export
class
EditorMap
{
// 地图的对象实例
map
=
null
;
// 外部传进来的中心店
center
=
null
;
// 父vue的实例
vue
=
null
;
// 操作 新建,编辑,删除,编辑跟删除只对已经在图上的设备有效 默认值:0, 新建:1,编辑:2, 删除: 3。
...
...
@@ -49,6 +51,8 @@ export class EditorMap {
zoom
:
14
,
...
config
,
});
const
{
center
}
=
config
;
this
.
center
=
center
;
this
.
vue
=
vue
;
this
.
init
();
}
...
...
@@ -60,6 +64,36 @@ export class EditorMap {
this
.
mouseAddDevice
();
// this.mouseAddMarker();
// this.mouseAddPipeline();
// 地图边界
this
.
map
.
getCity
((
res
)
=>
{
const
city
=
res
.
district
;
this
.
mapBound
(
city
);
},
this
.
center
);
}
mapBound
(
city
)
{
var
district
=
new
AMap
.
DistrictSearch
({
extensions
:
"all"
,
// 返回行政区边界坐标等具体信息
level
:
"district"
,
// 设置查询行政区级别为 区
});
district
.
search
(
city
,
(
status
,
result
)
=>
{
// 获取朝阳区的边界信息
var
bounds
=
result
.
districtList
[
0
].
boundaries
;
var
polygons
=
[];
if
(
bounds
)
{
for
(
var
i
=
0
,
l
=
bounds
.
length
;
i
<
l
;
i
++
)
{
//生成行政区划polygon
new
AMap
.
Polygon
({
map
:
this
.
map
,
strokeWeight
:
2
,
path
:
bounds
[
i
],
fillOpacity
:
1
,
fillColor
:
"transparent"
,
strokeColor
:
"#09f"
,
});
// polygons.push(polygon);
}
}
});
}
// map的事件监听
mapEvent
()
{
...
...
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