Commit 83cbb3d5 authored by 郭铭瑶's avatar 郭铭瑶 🤘

换新版地图包

parent e6d97de5
...@@ -18,10 +18,7 @@ ...@@ -18,10 +18,7 @@
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
<script src="./static/hls.js"></script> <script src="./static/hls.js"></script>
<!-- 下面是开发用 --> <script src="./static/shanghaiwuye_gis_map_api_3.2.210421/SMap.min.js"></script>
<script src="./static/SMap.min.js"></script>
<!-- 下面是生产用 -->
<!-- <script src="./static/esm/SMap.min.js"></script> -->
<script src="./static/Plugins.min.js"></script> <script src="./static/Plugins.min.js"></script>
<script src="./static/GeoTask.min.js"></script> <script src="./static/GeoTask.min.js"></script>
......
...@@ -22,16 +22,18 @@ export default { ...@@ -22,16 +22,18 @@ export default {
}, },
methods: { methods: {
initMap() { initMap() {
new SMap.Network().setNet(this.$api.MAP_NET)
this.map = new SMap.Map('mapContainer', { this.map = new SMap.Map('mapContainer', {
viewMode: '2D', viewMode: '2D',
// center: [0, 0], // center: [0, 0],
// zoom: 4, // zoom: 4,
// zooms: [1, 12], // zooms: [1, 12],
mapStyle: 'smap://styles/dark', mapStyle: 'smap://styles/dark',
appKey: 'ACF69EDK17LON63GHPF081',
}).on(SMap.MapEvent.maploaded, () => { }).on(SMap.MapEvent.maploaded, () => {
// this.map.hideXQ_Poly() // this.map.hideXQ_Poly()
this.map.hideXQ_Point() // this.map.hideXQ_Point()
this.map.hideMPZ() // this.map.hideMPZ()
// this.addGridListener() // this.addGridListener()
this.identifytask = new GeoTask.Identify(this.map.view) this.identifytask = new GeoTask.Identify(this.map.view)
this.addListener() this.addListener()
......
let MAP_NET = ''
let BASE_URL = '' let BASE_URL = ''
const DATA_URL = 'http://10.89.1.208:10005' const DATA_URL = 'http://10.89.1.208:10005'
const VIDEO_URL = 'http://10.89.4.179:27343' const VIDEO_URL = 'http://10.89.4.179:27343'
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case 'production': case 'production':
// BASE_URL = 'http://10.89.4.164:18080/api' MAP_NET = 'affairs' // 政务网地图
BASE_URL = 'http://yangpu.hm.omniview.pro/api' BASE_URL = 'http://10.89.4.164:18080/api'
// BASE_URL = 'http://yangpu.hm.omniview.pro/api' // 废弃
break break
default: default:
BASE_URL = 'http://yangpu.hm.omniview.pro/api' MAP_NET = 'internet' // 互联网地图
BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
// BASE_URL = 'http://yangpu.hm.omniview.pro/api' // 废弃
} }
export default { export default {
MAP_NET,
BASE_URL, BASE_URL,
DATA_URL, DATA_URL,
GET_DISCOVER_TREND: '/service-special-ddd/public/alarm/unremoved/statistics', // 智能发现趋势图 GET_DISCOVER_TREND: '/service-special-ddd/public/alarm/unremoved/statistics', // 智能发现趋势图
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
- [示例](#示例) - [示例](#示例)
- [地图](#地图) - [地图](#地图)
- [生命周期](#生命周期) - [生命周期](#生命周期)
- [设置网络模式](#设置网络模式)
- [创建二维地图](#创建二维地图) - [创建二维地图](#创建二维地图)
- [创建三维地图](#创建三维地图) - [创建三维地图](#创建三维地图)
- [地图样式](#地图样式) - [地图样式](#地图样式)
...@@ -165,6 +166,11 @@ import SMap from 'smap-xh' ...@@ -165,6 +166,11 @@ import SMap from 'smap-xh'
## 示例 ## 示例
### [地图] ### [地图]
#### [生命周期] #### [生命周期]
##### [设置网络模式]
```js
import SMap from 'smap-xh'
new SMap.Network().setNet(网络参数);
```
##### [创建二维地图] ##### [创建二维地图]
```js ```js
import SMap from 'smap-xh' import SMap from 'smap-xh'
...@@ -220,6 +226,7 @@ const map = new SMap.Map('container', { ...@@ -220,6 +226,7 @@ const map = new SMap.Map('container', {
```js ```js
//"wg_gis_xq_point"为小区点, //"wg_gis_xq_point"为小区点,
//"wg_gis_xq_poly"为小区面, //"wg_gis_xq_poly"为小区面,
//"wg_gis_zb_jkd"为小区健康度
//"wg_gis_mpz"为门牌幢点, //"wg_gis_mpz"为门牌幢点,
//"wg_gis_elevator"为电梯点, //"wg_gis_elevator"为电梯点,
//"wg_gis_sensor"为传感器 //"wg_gis_sensor"为传感器
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
new SMap.Network().setNet(网络参数);
网络参数包括以下几个值:
'internet':表示互联网2D;
'affairs':表示政务网2D;
'local3D':表示局域网3D;
'affairs3D':表示政务网3D;
'njdl':表示南京东路政务网3D;
\ No newline at end of file
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