AnsweredAssumed Answered

Can I zoom into a polygon with buffer?

Question asked by LM61067628 on Feb 21, 2017
Latest reply on Feb 21, 2017 by rscheitlin

I need to let the map zoom into a free-draw polygon’s buffer; the buffer can be 10 – 100 miles defined by the users, the buffer value is defined as BufferDistance.

 

I know for a circle with buffer, it can be defined such as   

var circleBuffer = new Circle(centerPoint, {

                "radius": this.circle.radiusValue

            });

And then the map extent is set as:

this.map.setExtent(circleBuffer.getExtent());

I test this circle statement, it can zoom into the circle buffer very well.

 

My question is: what if I want to zoom into a free-draw polygon with buffer? How do I get the extent of this polygon with buffer (not just polygon itself)?  In esri/geometry domain, a polygon constructor does not include any optional parameter like radius/buffer. I tried the following:

 

this.map.setExtent(polygon.geometry.getExtent());

It can only zoom into the polygon itself, not the polygon buffer. Thanks!

Outcomes