设备支持设置地理坐标系,并将级联输出坐标系统一为wgs84
This commit is contained in:
@@ -36,6 +36,12 @@
|
||||
<el-option key="UTF-8" label="UTF-8" value="utf-8"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="地理坐标系" prop="geoCoordSys" >
|
||||
<el-select v-model="form.geoCoordSys" style="float: left; width: 100%" >
|
||||
<el-option key="GCJ02" label="GCJ02" value="GCJ02"></el-option>
|
||||
<el-option key="WGS84" label="WGS84" value="WGS84"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="目录订阅" title="0为取消订阅" prop="subscribeCycleForCatalog" >
|
||||
<el-input v-model="form.subscribeCycleForCatalog" clearable ></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -49,7 +49,7 @@ import devicePlayer from './dialog/devicePlayer.vue'
|
||||
import queryTrace from './dialog/queryTrace.vue'
|
||||
|
||||
export default {
|
||||
name: "devicePosition",
|
||||
name: "map",
|
||||
components: {
|
||||
MapComponent,
|
||||
DeviceTree,
|
||||
@@ -183,12 +183,27 @@ export default {
|
||||
this.clean()
|
||||
this.closeInfoBox()
|
||||
let params = [];
|
||||
let longitudeStr;
|
||||
let latitudeStr;
|
||||
if (window.mapParam.coordinateSystem == "GCJ-02") {
|
||||
longitudeStr = "longitudeGcj02";
|
||||
latitudeStr = "latitudeGcj02";
|
||||
}else if (window.mapParam.coordinateSystem == "WGS84") {
|
||||
longitudeStr = "longitudeWgs84";
|
||||
latitudeStr = "latitudeWgs84";
|
||||
}else {
|
||||
longitudeStr = "longitude";
|
||||
latitudeStr = "latitude";
|
||||
}
|
||||
|
||||
for (let i = 0; i < channels.length; i++) {
|
||||
if (channels[i].longitude * channels[i].latitude === 0) {
|
||||
let longitude = channels[i][longitudeStr];
|
||||
let latitude = channels[i][latitudeStr];
|
||||
if (longitude * latitude === 0) {
|
||||
continue;
|
||||
}
|
||||
let item = {
|
||||
position: [channels[i].longitude, channels[i].latitude],
|
||||
position: [longitude, latitude],
|
||||
image: {
|
||||
src: this.getImageByChannel(channels[i]),
|
||||
anchor: [0.5, 1]
|
||||
@@ -202,7 +217,7 @@ export default {
|
||||
this.layer = this.$refs.map.addLayer(params, this.featureClickEvent)
|
||||
console.log(4)
|
||||
if (params.length === 1) {
|
||||
this.$refs.map.panTo([channels[0].longitude, channels[0].latitude], mapParam.maxZoom)
|
||||
this.$refs.map.panTo([channels[0][longitudeStr], channels[0][latitudeStr]], mapParam.maxZoom)
|
||||
} else if (params.length > 1) {
|
||||
this.$refs.map.fit(this.layer)
|
||||
} else {
|
||||
@@ -7,7 +7,7 @@ import deviceList from '../components/DeviceList.vue'
|
||||
import channelList from '../components/channelList.vue'
|
||||
import pushVideoList from '../components/PushVideoList.vue'
|
||||
import streamProxyList from '../components/StreamProxyList.vue'
|
||||
import devicePosition from '../components/devicePosition.vue'
|
||||
import map from '../components/map.vue'
|
||||
import login from '../components/Login.vue'
|
||||
import parentPlatformList from '../components/ParentPlatformList.vue'
|
||||
import cloudRecord from '../components/CloudRecord.vue'
|
||||
@@ -69,9 +69,9 @@ export default new VueRouter({
|
||||
component: parentPlatformList,
|
||||
},
|
||||
{
|
||||
path: '/devicePosition/:deviceId/:parentChannelId/:count/:page',
|
||||
name: 'devicePosition',
|
||||
component: devicePosition,
|
||||
path: '/map/:deviceId/:parentChannelId/:count/:page',
|
||||
name: 'map',
|
||||
component: map,
|
||||
},
|
||||
{
|
||||
path: '/cloudRecord',
|
||||
@@ -100,8 +100,8 @@ export default new VueRouter({
|
||||
},
|
||||
{
|
||||
path: '/map',
|
||||
name: 'devicePosition',
|
||||
component: devicePosition,
|
||||
name: 'map',
|
||||
component: map,
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user