Buffer a point graphic or feature service in web app builder

316
7
03-25-2021 06:48 AM
Labels (2)
gkatsamb
New Contributor II

web app builder 2.19 I just want a simple tool/widget that allows me to click a point on the map and create buffers at a distance I specify

Tags (3)
0 Kudos
7 Replies
BlytheSpendlove
New Contributor III

The Analysis widget allows you to create buffers, so you might want to look into that. I use it to create a buffer around layers but I believe you can use it to create a buffer around a point as well. (Then you just have to enable the SpatialAnalysisTools gp service from your server manager if you are on ArcGIS Enterprise, not sure how it works in AGOL).

The main thing to watch out for with using that as a solution is that only Creator or Insight Analyst user types can use the SpatialAnalysisTools service that the buffer depends on. For an organization with lots of users, this can create a problem, since the Creator license is more expensive than the Field Editor or Viewer licenses.

0 Kudos
BlytheSpendlove
New Contributor III

@gkatsamb You might also want to look into the Incident Analysis Widget. That doesn't require the SpatialAnalysisTools service and might fit your needs.

0 Kudos
LefterisKoumis
Regular Contributor

The screening tool does buffer as well and you can print a report about the features are within the buffer zone. No spatial analysis or other licenses are required.

gkatsamb
New Contributor II

I want the user to click a point on the map as a (graphic) and buffer that point with ring buffers 

0 Kudos
LefterisKoumis
Regular Contributor

THat what the screening tool does. You select which graphic you want want to buffer around (in your case, point) then define the distance to buffer around. 

0 Kudos
gkatsamb
New Contributor II

But Screening Tool requires a layer/feature service to be selected as an Analysis Layer. I just want to be able to click anywhere on map and create a buffer at a distance i select.

0 Kudos
LefterisKoumis
Regular Contributor

I don't know how comfortable you are with JS but I changed the code on the screening widget to not require a layer to be selected before you create a map. Or you can create a custom widget to do that.

Here is some code that I used to create custom buffer.

 

 

mysymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_NONE, new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT, new Color([255, 0, 0]), 2), new Color([255, 255, 0, 0.25]));
geodesicBuffer.distances = [thebufferdistance];
geodesicBuffer.unit = bufferunit;
geodesicBuffer.outSpatialReference = this.map.spatialReference;
geodesicBuffer.geodesic = true;
geodesicBuffer.unionResults = true;
bufferGraphicsLayer = new GraphicsLayer();
esriConfig.defaults.geometryService.buffer(geodesicBuffer, lang.hitch(this, function (evt) {
resultEvent = evt[0];
var geodesicUserGraphic = new Graphic();
geodesicUserGraphic.setAttributes({
	"name": "Buffer"
});			
geodesicUserGraphic.geometry = resultEvent;
geodesicUserGraphic.symbol = mysymbol;
bufferGraphicsLayer.add(geodesicUserGraphic);
this.map.addLayer(bufferGraphicsLayer);

 

 

0 Kudos