11-09-2016 07:03 AM
A customer has asked:
Is it possible to programmatically change the visible scale bands for a legend item in portal using the Geospatial Portal API? I am able to programmatically select and zoom to a feature, but if it is out of the display scale range I want to be able to turn on the appropriate display scales for the selected feature's legend item. The user can do it manually if they know to do that, but I want to automate the process.
11-10-2016 04:30 AM
Hi Carolyn,
basically it should be possible using internal SDK objects. Unfortunately I don't know the proper way to propagate or force the update of scale bands. This is where I am stuck now:
var mapState = $mapStateManager.findMapState("map"); var scaleBands = mapState.get_scaleBands() scaleBands[1].set_minScaleDenominator(1000000); mapState.updateScaleBand();
Jan