Commit 2eaecdc8 authored by xinglei's avatar xinglei

提交离线地图

parent 16b78f01
......@@ -31,7 +31,7 @@
text: ''
},
name: '电力消防综合管控平台',
outMap: false
outMap: true
},
//地图中心点
mapCenter: [106.976608,40.984692]
......
......@@ -22,26 +22,17 @@ const mapConfig = {
expandZoomRange: true,
doubleClickZoom: false,
showIndoorMap: false, //隐藏地图自带的室内地图图层
features: ['bg', 'road', 'point'], //隐藏默认楼块
layers: [
new AMap.TileLayer({
features: ['bg', 'road', 'point'] //隐藏默认楼块
};
const layers = [
new window.AMap.TileLayer({
getTileUrl(x, y, z) {
return `${_picURI}china/amap/${z}/${x}/${y}.png`;
},
zIndex: 0
})
]
};
const layers = [
// console.log(window);
// new window.AMap.TileLayer({
// getTileUrl(x, y, z) {
// return `${_picURI}shanxi/amap/${z}/${x}/${y}.png`;
// },
// zIndex: 0
// })
]
];
const statusEnum = { '2': '告警', '3': '高风险' };
......@@ -62,7 +53,6 @@ class BasicMap extends Component {
visible: false,
selectData: {}
};
this.layers = [];
}
componentDidMount(){
......@@ -225,19 +215,9 @@ class BasicMap extends Component {
}
setInstanceToGlobal = inst => {
//console.log(inst);
this.map = inst;
window.map = inst;
//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() {
......@@ -245,7 +225,7 @@ class BasicMap extends Component {
created: this.setInstanceToGlobal
};
if (outMap) {
mapConfig.layers = this.layers;
mapConfig.layers = layers;
}
let { mapCenter, visible } = this.state;
......@@ -264,7 +244,6 @@ class BasicMap extends Component {
center={mapCenter}
{...mapConfig}
dragEnable={false}
// layers={this.layers}
>
{this.setBodyMarker()}
{this.setBodyLine()}
......
......@@ -7,8 +7,8 @@
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<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/ui/1.0/main.js?v=1.0.11"></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> -->
<title>电力消防综合管控平台</title>
<script>
window.offlineMap = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment