# HG changeset patch # User Sebastien Jodogne # Date 1787807370 -7200 # Node ID 1ad50524d0899c8f67935e2d7e6dcf8ef40d281c # Parent 23d3f07a23145b3c8ca15b2b0c6d95b44d121dc4 save the creation time of annotations diff -r 23d3f07a2314 -r 1ad50524d089 ViewerPlugin/WebApplication/viewer.js --- a/ViewerPlugin/WebApplication/viewer.js Thu Aug 27 06:40:45 2026 +0200 +++ b/ViewerPlugin/WebApplication/viewer.js Thu Aug 27 07:09:30 2026 +0200 @@ -247,6 +247,11 @@ feature.set('label', label); } + var date = response.data.features[i]['creation-datetime']; // This is a numerical timestamp + if (date !== undefined) { + feature.set('creation-datetime', new Date(date)); + } + that.drawSource.addFeature(feature); } } @@ -287,6 +292,11 @@ item['label'] = label; } + var date = feature.get('creation-datetime'); + if (date !== undefined) { + item['creation-datetime'] = date.getTime(); + } + features.push(item); } }); @@ -945,6 +955,7 @@ function onDrawEnd(e, callPreventDoubleClickZoom) { e.feature.set('layer-id', app.activeUserLayerId); + e.feature.set('creation-datetime', new Date()); if (callPreventDoubleClickZoom) { preventDoubleClickZoom(); } @@ -971,6 +982,13 @@ var feature = e.selected[0]; that.selectedFeature = feature; + var date = feature.get('creation-datetime'); + if (date === undefined) { + that.AddReadOnlyProperty('Date', ''); + } else { + that.AddReadOnlyProperty('Date', date.toLocaleString()); + } + var geometry = feature.getGeometry(); if (geometry.getType() === 'LineString') {