@abi-software/scaffoldvuer 1.4.2 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scaffoldvuer.js +2983 -2980
- package/dist/scaffoldvuer.umd.cjs +163 -163
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/ScaffoldTooltip.vue +3 -3
- package/src/components/ScaffoldVuer.vue +16 -9
- package/src/scripts/Utilities.js +3 -3
package/package.json
CHANGED
|
@@ -153,9 +153,9 @@ export default {
|
|
|
153
153
|
if (this.annotationDisplay) {
|
|
154
154
|
const region = this.region ? this.region +"/" : "";
|
|
155
155
|
this.annotationEntry = {
|
|
156
|
-
"featureId":
|
|
157
|
-
"resourceId":
|
|
158
|
-
"resource":
|
|
156
|
+
"featureId": region + this.label,
|
|
157
|
+
"resourceId": this.scaffoldUrl,
|
|
158
|
+
"resource": this.scaffoldUrl,
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -942,7 +942,7 @@ export default {
|
|
|
942
942
|
...mapState(useMainStore, ['userToken']),
|
|
943
943
|
annotationDisplay: function() {
|
|
944
944
|
return this.viewingMode === 'Annotation' && this.tData.active === true &&
|
|
945
|
-
(this.activeDrawMode
|
|
945
|
+
(this.activeDrawMode !== "Point" && this.activeDrawMode !== 'LineString');
|
|
946
946
|
}
|
|
947
947
|
},
|
|
948
948
|
methods: {
|
|
@@ -1351,10 +1351,14 @@ export default {
|
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
1353
1353
|
},
|
|
1354
|
-
createEditTemporaryLines: function(
|
|
1354
|
+
createEditTemporaryLines: function(identifiers) {
|
|
1355
|
+
const worldCoords = identifiers[0].extraData.worldCoords;
|
|
1355
1356
|
if (worldCoords) {
|
|
1356
1357
|
if (this.createData.shape === "LineString" || this.createData.editingIndex > -1) {
|
|
1357
1358
|
if (this.createData.points.length === 1) {
|
|
1359
|
+
this.showRegionTooltipWithAnnotations(identifiers, true, false);
|
|
1360
|
+
this.tData.x = 50;
|
|
1361
|
+
this.tData.y = 200;
|
|
1358
1362
|
if (this._tempLine) {
|
|
1359
1363
|
const positionAttribute = this._tempLine.geometry.getAttribute( 'position' );
|
|
1360
1364
|
positionAttribute.setXYZ(1, worldCoords[0], worldCoords[1], worldCoords[2]);
|
|
@@ -1457,10 +1461,8 @@ export default {
|
|
|
1457
1461
|
this._editingZincObject = zincObject;
|
|
1458
1462
|
}
|
|
1459
1463
|
}
|
|
1460
|
-
if (this.activeDrawMode
|
|
1464
|
+
if (this.activeDrawMode !== "Point" && this.activeDrawMode !== "LineString") {
|
|
1461
1465
|
this.showRegionTooltipWithAnnotations(event.identifiers, true, false);
|
|
1462
|
-
this.tData.x = 50;
|
|
1463
|
-
this.tData.y = 200;
|
|
1464
1466
|
} else {
|
|
1465
1467
|
this.showRegionTooltipWithAnnotations(event.identifiers, true, true);
|
|
1466
1468
|
}
|
|
@@ -1548,7 +1550,7 @@ export default {
|
|
|
1548
1550
|
}
|
|
1549
1551
|
this.tData.x = event.identifiers[0].coords.x;
|
|
1550
1552
|
this.tData.y = event.identifiers[0].coords.y;
|
|
1551
|
-
this.createEditTemporaryLines(event.identifiers
|
|
1553
|
+
this.createEditTemporaryLines(event.identifiers);
|
|
1552
1554
|
}
|
|
1553
1555
|
}
|
|
1554
1556
|
/**
|
|
@@ -1565,9 +1567,8 @@ export default {
|
|
|
1565
1567
|
this.$refs.scaffoldContainer.getBoundingClientRect();
|
|
1566
1568
|
this.tData.x = event.identifiers[0].coords.x - offsets.left;
|
|
1567
1569
|
this.tData.y = event.identifiers[0].coords.y - offsets.top;
|
|
1568
|
-
this.createEditTemporaryLines(event.identifiers[0].extraData.worldCoords);
|
|
1569
1570
|
}
|
|
1570
|
-
this.createEditTemporaryLines(event.identifiers
|
|
1571
|
+
this.createEditTemporaryLines(event.identifiers);
|
|
1571
1572
|
}
|
|
1572
1573
|
}
|
|
1573
1574
|
}
|
|
@@ -1917,6 +1918,12 @@ export default {
|
|
|
1917
1918
|
annotationFeaturesToPrimitives(this.$module.scene, payload.features);
|
|
1918
1919
|
}
|
|
1919
1920
|
});
|
|
1921
|
+
//Support previously supported encoded resource
|
|
1922
|
+
getDrawnAnnotations(this.annotator, this.userToken, encodeURIComponent(this.url)).then((payload) => {
|
|
1923
|
+
if (payload && payload.features) {
|
|
1924
|
+
annotationFeaturesToPrimitives(this.$module.scene, payload.features);
|
|
1925
|
+
}
|
|
1926
|
+
});
|
|
1920
1927
|
}
|
|
1921
1928
|
}
|
|
1922
1929
|
});
|
|
@@ -2222,7 +2229,7 @@ export default {
|
|
|
2222
2229
|
const noSlash = fullName.slice(0, -1);
|
|
2223
2230
|
annotation.region = noSlash;
|
|
2224
2231
|
fullName = fullName + group;
|
|
2225
|
-
const featureID =
|
|
2232
|
+
const featureID = fullName;
|
|
2226
2233
|
annotation.item.id = featureID;
|
|
2227
2234
|
annotation.feature.id = featureID;
|
|
2228
2235
|
});
|
package/src/scripts/Utilities.js
CHANGED
|
@@ -301,9 +301,9 @@ const createNewAnnotationsWithFeatures = (zincObject, region, group, scaffoldUrl
|
|
|
301
301
|
//Check if region ends with a slash
|
|
302
302
|
let fullName = region.slice(-1) === "/" ? region : region + "/";
|
|
303
303
|
fullName = fullName + group;
|
|
304
|
-
const featureID =
|
|
304
|
+
const featureID = fullName;
|
|
305
305
|
const userAnnotation = {
|
|
306
|
-
resource:
|
|
306
|
+
resource: scaffoldUrl,
|
|
307
307
|
item: {
|
|
308
308
|
"id": featureID,
|
|
309
309
|
},
|
|
@@ -359,7 +359,7 @@ export const addUserAnnotationWithFeature = (service, userToken, zincObject,
|
|
|
359
359
|
* Get the drawn annotation stored on the annotation server
|
|
360
360
|
*/
|
|
361
361
|
export const getDrawnAnnotations = async (service, userToken, scaffoldUrl) => {
|
|
362
|
-
const resource =
|
|
362
|
+
const resource = scaffoldUrl;
|
|
363
363
|
return await service.drawnFeatures(userToken, resource);
|
|
364
364
|
}
|
|
365
365
|
|