|
@@ -10,7 +10,7 @@
|
|
|
[v-cloak] {
|
|
|
display: none;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
#editor {
|
|
|
height: 200px;
|
|
|
}
|
|
@@ -167,12 +167,12 @@
|
|
|
id="upload">上传</button><br> -->
|
|
|
|
|
|
上传地图:<input type="file" id="file" name="file" multiple="multiple" @change="handleFileChange">
|
|
|
- <br>
|
|
|
- 位置(左上角):<br>
|
|
|
- 经度:<input type="text" id="lon" v-model="uploadData.lon" /><br>
|
|
|
- 纬度:<input type="text" id="lat" v-model="uploadData.lat" /><br>
|
|
|
- 朝向(顺时针为正):<input type="text" id="direction" v-model="uploadData.direction" /><br>
|
|
|
- 大小:<input type="text" id="size" v-model="uploadData.size" /><br>
|
|
|
+ <br> 位置(左上角):
|
|
|
+ <br> 经度:
|
|
|
+ <input type="text" id="lon" v-model="uploadData.lon" /><br> 纬度:
|
|
|
+ <input type="text" id="lat" v-model="uploadData.lat" /><br> 朝向(顺时针为正):
|
|
|
+ <input type="text" id="direction" v-model="uploadData.direction" /><br> 大小:
|
|
|
+ <input type="text" id="size" v-model="uploadData.size" /><br>
|
|
|
<!-- <button id="ok" @click="getImage">确定</button> -->
|
|
|
<button id="drug" @click="onDrawImage">
|
|
|
<span v-if="!isDraw">开启拖拽</span>
|
|
@@ -346,6 +346,12 @@
|
|
|
this.addPoint(+alon, +alat, str)
|
|
|
},
|
|
|
handleData() {
|
|
|
+ //重置数组
|
|
|
+ this.ageControlLocation1 = []
|
|
|
+ this.ageControlLocation2 = []
|
|
|
+ this.gpsControlCoordinate1 = []
|
|
|
+ this.gpsControlCoordinate2 = []
|
|
|
+ //
|
|
|
this.ageControlLocation1.push(this.ax - 0)
|
|
|
this.ageControlLocation1.push(this.ay - 0)
|
|
|
this.ageControlLocation1.push(this.az - 0)
|
|
@@ -365,7 +371,7 @@
|
|
|
commit() {
|
|
|
|
|
|
this.handleData()
|
|
|
- axios.post('/indoor/@replace/api/controlPoint/save', {
|
|
|
+ axios.post('/indoor/' + this.sceneNum + '/api/controlPoint/save', {
|
|
|
ageControlLocation1: this.ageControlLocation1,
|
|
|
ageControlLocation2: this.ageControlLocation2,
|
|
|
gpsControlCoordinate1: this.gpsControlCoordinate1,
|
|
@@ -373,10 +379,10 @@
|
|
|
sceneNum: this.sceneNum,
|
|
|
// id: 1
|
|
|
})
|
|
|
- .then(function (response) {
|
|
|
+ .then(function(response) {
|
|
|
alert('成功')
|
|
|
})
|
|
|
- .catch(function (error) {
|
|
|
+ .catch(function(error) {
|
|
|
alert('失败')
|
|
|
});
|
|
|
},
|
|
@@ -390,7 +396,7 @@
|
|
|
let img = new Image();
|
|
|
img.src = this.imgSrc;
|
|
|
let self = this;
|
|
|
- img.onload = function () {
|
|
|
+ img.onload = function() {
|
|
|
console.log(img.width, img.height)
|
|
|
if (img.width < self.limitSize || img.height < self.limitSize) {
|
|
|
alert('图片宽高需要大于512')
|
|
@@ -403,7 +409,7 @@
|
|
|
} else {
|
|
|
|
|
|
self.file = file
|
|
|
- self.uploadData.size =img.width
|
|
|
+ self.uploadData.size = img.width
|
|
|
self.getImage()
|
|
|
}
|
|
|
};
|
|
@@ -440,12 +446,12 @@
|
|
|
let oldX, oldY, allMoveX = 0,
|
|
|
allMoveY = 0;
|
|
|
canvas.draggable = false; //禁用原生拖拽
|
|
|
- let onmousedown = function (evt) {
|
|
|
+ let onmousedown = function(evt) {
|
|
|
oldX = evt.x;
|
|
|
oldY = evt.y;
|
|
|
document.addEventListener("mousemove", onmousemove);
|
|
|
}
|
|
|
- let onmousemove = function (evt) {
|
|
|
+ let onmousemove = function(evt) {
|
|
|
if (!isNaN(oldX - evt.x)) {
|
|
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
|
allMoveX = allMoveX + evt.x - oldX;
|
|
@@ -457,21 +463,21 @@
|
|
|
imageCanvas.refresh();
|
|
|
}
|
|
|
}
|
|
|
- let onmouseup = function (evt) {
|
|
|
+ let onmouseup = function(evt) {
|
|
|
document.removeEventListener("mousemove", onmousemove);
|
|
|
}
|
|
|
- this.open = function () {
|
|
|
+ this.open = function() {
|
|
|
document.addEventListener("mousedown", onmousedown);
|
|
|
document.addEventListener("mousemove", onmousemove);
|
|
|
document.addEventListener("mouseup", onmouseup);
|
|
|
}
|
|
|
- this.close = function () {
|
|
|
+ this.close = function() {
|
|
|
document.removeEventListener("mousedown", onmousedown);
|
|
|
document.removeEventListener("mousemove", onmousemove);
|
|
|
document.removeEventListener("mouseup", onmouseup);
|
|
|
self.setMapDragPan(true) //打开底图拖拽
|
|
|
}
|
|
|
- this.getMoveXY = function () {
|
|
|
+ this.getMoveXY = function() {
|
|
|
this.moveX = allMoveX;
|
|
|
this.moveY = allMoveY;
|
|
|
return [this.moveX, this.moveY]
|
|
@@ -506,12 +512,12 @@
|
|
|
let oldX, oldY, angle = 0,
|
|
|
angleAll = 0;
|
|
|
canvas.draggable = false; //禁用原生拖拽
|
|
|
- let onmousedown = function (evt) {
|
|
|
+ let onmousedown = function(evt) {
|
|
|
oldX = evt.x;
|
|
|
oldY = evt.y;
|
|
|
document.addEventListener("mousemove", onmousemove);
|
|
|
}
|
|
|
- let onmousemove = function (evt) {
|
|
|
+ let onmousemove = function(evt) {
|
|
|
if (!isNaN(oldX - evt.x)) {
|
|
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
|
let tana = (oldY - evt.y) / (evt.x - oldX);
|
|
@@ -524,21 +530,21 @@
|
|
|
imageCanvas.refresh();
|
|
|
}
|
|
|
}
|
|
|
- let onmouseup = function (evt) {
|
|
|
+ let onmouseup = function(evt) {
|
|
|
document.removeEventListener("mousemove", onmousemove);
|
|
|
}
|
|
|
- this.open = function () {
|
|
|
+ this.open = function() {
|
|
|
document.addEventListener("mousedown", onmousedown);
|
|
|
document.addEventListener("mousemove", onmousemove);
|
|
|
document.addEventListener("mouseup", onmouseup);
|
|
|
}
|
|
|
- this.close = function () {
|
|
|
+ this.close = function() {
|
|
|
document.removeEventListener("mousedown", onmousedown);
|
|
|
document.removeEventListener("mousemove", onmousemove);
|
|
|
document.removeEventListener("mouseup", onmouseup);
|
|
|
self.setMapDragPan(true) //打开底图拖拽
|
|
|
}
|
|
|
- this.getAngle = function () {
|
|
|
+ this.getAngle = function() {
|
|
|
this.angle = angleAll
|
|
|
return this.angle;
|
|
|
}
|
|
@@ -629,14 +635,14 @@
|
|
|
formData.append('file', this.file)
|
|
|
formData.append('location', location)
|
|
|
formData.append('orientation', saveAngle)
|
|
|
- // formData.append('sceneCode', this.sceneNum)
|
|
|
- // formData.append('sceneCode', 't810')
|
|
|
+ // formData.append('sceneCode', this.sceneNum)
|
|
|
+ // formData.append('sceneCode', 't810')
|
|
|
axios.post('indoor/' + this.sceneNum + '/api/map/upload', formData)
|
|
|
// axios.post('http://192.168.0.135:9294/indoor/t810/api/map/upload', formData)
|
|
|
- .then(function (response) {
|
|
|
+ .then(function(response) {
|
|
|
alert('成功')
|
|
|
})
|
|
|
- .catch(function (error) {
|
|
|
+ .catch(function(error) {
|
|
|
alert('失败')
|
|
|
});
|
|
|
|
|
@@ -650,7 +656,7 @@
|
|
|
},
|
|
|
|
|
|
setMapDragPan(bool) {
|
|
|
- this.map.getInteractions().forEach(function (element, index, array) {
|
|
|
+ this.map.getInteractions().forEach(function(element, index, array) {
|
|
|
if (element instanceof ol.interaction.DragPan)
|
|
|
element.setActive(bool);
|
|
|
});
|