Select to view content in your preferred language

new SketchView model Plugin Configuration option?

384
3
Jump to solution
02-26-2026 04:17 AM
JonathanDawe_BAS
Frequent Contributor

I've noticed that with the update to version 5 of the ArcGIS JS API there have been tweaks to the sketchviewmodel that seem to imply the existence of a new plugin pattern? The documentation and types information currently does not link to a working page in the docs? 

https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/#crea...

0 Kudos
1 Solution

Accepted Solutions
NathanCastle1
Esri Contributor

Hi there, thanks for your interest in the 5.0 release of the ArcGIS Maps SDK for JavaScript.

There is a new (internal) plugin model under the hood, which is what powers some of the exciting new capabilities in this release, including support for creating true curves.

We're not quite ready to share more details or make an API available. We still have some more work to do to define a great developer experience. Unfortunately, that internal type was inadvertently included in the documentation.

Do you have a particular use case in mind for a SketchViewModel plugin sysem?

View solution in original post

0 Kudos
3 Replies
NathanCastle1
Esri Contributor

Hi there, thanks for your interest in the 5.0 release of the ArcGIS Maps SDK for JavaScript.

There is a new (internal) plugin model under the hood, which is what powers some of the exciting new capabilities in this release, including support for creating true curves.

We're not quite ready to share more details or make an API available. We still have some more work to do to define a great developer experience. Unfortunately, that internal type was inadvertently included in the documentation.

Do you have a particular use case in mind for a SketchViewModel plugin sysem?

0 Kudos
JonathanDawe_BAS
Frequent Contributor

Our current method for adding customised functionality on top of the sketchview model has been to create subclasses of the sketchviewmodel extending parts of its functionality.

We currently have two main use cases. 

  1. MeasurementLineSketchViewModel - This adds bespoke functionality for generating line measurements on the map. It orchestrates adding additional graphics, such as segment labels and holding its own internal collection of measurements. 
  2. SingleGraphicSketchViewModel - A specialised sketchviewmodel that manages a single graphic on the map. It provides controlled creation, update and deletion capabilities. For example it is possible to start a controlled update on a graphic on the map, make changes to the geometry, but then cancel the operation rolling back to the original geometry at the start of the controlled update. 

I have attached a video showing the two workflows (the measurements editing is a bit laggy due to a now resolved bug):

(view in My Videos)
 

An option to build in functionality with a plugin system sounds like it might be a more formalised approach. I appreciate that it might make more sense at some stage for us to reach for the draw api instead, however the sketchview model and its visual elements / in built editing behaviour, work really nicely and can't be simply replicated. 

NathanCastle1
Esri Contributor

I think using SketchViewModel is the right approach as long as it meets your needs.

I'm curious, if SketchViewModel supported segment labels in 2D in a manner similar to support in 3D, do you think that would be able to replace MeasurementLineSketchViewModel? If so, would you need to configure the units of measure on the viewmodel, or is that configuration being managed centrally through the user/portal configuration?

You can see segment labels for 3D here: https://developers.arcgis.com/javascript/latest/sample-code/sketch-3d/

0 Kudos