Commit c0222139729eb9b133f77581a429b9b56323e74f
1 parent
be9533de
设备支持设置地理坐标系,并将级联输出坐标系统一为wgs84
Showing
21 changed files
with
214 additions
and
55 deletions
sql/update.sql
| 1 | alter table stream_push | 1 | alter table stream_push |
| 2 | add serverId varchar(50) not null; | 2 | add serverId varchar(50) not null; |
| 3 | +alter table device | ||
| 4 | + add geoCoordSys varchar(50) not null; | ||
| 5 | +update device set device.geoCoordSys='WGS84'; | ||
| 6 | +alter table device_channel | ||
| 7 | + add longitudeGcj02 double default null; | ||
| 8 | +alter table device_channel | ||
| 9 | + add latitudeGcj02 double default null; | ||
| 10 | +alter table device_channel | ||
| 11 | + add longitudeWgs84 double default null; | ||
| 12 | +alter table device_channel | ||
| 13 | + add latitudeWgs84 double default null; | ||
| 14 | + | ||
| 3 | 15 | ||
| 4 | 16 |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java
| 1 | package com.genersoft.iot.vmp.gb28181.bean; | 1 | package com.genersoft.iot.vmp.gb28181.bean; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +/** | ||
| 5 | + * 国标设备/平台 | ||
| 6 | + * @author lin | ||
| 7 | + */ | ||
| 4 | public class Device { | 8 | public class Device { |
| 5 | 9 | ||
| 6 | /** | 10 | /** |
| @@ -129,6 +133,11 @@ public class Device { | @@ -129,6 +133,11 @@ public class Device { | ||
| 129 | */ | 133 | */ |
| 130 | private boolean ssrcCheck; | 134 | private boolean ssrcCheck; |
| 131 | 135 | ||
| 136 | + /** | ||
| 137 | + * 地理坐标系, 目前支持 WGS84,GCJ02 TODO CGCS2000 | ||
| 138 | + */ | ||
| 139 | + private String geoCoordSys; | ||
| 140 | + | ||
| 132 | 141 | ||
| 133 | public String getDeviceId() { | 142 | public String getDeviceId() { |
| 134 | return deviceId; | 143 | return deviceId; |
| @@ -321,4 +330,12 @@ public class Device { | @@ -321,4 +330,12 @@ public class Device { | ||
| 321 | public void setSsrcCheck(boolean ssrcCheck) { | 330 | public void setSsrcCheck(boolean ssrcCheck) { |
| 322 | this.ssrcCheck = ssrcCheck; | 331 | this.ssrcCheck = ssrcCheck; |
| 323 | } | 332 | } |
| 333 | + | ||
| 334 | + public String getGeoCoordSys() { | ||
| 335 | + return geoCoordSys; | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + public void setGeoCoordSys(String geoCoordSys) { | ||
| 339 | + this.geoCoordSys = geoCoordSys; | ||
| 340 | + } | ||
| 324 | } | 341 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java
| @@ -155,6 +155,26 @@ public class DeviceChannel { | @@ -155,6 +155,26 @@ public class DeviceChannel { | ||
| 155 | private double latitude; | 155 | private double latitude; |
| 156 | 156 | ||
| 157 | /** | 157 | /** |
| 158 | + * 经度 GCJ02 | ||
| 159 | + */ | ||
| 160 | + private double longitudeGcj02; | ||
| 161 | + | ||
| 162 | + /** | ||
| 163 | + * 纬度 GCJ02 | ||
| 164 | + */ | ||
| 165 | + private double latitudeGcj02; | ||
| 166 | + | ||
| 167 | + /** | ||
| 168 | + * 经度 WGS84 | ||
| 169 | + */ | ||
| 170 | + private double longitudeWgs84; | ||
| 171 | + | ||
| 172 | + /** | ||
| 173 | + * 纬度 WGS84 | ||
| 174 | + */ | ||
| 175 | + private double latitudeWgs84; | ||
| 176 | + | ||
| 177 | + /** | ||
| 158 | * 子设备数 | 178 | * 子设备数 |
| 159 | */ | 179 | */ |
| 160 | private int subCount; | 180 | private int subCount; |
| @@ -407,6 +427,38 @@ public class DeviceChannel { | @@ -407,6 +427,38 @@ public class DeviceChannel { | ||
| 407 | this.latitude = latitude; | 427 | this.latitude = latitude; |
| 408 | } | 428 | } |
| 409 | 429 | ||
| 430 | + public double getLongitudeGcj02() { | ||
| 431 | + return longitudeGcj02; | ||
| 432 | + } | ||
| 433 | + | ||
| 434 | + public void setLongitudeGcj02(double longitudeGcj02) { | ||
| 435 | + this.longitudeGcj02 = longitudeGcj02; | ||
| 436 | + } | ||
| 437 | + | ||
| 438 | + public double getLatitudeGcj02() { | ||
| 439 | + return latitudeGcj02; | ||
| 440 | + } | ||
| 441 | + | ||
| 442 | + public void setLatitudeGcj02(double latitudeGcj02) { | ||
| 443 | + this.latitudeGcj02 = latitudeGcj02; | ||
| 444 | + } | ||
| 445 | + | ||
| 446 | + public double getLongitudeWgs84() { | ||
| 447 | + return longitudeWgs84; | ||
| 448 | + } | ||
| 449 | + | ||
| 450 | + public void setLongitudeWgs84(double longitudeWgs84) { | ||
| 451 | + this.longitudeWgs84 = longitudeWgs84; | ||
| 452 | + } | ||
| 453 | + | ||
| 454 | + public double getLatitudeWgs84() { | ||
| 455 | + return latitudeWgs84; | ||
| 456 | + } | ||
| 457 | + | ||
| 458 | + public void setLatitudeWgs84(double latitudeWgs84) { | ||
| 459 | + this.latitudeWgs84 = latitudeWgs84; | ||
| 460 | + } | ||
| 461 | + | ||
| 410 | public int getSubCount() { | 462 | public int getSubCount() { |
| 411 | return subCount; | 463 | return subCount; |
| 412 | } | 464 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| @@ -277,8 +277,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -277,8 +277,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 277 | catalogXml.append("<Owner>" + channel.getOwner() + "</Owner>\r\n"); | 277 | catalogXml.append("<Owner>" + channel.getOwner() + "</Owner>\r\n"); |
| 278 | catalogXml.append("<CivilCode>" + channel.getCivilCode() + "</CivilCode>\r\n"); | 278 | catalogXml.append("<CivilCode>" + channel.getCivilCode() + "</CivilCode>\r\n"); |
| 279 | catalogXml.append("<Address>" + channel.getAddress() + "</Address>\r\n"); | 279 | catalogXml.append("<Address>" + channel.getAddress() + "</Address>\r\n"); |
| 280 | - catalogXml.append("<Longitude>" + channel.getLongitude() + "</Longitude>\r\n"); | ||
| 281 | - catalogXml.append("<Latitude>" + channel.getLatitude() + "</Latitude>\r\n"); | 280 | + catalogXml.append("<Longitude>" + channel.getLongitudeWgs84() + "</Longitude>\r\n"); |
| 281 | + catalogXml.append("<Latitude>" + channel.getLatitudeWgs84() + "</Latitude>\r\n"); | ||
| 282 | catalogXml.append("<IPAddress>" + channel.getIpAddress() + "</IPAddress>\r\n"); | 282 | catalogXml.append("<IPAddress>" + channel.getIpAddress() + "</IPAddress>\r\n"); |
| 283 | catalogXml.append("<Port>" + channel.getPort() + "</Port>\r\n"); | 283 | catalogXml.append("<Port>" + channel.getPort() + "</Port>\r\n"); |
| 284 | catalogXml.append("<Info>\r\n"); | 284 | catalogXml.append("<Info>\r\n"); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorAbstract.java deleted
100644 → 0
| 1 | -package com.genersoft.iot.vmp.gb28181.transmit.event.request; | ||
| 2 | - | ||
| 3 | -import gov.nist.javax.sip.SipProviderImpl; | ||
| 4 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 5 | -import org.springframework.beans.factory.annotation.Qualifier; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * @description:处理接收IPCamera发来的SIP协议请求消息 | ||
| 9 | - * @author: songww | ||
| 10 | - * @date: 2020年5月3日 下午4:42:22 | ||
| 11 | - */ | ||
| 12 | -public abstract class SIPRequestProcessorAbstract { | ||
| 13 | - | ||
| 14 | - | ||
| 15 | - @Autowired | ||
| 16 | - @Qualifier(value="tcpSipProvider") | ||
| 17 | - private SipProviderImpl tcpSipProvider; | ||
| 18 | - | ||
| 19 | - @Autowired | ||
| 20 | - @Qualifier(value="udpSipProvider") | ||
| 21 | - private SipProviderImpl udpSipProvider; | ||
| 22 | - | ||
| 23 | -} |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
| @@ -312,7 +312,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements | @@ -312,7 +312,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements | ||
| 312 | }else { | 312 | }else { |
| 313 | event = eventElement.getText().toUpperCase(); | 313 | event = eventElement.getText().toUpperCase(); |
| 314 | } | 314 | } |
| 315 | - DeviceChannel channel = XmlUtil.channelContentHander(itemDevice); | 315 | + DeviceChannel channel = XmlUtil.channelContentHander(itemDevice, device); |
| 316 | channel.setDeviceId(device.getDeviceId()); | 316 | channel.setDeviceId(device.getDeviceId()); |
| 317 | logger.info("[收到 目录订阅]:{}/{}", device.getDeviceId(), channel.getChannelId()); | 317 | logger.info("[收到 目录订阅]:{}/{}", device.getDeviceId(), channel.getChannelId()); |
| 318 | switch (event) { | 318 | switch (event) { |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java
| @@ -140,6 +140,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | @@ -140,6 +140,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | ||
| 140 | device = new Device(); | 140 | device = new Device(); |
| 141 | device.setStreamMode("UDP"); | 141 | device.setStreamMode("UDP"); |
| 142 | device.setCharset("GB2312"); | 142 | device.setCharset("GB2312"); |
| 143 | + device.setGeoCoordSys("WGS84"); | ||
| 143 | device.setDeviceId(deviceId); | 144 | device.setDeviceId(deviceId); |
| 144 | } | 145 | } |
| 145 | device.setIp(received); | 146 | device.setIp(received); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java
| @@ -82,7 +82,6 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme | @@ -82,7 +82,6 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme | ||
| 82 | @Override | 82 | @Override |
| 83 | public void process(RequestEvent evt) { | 83 | public void process(RequestEvent evt) { |
| 84 | Request request = evt.getRequest(); | 84 | Request request = evt.getRequest(); |
| 85 | - System.out.println("收到订阅"); | ||
| 86 | try { | 85 | try { |
| 87 | Element rootElement = getRootElement(evt); | 86 | Element rootElement = getRootElement(evt); |
| 88 | String cmd = XmlUtil.getText(rootElement, "CmdType"); | 87 | String cmd = XmlUtil.getText(rootElement, "CmdType"); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java
| @@ -129,7 +129,7 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp | @@ -129,7 +129,7 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp | ||
| 129 | // if (NumericUtil.isDouble(XmlUtil.getText(itemDevice, "Longitude"))) {//如果包含位置信息,就更新一下位置 | 129 | // if (NumericUtil.isDouble(XmlUtil.getText(itemDevice, "Longitude"))) {//如果包含位置信息,就更新一下位置 |
| 130 | // processNotifyMobilePosition(evt, itemDevice); | 130 | // processNotifyMobilePosition(evt, itemDevice); |
| 131 | // } | 131 | // } |
| 132 | - DeviceChannel deviceChannel = XmlUtil.channelContentHander(itemDevice); | 132 | + DeviceChannel deviceChannel = XmlUtil.channelContentHander(itemDevice, device); |
| 133 | deviceChannel.setDeviceId(take.getDevice().getDeviceId()); | 133 | deviceChannel.setDeviceId(take.getDevice().getDeviceId()); |
| 134 | 134 | ||
| 135 | channelList.add(deviceChannel); | 135 | channelList.add(deviceChannel); |
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
| @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.gb28181.utils; | @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.gb28181.utils; | ||
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSONArray; | 3 | import com.alibaba.fastjson.JSONArray; |
| 4 | import com.alibaba.fastjson.JSONObject; | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | +import com.genersoft.iot.vmp.gb28181.bean.Device; | ||
| 5 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; | 6 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| 6 | import org.dom4j.Attribute; | 7 | import org.dom4j.Attribute; |
| 7 | import org.dom4j.Document; | 8 | import org.dom4j.Document; |
| @@ -180,7 +181,7 @@ public class XmlUtil { | @@ -180,7 +181,7 @@ public class XmlUtil { | ||
| 180 | return xml.getRootElement(); | 181 | return xml.getRootElement(); |
| 181 | } | 182 | } |
| 182 | 183 | ||
| 183 | - public static DeviceChannel channelContentHander(Element itemDevice){ | 184 | + public static DeviceChannel channelContentHander(Element itemDevice, Device device){ |
| 184 | Element channdelNameElement = itemDevice.element("Name"); | 185 | Element channdelNameElement = itemDevice.element("Name"); |
| 185 | String channelName = channdelNameElement != null ? channdelNameElement.getTextTrim().toString() : ""; | 186 | String channelName = channdelNameElement != null ? channdelNameElement.getTextTrim().toString() : ""; |
| 186 | Element statusElement = itemDevice.element("Status"); | 187 | Element statusElement = itemDevice.element("Status"); |
| @@ -308,6 +309,31 @@ public class XmlUtil { | @@ -308,6 +309,31 @@ public class XmlUtil { | ||
| 308 | } else { | 309 | } else { |
| 309 | deviceChannel.setLatitude(0.00); | 310 | deviceChannel.setLatitude(0.00); |
| 310 | } | 311 | } |
| 312 | + if (deviceChannel.getLongitude()*deviceChannel.getLatitude() > 0) { | ||
| 313 | + if ("WGS84".equals(device.getGeoCoordSys())) { | ||
| 314 | + deviceChannel.setLongitudeWgs84(deviceChannel.getLongitude()); | ||
| 315 | + deviceChannel.setLatitudeWgs84(deviceChannel.getLatitude()); | ||
| 316 | + Double[] position = Coordtransform.WGS84ToGCJ02(deviceChannel.getLongitude(), deviceChannel.getLatitude()); | ||
| 317 | + deviceChannel.setLongitudeGcj02(position[0]); | ||
| 318 | + deviceChannel.setLatitudeGcj02(position[1]); | ||
| 319 | + }else if ("GCJ02".equals(device.getGeoCoordSys())) { | ||
| 320 | + deviceChannel.setLongitudeGcj02(deviceChannel.getLongitude()); | ||
| 321 | + deviceChannel.setLatitudeGcj02(deviceChannel.getLatitude()); | ||
| 322 | + Double[] position = Coordtransform.GCJ02ToWGS84(deviceChannel.getLongitude(), deviceChannel.getLatitude()); | ||
| 323 | + deviceChannel.setLongitudeWgs84(position[0]); | ||
| 324 | + deviceChannel.setLatitudeWgs84(position[1]); | ||
| 325 | + }else { | ||
| 326 | + deviceChannel.setLongitudeGcj02(0.00); | ||
| 327 | + deviceChannel.setLatitudeGcj02(0.00); | ||
| 328 | + deviceChannel.setLongitudeWgs84(0.00); | ||
| 329 | + deviceChannel.setLatitudeWgs84(0.00); | ||
| 330 | + } | ||
| 331 | + }else { | ||
| 332 | + deviceChannel.setLongitudeGcj02(deviceChannel.getLongitude()); | ||
| 333 | + deviceChannel.setLatitudeGcj02(deviceChannel.getLatitude()); | ||
| 334 | + deviceChannel.setLongitudeWgs84(deviceChannel.getLongitude()); | ||
| 335 | + deviceChannel.setLatitudeWgs84(deviceChannel.getLatitude()); | ||
| 336 | + } | ||
| 311 | if (XmlUtil.getText(itemDevice, "PTZType") == null || "".equals(XmlUtil.getText(itemDevice, "PTZType"))) { | 337 | if (XmlUtil.getText(itemDevice, "PTZType") == null || "".equals(XmlUtil.getText(itemDevice, "PTZType"))) { |
| 312 | //兼容INFO中的信息 | 338 | //兼容INFO中的信息 |
| 313 | Element info = itemDevice.element("Info"); | 339 | Element info = itemDevice.element("Info"); |
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
| @@ -2,17 +2,21 @@ package com.genersoft.iot.vmp.service.impl; | @@ -2,17 +2,21 @@ package com.genersoft.iot.vmp.service.impl; | ||
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.conf.DynamicTask; | 3 | import com.genersoft.iot.vmp.conf.DynamicTask; |
| 4 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 4 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 5 | +import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; | ||
| 5 | import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; | 6 | import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; |
| 6 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; | 7 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 7 | import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask; | 8 | import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask; |
| 8 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; | 9 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; |
| 9 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd.CatalogResponseMessageHandler; | 10 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd.CatalogResponseMessageHandler; |
| 11 | +import com.genersoft.iot.vmp.gb28181.utils.Coordtransform; | ||
| 10 | import com.genersoft.iot.vmp.service.IDeviceService; | 12 | import com.genersoft.iot.vmp.service.IDeviceService; |
| 11 | import com.genersoft.iot.vmp.gb28181.task.impl.CatalogSubscribeTask; | 13 | import com.genersoft.iot.vmp.gb28181.task.impl.CatalogSubscribeTask; |
| 12 | import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeTask; | 14 | import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeTask; |
| 13 | import com.genersoft.iot.vmp.gb28181.bean.SyncStatus; | 15 | import com.genersoft.iot.vmp.gb28181.bean.SyncStatus; |
| 14 | import com.genersoft.iot.vmp.service.IMediaServerService; | 16 | import com.genersoft.iot.vmp.service.IMediaServerService; |
| 15 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 17 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 18 | +import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | ||
| 19 | +import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper; | ||
| 16 | import com.genersoft.iot.vmp.storager.dao.DeviceMapper; | 20 | import com.genersoft.iot.vmp.storager.dao.DeviceMapper; |
| 17 | import com.genersoft.iot.vmp.utils.DateUtil; | 21 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 18 | import org.slf4j.Logger; | 22 | import org.slf4j.Logger; |
| @@ -51,6 +55,12 @@ public class DeviceServiceImpl implements IDeviceService { | @@ -51,6 +55,12 @@ public class DeviceServiceImpl implements IDeviceService { | ||
| 51 | private DeviceMapper deviceMapper; | 55 | private DeviceMapper deviceMapper; |
| 52 | 56 | ||
| 53 | @Autowired | 57 | @Autowired |
| 58 | + private DeviceChannelMapper deviceChannelMapper; | ||
| 59 | + | ||
| 60 | + @Autowired | ||
| 61 | + private IVideoManagerStorage storage; | ||
| 62 | + | ||
| 63 | + @Autowired | ||
| 54 | private ISIPCommander commander; | 64 | private ISIPCommander commander; |
| 55 | 65 | ||
| 56 | @Autowired | 66 | @Autowired |
| @@ -292,6 +302,10 @@ public class DeviceServiceImpl implements IDeviceService { | @@ -292,6 +302,10 @@ public class DeviceServiceImpl implements IDeviceService { | ||
| 292 | removeMobilePositionSubscribe(deviceInStore); | 302 | removeMobilePositionSubscribe(deviceInStore); |
| 293 | } | 303 | } |
| 294 | } | 304 | } |
| 305 | + // 坐标系变化,需要重新计算GCJ02坐标和WGS84坐标 | ||
| 306 | + if (!deviceInStore.getGeoCoordSys().equals(device.getGeoCoordSys())) { | ||
| 307 | + updateDeviceChannelGeoCoordSys(device); | ||
| 308 | + } | ||
| 295 | 309 | ||
| 296 | String now = DateUtil.getNow(); | 310 | String now = DateUtil.getNow(); |
| 297 | device.setUpdateTime(now); | 311 | device.setUpdateTime(now); |
| @@ -299,6 +313,32 @@ public class DeviceServiceImpl implements IDeviceService { | @@ -299,6 +313,32 @@ public class DeviceServiceImpl implements IDeviceService { | ||
| 299 | device.setUpdateTime(DateUtil.getNow()); | 313 | device.setUpdateTime(DateUtil.getNow()); |
| 300 | if (deviceMapper.update(device) > 0) { | 314 | if (deviceMapper.update(device) > 0) { |
| 301 | redisCatchStorage.updateDevice(device); | 315 | redisCatchStorage.updateDevice(device); |
| 316 | + | ||
| 302 | } | 317 | } |
| 303 | } | 318 | } |
| 319 | + | ||
| 320 | + /** | ||
| 321 | + * 更新通道坐标系 | ||
| 322 | + */ | ||
| 323 | + private void updateDeviceChannelGeoCoordSys(Device device) { | ||
| 324 | + List<DeviceChannel> deviceChannels = deviceChannelMapper.getAllChannelWithCoordinate(device.getDeviceId()); | ||
| 325 | + if (deviceChannels.size() > 0) { | ||
| 326 | + for (DeviceChannel deviceChannel : deviceChannels) { | ||
| 327 | + if ("WGS84".equals(device.getGeoCoordSys())) { | ||
| 328 | + deviceChannel.setLongitudeWgs84(deviceChannel.getLongitude()); | ||
| 329 | + deviceChannel.setLatitudeWgs84(deviceChannel.getLatitude()); | ||
| 330 | + Double[] position = Coordtransform.WGS84ToGCJ02(deviceChannel.getLongitude(), deviceChannel.getLatitude()); | ||
| 331 | + deviceChannel.setLongitudeGcj02(position[0]); | ||
| 332 | + deviceChannel.setLatitudeGcj02(position[1]); | ||
| 333 | + }else if ("GCJ02".equals(device.getGeoCoordSys())) { | ||
| 334 | + deviceChannel.setLongitudeGcj02(deviceChannel.getLongitude()); | ||
| 335 | + deviceChannel.setLatitudeGcj02(deviceChannel.getLatitude()); | ||
| 336 | + Double[] position = Coordtransform.GCJ02ToWGS84(deviceChannel.getLongitude(), deviceChannel.getLatitude()); | ||
| 337 | + deviceChannel.setLongitudeWgs84(position[0]); | ||
| 338 | + deviceChannel.setLatitudeWgs84(position[1]); | ||
| 339 | + } | ||
| 340 | + } | ||
| 341 | + } | ||
| 342 | + storage.updateChannels(device.getDeviceId(), deviceChannels); | ||
| 343 | + } | ||
| 304 | } | 344 | } |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
| @@ -17,10 +17,10 @@ public interface DeviceChannelMapper { | @@ -17,10 +17,10 @@ public interface DeviceChannelMapper { | ||
| 17 | 17 | ||
| 18 | @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " + | 18 | @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " + |
| 19 | "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + | 19 | "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + |
| 20 | - "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, createTime, updateTime) " + | 20 | + "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, longitudeWgs84, latitudeWgs84, createTime, updateTime) " + |
| 21 | "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," + | 21 | "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," + |
| 22 | "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " + | 22 | "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " + |
| 23 | - "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude},'${createTime}', '${updateTime}')") | 23 | + "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, ${longitudeGcj02}, ${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84},'${createTime}', '${updateTime}')") |
| 24 | int add(DeviceChannel channel); | 24 | int add(DeviceChannel channel); |
| 25 | 25 | ||
| 26 | @Update(value = {" <script>" + | 26 | @Update(value = {" <script>" + |
| @@ -50,6 +50,10 @@ public interface DeviceChannelMapper { | @@ -50,6 +50,10 @@ public interface DeviceChannelMapper { | ||
| 50 | "<if test='hasAudio != null'>, hasAudio=${hasAudio}</if>" + | 50 | "<if test='hasAudio != null'>, hasAudio=${hasAudio}</if>" + |
| 51 | "<if test='longitude != null'>, longitude=${longitude}</if>" + | 51 | "<if test='longitude != null'>, longitude=${longitude}</if>" + |
| 52 | "<if test='latitude != null'>, latitude=${latitude}</if>" + | 52 | "<if test='latitude != null'>, latitude=${latitude}</if>" + |
| 53 | + "<if test='longitudeGcj02 != null'>, longitudeGcj02=${longitudeGcj02}</if>" + | ||
| 54 | + "<if test='latitudeGcj02 != null'>, latitudeGcj02=${latitudeGcj02}</if>" + | ||
| 55 | + "<if test='longitudeWgs84 != null'>, longitudeWgs84=${longitudeWgs84}</if>" + | ||
| 56 | + "<if test='latitudeWgs84 != null'>, latitudeWgs84=${latitudeWgs84}</if>" + | ||
| 53 | "WHERE deviceId='${deviceId}' AND channelId='${channelId}'"+ | 57 | "WHERE deviceId='${deviceId}' AND channelId='${channelId}'"+ |
| 54 | " </script>"}) | 58 | " </script>"}) |
| 55 | int update(DeviceChannel channel); | 59 | int update(DeviceChannel channel); |
| @@ -138,7 +142,8 @@ public interface DeviceChannelMapper { | @@ -138,7 +142,8 @@ public interface DeviceChannelMapper { | ||
| 138 | "insert into device_channel " + | 142 | "insert into device_channel " + |
| 139 | "(channelId, deviceId, name, manufacture, model, owner, civilCode, block, subCount, " + | 143 | "(channelId, deviceId, name, manufacture, model, owner, civilCode, block, subCount, " + |
| 140 | " address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + | 144 | " address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + |
| 141 | - " ipAddress, port, password, PTZType, status, streamId, longitude, latitude, createTime, updateTime) " + | 145 | + " ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " + |
| 146 | + " longitudeWgs84, latitudeWgs84, createTime, updateTime) " + | ||
| 142 | "values " + | 147 | "values " + |
| 143 | "<foreach collection='addChannels' index='index' item='item' separator=','> " + | 148 | "<foreach collection='addChannels' index='index' item='item' separator=','> " + |
| 144 | "('${item.channelId}', '${item.deviceId}', '${item.name}', '${item.manufacture}', '${item.model}', " + | 149 | "('${item.channelId}', '${item.deviceId}', '${item.name}', '${item.manufacture}', '${item.model}', " + |
| @@ -146,7 +151,8 @@ public interface DeviceChannelMapper { | @@ -146,7 +151,8 @@ public interface DeviceChannelMapper { | ||
| 146 | "'${item.address}', ${item.parental}, '${item.parentId}', ${item.safetyWay}, ${item.registerWay}, " + | 151 | "'${item.address}', ${item.parental}, '${item.parentId}', ${item.safetyWay}, ${item.registerWay}, " + |
| 147 | "'${item.certNum}', ${item.certifiable}, ${item.errCode}, '${item.secrecy}', " + | 152 | "'${item.certNum}', ${item.certifiable}, ${item.errCode}, '${item.secrecy}', " + |
| 148 | "'${item.ipAddress}', ${item.port}, '${item.password}', ${item.PTZType}, ${item.status}, " + | 153 | "'${item.ipAddress}', ${item.port}, '${item.password}', ${item.PTZType}, ${item.status}, " + |
| 149 | - "'${item.streamId}', ${item.longitude}, ${item.latitude},'${item.createTime}', '${item.updateTime}')" + | 154 | + "'${item.streamId}', ${item.longitude}, ${item.latitude},${item.longitudeGcj02}, " + |
| 155 | + "${item.latitudeGcj02},${item.longitudeWgs84}, ${item.latitudeWgs84},'${item.createTime}', '${item.updateTime}')" + | ||
| 150 | "</foreach> " + | 156 | "</foreach> " + |
| 151 | "ON DUPLICATE KEY UPDATE " + | 157 | "ON DUPLICATE KEY UPDATE " + |
| 152 | "updateTime=VALUES(updateTime), " + | 158 | "updateTime=VALUES(updateTime), " + |
| @@ -173,7 +179,11 @@ public interface DeviceChannelMapper { | @@ -173,7 +179,11 @@ public interface DeviceChannelMapper { | ||
| 173 | "status=VALUES(status), " + | 179 | "status=VALUES(status), " + |
| 174 | "streamId=VALUES(streamId), " + | 180 | "streamId=VALUES(streamId), " + |
| 175 | "longitude=VALUES(longitude), " + | 181 | "longitude=VALUES(longitude), " + |
| 176 | - "latitude=VALUES(latitude)" + | 182 | + "latitude=VALUES(latitude), " + |
| 183 | + "longitudeGcj02=VALUES(longitudeGcj02), " + | ||
| 184 | + "latitudeGcj02=VALUES(latitudeGcj02), " + | ||
| 185 | + "longitudeWgs84=VALUES(longitudeWgs84), " + | ||
| 186 | + "latitudeWgs84=VALUES(latitudeWgs84) " + | ||
| 177 | "</script>") | 187 | "</script>") |
| 178 | int batchAdd(List<DeviceChannel> addChannels); | 188 | int batchAdd(List<DeviceChannel> addChannels); |
| 179 | 189 | ||
| @@ -207,7 +217,11 @@ public interface DeviceChannelMapper { | @@ -207,7 +217,11 @@ public interface DeviceChannelMapper { | ||
| 207 | "<if test='item.hasAudio != null'>, hasAudio=${item.hasAudio}</if>" + | 217 | "<if test='item.hasAudio != null'>, hasAudio=${item.hasAudio}</if>" + |
| 208 | "<if test='item.longitude != null'>, longitude=${item.longitude}</if>" + | 218 | "<if test='item.longitude != null'>, longitude=${item.longitude}</if>" + |
| 209 | "<if test='item.latitude != null'>, latitude=${item.latitude}</if>" + | 219 | "<if test='item.latitude != null'>, latitude=${item.latitude}</if>" + |
| 210 | - "WHERE deviceId=#{item.deviceId} AND channelId=#{item.channelId}"+ | 220 | + "<if test='item.longitudeGcj02 != null'>, longitudeGcj02=${item.longitudeGcj02}</if>" + |
| 221 | + "<if test='item.latitudeGcj02 != null'>, latitudeGcj02=${item.latitudeGcj02}</if>" + | ||
| 222 | + "<if test='item.longitudeWgs84 != null'>, longitudeWgs84=${item.longitudeWgs84}</if>" + | ||
| 223 | + "<if test='item.latitudeWgs84 != null'>, latitudeWgs84=${item.latitudeWgs84}</if>" + | ||
| 224 | + "WHERE deviceId='${item.deviceId}' AND channelId='${item.channelId}'"+ | ||
| 211 | "</foreach>" + | 225 | "</foreach>" + |
| 212 | "</script>"}) | 226 | "</script>"}) |
| 213 | int batchUpdate(List<DeviceChannel> updateChannels); | 227 | int batchUpdate(List<DeviceChannel> updateChannels); |
| @@ -261,4 +275,6 @@ public interface DeviceChannelMapper { | @@ -261,4 +275,6 @@ public interface DeviceChannelMapper { | ||
| 261 | @Select("SELECT * FROM device_channel WHERE length(trim(streamId)) > 0") | 275 | @Select("SELECT * FROM device_channel WHERE length(trim(streamId)) > 0") |
| 262 | List<DeviceChannel> getAllChannelInPlay(); | 276 | List<DeviceChannel> getAllChannelInPlay(); |
| 263 | 277 | ||
| 278 | + @Select("select * from device_channel where longitude*latitude > 0 and deviceId = #{deviceId}") | ||
| 279 | + List<DeviceChannel> getAllChannelWithCoordinate(String deviceId); | ||
| 264 | } | 280 | } |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
| @@ -38,6 +38,7 @@ public interface DeviceMapper { | @@ -38,6 +38,7 @@ public interface DeviceMapper { | ||
| 38 | "mobilePositionSubmissionInterval," + | 38 | "mobilePositionSubmissionInterval," + |
| 39 | "subscribeCycleForAlarm," + | 39 | "subscribeCycleForAlarm," + |
| 40 | "ssrcCheck," + | 40 | "ssrcCheck," + |
| 41 | + "geoCoordSys," + | ||
| 41 | "online" + | 42 | "online" + |
| 42 | ") VALUES (" + | 43 | ") VALUES (" + |
| 43 | "#{deviceId}," + | 44 | "#{deviceId}," + |
| @@ -61,6 +62,7 @@ public interface DeviceMapper { | @@ -61,6 +62,7 @@ public interface DeviceMapper { | ||
| 61 | "#{mobilePositionSubmissionInterval}," + | 62 | "#{mobilePositionSubmissionInterval}," + |
| 62 | "#{subscribeCycleForAlarm}," + | 63 | "#{subscribeCycleForAlarm}," + |
| 63 | "#{ssrcCheck}," + | 64 | "#{ssrcCheck}," + |
| 65 | + "#{geoCoordSys}," + | ||
| 64 | "#{online}" + | 66 | "#{online}" + |
| 65 | ")") | 67 | ")") |
| 66 | int add(Device device); | 68 | int add(Device device); |
| @@ -87,6 +89,7 @@ public interface DeviceMapper { | @@ -87,6 +89,7 @@ public interface DeviceMapper { | ||
| 87 | "<if test=\"mobilePositionSubmissionInterval != null\">, mobilePositionSubmissionInterval=${mobilePositionSubmissionInterval}</if>" + | 89 | "<if test=\"mobilePositionSubmissionInterval != null\">, mobilePositionSubmissionInterval=${mobilePositionSubmissionInterval}</if>" + |
| 88 | "<if test=\"subscribeCycleForAlarm != null\">, subscribeCycleForAlarm=${subscribeCycleForAlarm}</if>" + | 90 | "<if test=\"subscribeCycleForAlarm != null\">, subscribeCycleForAlarm=${subscribeCycleForAlarm}</if>" + |
| 89 | "<if test=\"ssrcCheck != null\">, ssrcCheck=${ssrcCheck}</if>" + | 91 | "<if test=\"ssrcCheck != null\">, ssrcCheck=${ssrcCheck}</if>" + |
| 92 | + "<if test=\"geoCoordSys != null\">, geoCoordSys=#{geoCoordSys}</if>" + | ||
| 90 | "WHERE deviceId='${deviceId}'"+ | 93 | "WHERE deviceId='${deviceId}'"+ |
| 91 | " </script>"}) | 94 | " </script>"}) |
| 92 | int update(Device device); | 95 | int update(Device device); |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
| @@ -317,12 +317,7 @@ public class DeviceQuery { | @@ -317,12 +317,7 @@ public class DeviceQuery { | ||
| 317 | public ResponseEntity<WVPResult<String>> updateDevice(Device device){ | 317 | public ResponseEntity<WVPResult<String>> updateDevice(Device device){ |
| 318 | 318 | ||
| 319 | if (device != null && device.getDeviceId() != null) { | 319 | if (device != null && device.getDeviceId() != null) { |
| 320 | - | ||
| 321 | - | ||
| 322 | - // TODO 报警订阅相关的信息 | ||
| 323 | - | ||
| 324 | deviceService.updateDevice(device); | 320 | deviceService.updateDevice(device); |
| 325 | -// cmder.deviceInfoQuery(device); | ||
| 326 | } | 321 | } |
| 327 | WVPResult<String> result = new WVPResult<>(); | 322 | WVPResult<String> result = new WVPResult<>(); |
| 328 | result.setCode(0); | 323 | result.setCode(0); |
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
| @@ -146,8 +146,8 @@ public class ApiDeviceController { | @@ -146,8 +146,8 @@ public class ApiDeviceController { | ||
| 146 | // 2-基于口令的双向认证, | 146 | // 2-基于口令的双向认证, |
| 147 | // 3-基于数字证书的双向认证 | 147 | // 3-基于数字证书的双向认证 |
| 148 | deviceJOSNChannel.put("Status", deviceChannel.getStatus()); | 148 | deviceJOSNChannel.put("Status", deviceChannel.getStatus()); |
| 149 | - deviceJOSNChannel.put("Longitude", deviceChannel.getLongitude()); | ||
| 150 | - deviceJOSNChannel.put("Latitude", deviceChannel.getLatitude()); | 149 | + deviceJOSNChannel.put("Longitude", deviceChannel.getLongitudeWgs84()); |
| 150 | + deviceJOSNChannel.put("Latitude", deviceChannel.getLatitudeWgs84()); | ||
| 151 | deviceJOSNChannel.put("PTZType ", deviceChannel.getPTZType()); // 云台类型, 0 - 未知, 1 - 球机, 2 - 半球, | 151 | deviceJOSNChannel.put("PTZType ", deviceChannel.getPTZType()); // 云台类型, 0 - 未知, 1 - 球机, 2 - 半球, |
| 152 | // 3 - 固定枪机, 4 - 遥控枪机 | 152 | // 3 - 固定枪机, 4 - 遥控枪机 |
| 153 | deviceJOSNChannel.put("CustomPTZType", ""); | 153 | deviceJOSNChannel.put("CustomPTZType", ""); |
src/main/resources/all-application.yml
| @@ -32,7 +32,7 @@ spring: | @@ -32,7 +32,7 @@ spring: | ||
| 32 | datasource: | 32 | datasource: |
| 33 | type: com.alibaba.druid.pool.DruidDataSource | 33 | type: com.alibaba.druid.pool.DruidDataSource |
| 34 | driver-class-name: com.mysql.cj.jdbc.Driver | 34 | driver-class-name: com.mysql.cj.jdbc.Driver |
| 35 | - url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false | 35 | + url: jdbc:mysql://127.0.0.1:3306/wvp2?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true |
| 36 | username: root | 36 | username: root |
| 37 | password: root123 | 37 | password: root123 |
| 38 | druid: | 38 | druid: |
src/main/resources/application-dev.yml
| @@ -20,7 +20,7 @@ spring: | @@ -20,7 +20,7 @@ spring: | ||
| 20 | datasource: | 20 | datasource: |
| 21 | type: com.alibaba.druid.pool.DruidDataSource | 21 | type: com.alibaba.druid.pool.DruidDataSource |
| 22 | driver-class-name: com.mysql.cj.jdbc.Driver | 22 | driver-class-name: com.mysql.cj.jdbc.Driver |
| 23 | - url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false | 23 | + url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true |
| 24 | username: root | 24 | username: root |
| 25 | password: 123456 | 25 | password: 123456 |
| 26 | druid: | 26 | druid: |
src/main/resources/application-docker.yml
| @@ -20,7 +20,7 @@ spring: | @@ -20,7 +20,7 @@ spring: | ||
| 20 | datasource: | 20 | datasource: |
| 21 | # 使用mysql 打开23-28行注释, 删除29-36行 | 21 | # 使用mysql 打开23-28行注释, 删除29-36行 |
| 22 | name: wvp | 22 | name: wvp |
| 23 | - url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false | 23 | + url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&allowMultiQueries=true |
| 24 | username: root | 24 | username: root |
| 25 | password: root | 25 | password: root |
| 26 | type: com.alibaba.druid.pool.DruidDataSource | 26 | type: com.alibaba.druid.pool.DruidDataSource |
web_src/src/components/dialog/deviceEdit.vue
| @@ -36,6 +36,12 @@ | @@ -36,6 +36,12 @@ | ||
| 36 | <el-option key="UTF-8" label="UTF-8" value="utf-8"></el-option> | 36 | <el-option key="UTF-8" label="UTF-8" value="utf-8"></el-option> |
| 37 | </el-select> | 37 | </el-select> |
| 38 | </el-form-item> | 38 | </el-form-item> |
| 39 | + <el-form-item label="地理坐标系" prop="geoCoordSys" > | ||
| 40 | + <el-select v-model="form.geoCoordSys" style="float: left; width: 100%" > | ||
| 41 | + <el-option key="GCJ02" label="GCJ02" value="GCJ02"></el-option> | ||
| 42 | + <el-option key="WGS84" label="WGS84" value="WGS84"></el-option> | ||
| 43 | + </el-select> | ||
| 44 | + </el-form-item> | ||
| 39 | <el-form-item label="目录订阅" title="0为取消订阅" prop="subscribeCycleForCatalog" > | 45 | <el-form-item label="目录订阅" title="0为取消订阅" prop="subscribeCycleForCatalog" > |
| 40 | <el-input v-model="form.subscribeCycleForCatalog" clearable ></el-input> | 46 | <el-input v-model="form.subscribeCycleForCatalog" clearable ></el-input> |
| 41 | </el-form-item> | 47 | </el-form-item> |
web_src/src/components/devicePosition.vue renamed to web_src/src/components/map.vue
| @@ -49,7 +49,7 @@ import devicePlayer from './dialog/devicePlayer.vue' | @@ -49,7 +49,7 @@ import devicePlayer from './dialog/devicePlayer.vue' | ||
| 49 | import queryTrace from './dialog/queryTrace.vue' | 49 | import queryTrace from './dialog/queryTrace.vue' |
| 50 | 50 | ||
| 51 | export default { | 51 | export default { |
| 52 | - name: "devicePosition", | 52 | + name: "map", |
| 53 | components: { | 53 | components: { |
| 54 | MapComponent, | 54 | MapComponent, |
| 55 | DeviceTree, | 55 | DeviceTree, |
| @@ -183,12 +183,27 @@ export default { | @@ -183,12 +183,27 @@ export default { | ||
| 183 | this.clean() | 183 | this.clean() |
| 184 | this.closeInfoBox() | 184 | this.closeInfoBox() |
| 185 | let params = []; | 185 | let params = []; |
| 186 | + let longitudeStr; | ||
| 187 | + let latitudeStr; | ||
| 188 | + if (window.mapParam.coordinateSystem == "GCJ-02") { | ||
| 189 | + longitudeStr = "longitudeGcj02"; | ||
| 190 | + latitudeStr = "latitudeGcj02"; | ||
| 191 | + }else if (window.mapParam.coordinateSystem == "WGS84") { | ||
| 192 | + longitudeStr = "longitudeWgs84"; | ||
| 193 | + latitudeStr = "latitudeWgs84"; | ||
| 194 | + }else { | ||
| 195 | + longitudeStr = "longitude"; | ||
| 196 | + latitudeStr = "latitude"; | ||
| 197 | + } | ||
| 198 | + | ||
| 186 | for (let i = 0; i < channels.length; i++) { | 199 | for (let i = 0; i < channels.length; i++) { |
| 187 | - if (channels[i].longitude * channels[i].latitude === 0) { | 200 | + let longitude = channels[i][longitudeStr]; |
| 201 | + let latitude = channels[i][latitudeStr]; | ||
| 202 | + if (longitude * latitude === 0) { | ||
| 188 | continue; | 203 | continue; |
| 189 | } | 204 | } |
| 190 | let item = { | 205 | let item = { |
| 191 | - position: [channels[i].longitude, channels[i].latitude], | 206 | + position: [longitude, latitude], |
| 192 | image: { | 207 | image: { |
| 193 | src: this.getImageByChannel(channels[i]), | 208 | src: this.getImageByChannel(channels[i]), |
| 194 | anchor: [0.5, 1] | 209 | anchor: [0.5, 1] |
| @@ -202,7 +217,7 @@ export default { | @@ -202,7 +217,7 @@ export default { | ||
| 202 | this.layer = this.$refs.map.addLayer(params, this.featureClickEvent) | 217 | this.layer = this.$refs.map.addLayer(params, this.featureClickEvent) |
| 203 | console.log(4) | 218 | console.log(4) |
| 204 | if (params.length === 1) { | 219 | if (params.length === 1) { |
| 205 | - this.$refs.map.panTo([channels[0].longitude, channels[0].latitude], mapParam.maxZoom) | 220 | + this.$refs.map.panTo([channels[0][longitudeStr], channels[0][latitudeStr]], mapParam.maxZoom) |
| 206 | } else if (params.length > 1) { | 221 | } else if (params.length > 1) { |
| 207 | this.$refs.map.fit(this.layer) | 222 | this.$refs.map.fit(this.layer) |
| 208 | } else { | 223 | } else { |
web_src/src/router/index.js
| @@ -7,7 +7,7 @@ import deviceList from '../components/DeviceList.vue' | @@ -7,7 +7,7 @@ import deviceList from '../components/DeviceList.vue' | ||
| 7 | import channelList from '../components/channelList.vue' | 7 | import channelList from '../components/channelList.vue' |
| 8 | import pushVideoList from '../components/PushVideoList.vue' | 8 | import pushVideoList from '../components/PushVideoList.vue' |
| 9 | import streamProxyList from '../components/StreamProxyList.vue' | 9 | import streamProxyList from '../components/StreamProxyList.vue' |
| 10 | -import devicePosition from '../components/devicePosition.vue' | 10 | +import map from '../components/map.vue' |
| 11 | import login from '../components/Login.vue' | 11 | import login from '../components/Login.vue' |
| 12 | import parentPlatformList from '../components/ParentPlatformList.vue' | 12 | import parentPlatformList from '../components/ParentPlatformList.vue' |
| 13 | import cloudRecord from '../components/CloudRecord.vue' | 13 | import cloudRecord from '../components/CloudRecord.vue' |
| @@ -69,9 +69,9 @@ export default new VueRouter({ | @@ -69,9 +69,9 @@ export default new VueRouter({ | ||
| 69 | component: parentPlatformList, | 69 | component: parentPlatformList, |
| 70 | }, | 70 | }, |
| 71 | { | 71 | { |
| 72 | - path: '/devicePosition/:deviceId/:parentChannelId/:count/:page', | ||
| 73 | - name: 'devicePosition', | ||
| 74 | - component: devicePosition, | 72 | + path: '/map/:deviceId/:parentChannelId/:count/:page', |
| 73 | + name: 'map', | ||
| 74 | + component: map, | ||
| 75 | }, | 75 | }, |
| 76 | { | 76 | { |
| 77 | path: '/cloudRecord', | 77 | path: '/cloudRecord', |
| @@ -100,8 +100,8 @@ export default new VueRouter({ | @@ -100,8 +100,8 @@ export default new VueRouter({ | ||
| 100 | }, | 100 | }, |
| 101 | { | 101 | { |
| 102 | path: '/map', | 102 | path: '/map', |
| 103 | - name: 'devicePosition', | ||
| 104 | - component: devicePosition, | 103 | + name: 'map', |
| 104 | + component: map, | ||
| 105 | }, | 105 | }, |
| 106 | ] | 106 | ] |
| 107 | }, | 107 | }, |