GeometryEngine - geodesic buffers

This sample uses GeometryEngine to create geodesic buffers around the pointer (mouse/touch) location as a user moves the pointer across the view or when user clicks on the view.

GeometryEngine contains many of the same spatial tools as GeometryService, the primary difference being that GeometryEngine's functions are accessed on the client, bypassing the need to make additional server requests. This can significantly improve the performance of applications that use these functions.

How it works

The sample listens to pointer-move and click events both on SceneView and MapView. If the b key is tapped, a user can click on or move the pointer around the SceneView or the MapView to create geodesic buffer around the pointer location.

Use dark colors for code blocksCopy
1
2
3
4
5
view2d.on("pointer-move", (event) => {
  if (bufferEnabled) {
    createBuffer(event, view2d);
  }
});

The user can tap the b key to enable the default navigation behavior for the pointer-move event on MapView. The same can be done for SceneView.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.