Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
station-elec-manage-view
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
station
station-elec-manage-view
Commits
2eaecdc8
Commit
2eaecdc8
authored
May 25, 2020
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交离线地图
parent
16b78f01
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
33 deletions
+12
-33
amos.config.js
amos.config.js
+1
-1
BasicMap.js
src/view/monitor/mapScreen/BasicMap.js
+9
-30
tpl.html
tpl.html
+2
-2
No files found.
amos.config.js
View file @
2eaecdc8
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
text
:
''
text
:
''
},
},
name
:
'电力消防综合管控平台'
,
name
:
'电力消防综合管控平台'
,
outMap
:
fals
e
outMap
:
tru
e
},
},
//地图中心点
//地图中心点
mapCenter
:
[
106.976608
,
40.984692
]
mapCenter
:
[
106.976608
,
40.984692
]
...
...
src/view/monitor/mapScreen/BasicMap.js
View file @
2eaecdc8
...
@@ -22,26 +22,17 @@ const mapConfig = {
...
@@ -22,26 +22,17 @@ const mapConfig = {
expandZoomRange
:
true
,
expandZoomRange
:
true
,
doubleClickZoom
:
false
,
doubleClickZoom
:
false
,
showIndoorMap
:
false
,
//隐藏地图自带的室内地图图层
showIndoorMap
:
false
,
//隐藏地图自带的室内地图图层
features
:
[
'bg'
,
'road'
,
'point'
],
//隐藏默认楼块
features
:
[
'bg'
,
'road'
,
'point'
]
//隐藏默认楼块
layers
:
[
new
AMap
.
TileLayer
({
getTileUrl
(
x
,
y
,
z
)
{
return
`
${
_picURI
}
china/amap/
${
z
}
/
${
x
}
/
${
y
}
.png`
;
},
zIndex
:
0
})
]
};
};
const
layers
=
[
const
layers
=
[
// console.log(window);
new
window
.
AMap
.
TileLayer
({
// new window.AMap.TileLayer({
getTileUrl
(
x
,
y
,
z
)
{
// getTileUrl(x, y, z) {
return
`
${
_picURI
}
china/amap/
${
z
}
/
${
x
}
/
${
y
}
.png`
;
// return `${_picURI}shanxi/amap/${z}/${x}/${y}.png`;
},
// },
zIndex
:
0
// zIndex: 0
})
// })
];
]
const
statusEnum
=
{
'2'
:
'告警'
,
'3'
:
'高风险'
};
const
statusEnum
=
{
'2'
:
'告警'
,
'3'
:
'高风险'
};
...
@@ -62,7 +53,6 @@ class BasicMap extends Component {
...
@@ -62,7 +53,6 @@ class BasicMap extends Component {
visible
:
false
,
visible
:
false
,
selectData
:
{}
selectData
:
{}
};
};
this
.
layers
=
[];
}
}
componentDidMount
(){
componentDidMount
(){
...
@@ -225,19 +215,9 @@ class BasicMap extends Component {
...
@@ -225,19 +215,9 @@ class BasicMap extends Component {
}
}
setInstanceToGlobal
=
inst
=>
{
setInstanceToGlobal
=
inst
=>
{
//console.log(inst);
this
.
map
=
inst
;
this
.
map
=
inst
;
window
.
map
=
inst
;
window
.
map
=
inst
;
//this.initMap();
//this.initMap();
// this.layers = [
// new AMap.TileLayer({
// getTileUrl(x, y, z) {
// return `${_picURI}shanxi/amap/${z}/${x}/${y}.png`;
// },
// zIndex: 0
// })
// ];
// console.log(this.layers);
};
};
render
()
{
render
()
{
...
@@ -245,7 +225,7 @@ class BasicMap extends Component {
...
@@ -245,7 +225,7 @@ class BasicMap extends Component {
created
:
this
.
setInstanceToGlobal
created
:
this
.
setInstanceToGlobal
};
};
if
(
outMap
)
{
if
(
outMap
)
{
mapConfig
.
layers
=
this
.
layers
;
mapConfig
.
layers
=
layers
;
}
}
let
{
mapCenter
,
visible
}
=
this
.
state
;
let
{
mapCenter
,
visible
}
=
this
.
state
;
...
@@ -264,7 +244,6 @@ class BasicMap extends Component {
...
@@ -264,7 +244,6 @@ class BasicMap extends Component {
center
=
{
mapCenter
}
center
=
{
mapCenter
}
{...
mapConfig
}
{...
mapConfig
}
dragEnable
=
{
false
}
dragEnable
=
{
false
}
// layers={this.layers}
>
>
{
this
.
setBodyMarker
()}
{
this
.
setBodyMarker
()}
{
this
.
setBodyLine
()}
{
this
.
setBodyLine
()}
...
...
tpl.html
View file @
2eaecdc8
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
<meta
name=
"renderer"
content=
"webkit"
>
<meta
name=
"renderer"
content=
"webkit"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<script
type=
"application/javascript"
src=
"/amos.config.js"
></script>
<script
type=
"application/javascript"
src=
"/amos.config.js"
></script>
<script
src=
"http://webapi.amap.com/maps?v=1.4.3&key=8afbcd8006fcd36a22136ef20a12456a"
></script>
<
!-- <
script src="http://webapi.amap.com/maps?v=1.4.3&key=8afbcd8006fcd36a22136ef20a12456a"></script>
<script
src=
"http://webapi.amap.com/ui/1.0/main.js?v=1.0.11"
></script>
<script src="http://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
-->
<title>
电力消防综合管控平台
</title>
<title>
电力消防综合管控平台
</title>
<script>
<script>
window
.
offlineMap
=
{
window
.
offlineMap
=
{
...
...
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