@@ -89,10 +95,12 @@ export default {
},
isLoging: false,
longitudeStr: 'longitude',
- latitudeStr: 'latitude'
+ latitudeStr: 'latitude',
+ mapTileList: []
}
},
created() {
+
},
destroyed() {
@@ -151,10 +159,12 @@ export default {
},
showChannelInfo: function(data) {
this.channel = data
- this.infoBoxId = this.$refs.mapComponent.openInfoBox([data.gbLongitude, data.gbLatitude], this.$refs.infobox, [0, -50])
+ let position = [data.gbLongitude, data.gbLatitude]
+ this.infoBoxId = this.$refs.mapComponent.openInfoBox(position, this.$refs.infobox, [0, -50])
},
initChannelLayer: function () {
+ this.mapTileList = this.$refs.mapComponent.mapTileList
// 获取所有有位置的通道
this.closeInfoBox()
this.$store.dispatch('commonChanel/getAllForMap', {}).then(data => {
@@ -163,12 +173,9 @@ export default {
let item = data[i]
if (item.gbLongitude && item.gbLatitude) {
let position = [item.gbLongitude, item.gbLatitude]
- let gcj02Position = gcoord.transform(position, gcoord.WGS84, gcoord.GCJ02)
- item.gbLongitude = gcj02Position[0]
- item.gbLatitude = gcj02Position[1]
array.push({
id: item.gbId,
- position: gcj02Position,
+ position: position,
data: item,
image: {
anchor: [0.5, 1],
@@ -180,6 +187,9 @@ export default {
this.updateChannelLayer(array)
})
},
+ changeMapTile: function (index) {
+ this.$refs.mapComponent.changeMapTile(index)
+ },
updateChannelLayer: function(array) {
if (this.channelLayer) {
this.channelLayer = this.$refs.mapComponent.updateLayer(this.channelLayer, array, true)
@@ -300,11 +310,6 @@ export default {
},
submitEdit: function(channel) {
let position = [channel.gbLongitude, channel.gbLatitude]
- if (this.$refs.mapComponent.getCurrentCoordinateSystem() === 'GCJ02') {
- let wgs84Position = gcoord.transform(position, gcoord.GCJ02, gcoord.WGS84)
- channel.gbLongitude = wgs84Position[0]
- channel.gbLatitude = wgs84Position[1]
- }
this.$store.dispatch('commonChanel/update', channel)
.then(data => {
this.$message.success({