Negative Buffer Web AppBuilder

457
3
Jump to solution
05-25-2018 06:48 AM
GeraldStanuch
New Contributor III

Can I modify the Situation Awareness widget in Web AppBuilder Developer to take a negative buffer value? or maybe an option to do an inside buffer vs. outside buffer or both if entering a positive buffer value?

I am looking for a solution to do a negative buffer on a land parcel polygon to show a 12 foot setback line for constructing structures. A structure can't be closer than 12 feet to the property line. I currently use both the Situation Awareness widget and Developer version of Web AppBuilder. If the widget could take a negative value, it would be an easy way to show the setback so a line could be sketched over it with a drawing widget.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Gerald,

   You are correct. You will have to modify this line in the Widget.js file.

if (dist1 > 0) {

to

if (dist1 <= parseFloat(this.config.bufferRange.minimum.toString().replace(/,/g, ""), 10)) {

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Emeritus

Gerald,

   The widgets settings dialog is set to not allow negative numbers but you can edit the widgets config.json manually to set the bufferRange minimum:

"bufferRange": {
  "minimum": -30,
  "_default": 0,
  "maximum": 100
},

GeraldStanuch
New Contributor III

I changed the config but it is not reflected in the widget interface within the running app?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Gerald,

   You are correct. You will have to modify this line in the Widget.js file.

if (dist1 > 0) {

to

if (dist1 <= parseFloat(this.config.bufferRange.minimum.toString().replace(/,/g, ""), 10)) {