AnsweredAssumed Answered

control zoom level when using query url parameter

Question asked by deshegis on May 31, 2020
Latest reply on Jun 2, 2020 by rscheitlin

Hi,

I have an app made using web appbuilder developer edition V 2.14

I am using query url parameter to focus on a feature. The query works well, but - the zoom level is too close.

I changed the zoom level inside the "MapUrlParamsHandlerfile" in the jimu.js folder:

 

query.maxAllowableOffset = 0.00001;
layer.layerObject.queryFeatures(query).then(function(featureSet){
var features = featureSet.features;
if(features.length === 0){
console.log('No result from query URL parameter.');
return;
}
if(layer.layerObject.geometryType === 'esriGeometryPoint' && features.length === 1){
map.setExtent(scaleUtils.getExtentForScale(map, 100000));//same scale with search dijit
map.centerAt(features[0].geometry);
}else{
var resultExtent = jimuUtils.graphicsExtent(features);
map.setExtent(resultExtent);
}

showSelections(map, layer, features);
}, function(err){
console.error(err);
});
}

 

but it does not effect the query result zoom level.

I guess this is not the right place to specify the zoom level I want.

so, where is the right place??

thank you!

Dikla.

Outcomes