Sketch widget, snapping and branch versioning

768
1
Jump to solution
09-05-2022 03:20 AM
Jean-LucDaems
New Contributor

Hi,

I'm using the sketch widget to draw a point, line, ... with capture enabled on a feature layer.

This feature layer is branch versioned, gdbVersion and historicMoment are properly set : I can see the latest geometry updates on that layer.

Unfortunately, the snapping does not take into account current historic moment : the snapping on modified object uses the initial unmodified geometry shape.

I can easily reproduce on sandbox https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=sketch-geometries.

Is this a bug ? Is there a way to snap on the most up-to-date geometries ?

Thanks in advance.

Jean-Luc

0 Kudos
1 Solution

Accepted Solutions
Jean-LucDaems
New Contributor

Thanks to Esri Belux for the following workaround: use an interceptor to update the historic moment of queries.

This code snippet does the job:

const interceptor = {
      urls: featureServerUrl,
      before : (({ url, requestOptions }) => {
          requestOptions.query.historicMoment = viewMoment;
      }).bind(this)
    };
    esriConfig.request.interceptors.push(interceptor);
 
Bug has been logged :

#BUG-000152711 The "Snapping" function does not take into account the HistoricalMoment in the Sketch and Editor Widgets

View solution in original post

0 Kudos
1 Reply
Jean-LucDaems
New Contributor

Thanks to Esri Belux for the following workaround: use an interceptor to update the historic moment of queries.

This code snippet does the job:

const interceptor = {
      urls: featureServerUrl,
      before : (({ url, requestOptions }) => {
          requestOptions.query.historicMoment = viewMoment;
      }).bind(this)
    };
    esriConfig.request.interceptors.push(interceptor);
 
Bug has been logged :

#BUG-000152711 The "Snapping" function does not take into account the HistoricalMoment in the Sketch and Editor Widgets

0 Kudos