I have a Python based geoprocessing service that gets called in my web app. The web app takes a few input parameters, and zooms to a returned buffered section of cable that meets the criteria. This all works really great.
I'm using the following code to zoom to the returned graphic feature:
map.setExtent(graphicsUtils.graphicsExtent(map.graphics.graphics));
But, I really don't want the map to zoom this close to the graphic:
I'd prefer something like this:
1 Answer 1
In the Extent class there's an expand(factor) method:
So, I tried:
var extent = graphicsUtils.graphicsExtent(map.graphics.graphics).expand(4)
map.setExtent(extent);
And it's exactly what I wanted.
df.extent = df.extent * 2.5
so I'm guessingmap.setExtent = map.getExtent * 2.5
(with no JavaScript knowledge claimed).map.setExtent(graphicsUtils.graphicsExtent(map.graphics.graphics) * 2);
but it doesn't seem to like it.