修复切换地图坐标系时未更新矢量瓦片坐标系
This commit is contained in:
@@ -474,7 +474,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
public void removePushListItem(String app, String stream, String mediaServerId) {
|
||||
String key = VideoManagerConstants.PUSH_STREAM_LIST + app + "_" + stream;
|
||||
MediaInfo param = (MediaInfo)redisTemplate.opsForValue().get(key);
|
||||
if (param != null) {
|
||||
if (param != null && userSetting.getServerId().equals(param.getServerId())) {
|
||||
redisTemplate.delete(key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ window.mapParam = {
|
||||
// 默认地图中心点
|
||||
center:[116.41020, 39.915119],
|
||||
// 地图最大层级
|
||||
maxZoom:18,
|
||||
maxZoom:19,
|
||||
// 地图最小层级
|
||||
minZoom: 3
|
||||
}
|
||||
|
||||
@@ -97,8 +97,6 @@ export default {
|
||||
url: this.mapTileList[this.mapTileIndex].tilesUrl
|
||||
})
|
||||
})
|
||||
console.log(4444)
|
||||
console.log(this.mapTileList[this.mapTileIndex].tilesUrl)
|
||||
} else {
|
||||
tileLayer = new Tile({
|
||||
preload: 4,
|
||||
@@ -150,11 +148,11 @@ export default {
|
||||
})
|
||||
},
|
||||
addVectorTileLayer(tileUrl, clickEvent, errorEvent){
|
||||
tileUrl += `?geoCoordSys=${this.mapTileList[this.mapTileIndex].coordinateSystem}&accessToken=${this.$store.getters.token}`
|
||||
let source = new VectorTileSource({
|
||||
format: new MVT(),
|
||||
url: tileUrl
|
||||
})
|
||||
|
||||
let layer = new VectorTileLayer({
|
||||
source: source,
|
||||
style: function(feature) {
|
||||
@@ -625,6 +623,7 @@ export default {
|
||||
this.mapTileIndex = index
|
||||
window.coordinateSystem = this.mapTileList[this.mapTileIndex].coordinateSystem
|
||||
tileLayer.getSource().setUrl(this.mapTileList[index].tilesUrl)
|
||||
tileLayer.getSource().refresh()
|
||||
if (mapTileConfig.coordinateSystem !== this.mapTileList[this.mapTileIndex].coordinateSystem) {
|
||||
// 发送通知
|
||||
this.$emit('coordinateSystemChange', this.mapTileList[this.mapTileIndex].coordinateSystem)
|
||||
|
||||
@@ -293,6 +293,7 @@ export default {
|
||||
return
|
||||
}
|
||||
this.$refs.mapComponent.changeMapTile(index)
|
||||
this.changeLayerType(this.layerType)
|
||||
},
|
||||
clientEvent(data){
|
||||
this.closeInfoBox()
|
||||
@@ -310,15 +311,17 @@ export default {
|
||||
this.$refs.mapComponent.removeLayer(channelTileLayer)
|
||||
return
|
||||
}
|
||||
if (channelTileLayer) {
|
||||
this.$refs.mapComponent.removeLayer(channelTileLayer)
|
||||
}
|
||||
|
||||
let geoCoordSys = this.$refs.mapComponent.getCoordSys()
|
||||
const baseUrl = window.baseUrl ? window.baseUrl : ''
|
||||
let baseApi = ((process.env.NODE_ENV === 'development') ? process.env.VUE_APP_BASE_API : baseUrl)
|
||||
let tileUrl = null
|
||||
if (index === 1) {
|
||||
tileUrl = baseApi + `/api/common/channel/map/tile/{z}/{x}/{y}?geoCoordSys=${geoCoordSys}&accessToken=${this.$store.getters.token}`
|
||||
tileUrl = baseApi + '/api/common/channel/map/tile/{z}/{x}/{y}'
|
||||
}else if (index === 2) {
|
||||
tileUrl = baseApi + `/api/common/channel/map/thin/tile/{z}/{x}/{y}?geoCoordSys=${geoCoordSys}&accessToken=${this.$store.getters.token}`
|
||||
tileUrl = baseApi + '/api/common/channel/map/thin/tile/{z}/{x}/{y}'
|
||||
}
|
||||
channelTileLayer = this.$refs.mapComponent.addVectorTileLayer(tileUrl, this.clientEvent)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user