AnsweredAssumed Answered

GoTo some extent when featureset is empty

Question asked by gregb_mcpao on Dec 6, 2019
Latest reply on Dec 6, 2019 by gregb_mcpao

How do I get a default or initial extent from my ArcGIS without hard-coding it? For example, whenever a FeatureSet is not populated after executing a QueryTask, the mapview goes to the middle of the ocean instead of somewhere in my map area. If I can get the extent then I could zoom to it.

 

if (featureSet.features && !featureSet.features.length > 0) {
   view.goTo({
        target: view.extent
    }, ZoomOptions);
}

 

The returned extent from the zero results query doesn't have a valid extent, obviously.

 

type:"extent"
width:0
xmax:0
xmin:0
ymax:9688.393335133032
ymin:-9688.393335133032
zmax:undefined
zmin:undefined

 

I want the exent from here

https://gis.manateepao.com/arcgis/rest/services/Website/WebLayers/MapServer/256 

Outcomes