Hello,
I changed the Attribute Table widget. In the setting page of the widget I set a value of the map scale I want my map to zoom to if I select a point feature in the attribute table. Reason - I'm only using our own background maps which are dynamic map services. The code in the _FeatureTable.js is designed to work with tiled basemaps. Every "Zoom to" click I make, the map zooms closer and closer.
I could hard code the value in the _FeatureTable.js but I'd rather control it through the widget setting. My question is how to pass the config value from the config file to the _FeatureTable.js?
} else if (method === "zoom") {
this.getExtent(result).then(lang.hitch(this, function(gExtent) {
if (gExtent) {
if (gExtent.type === "point") {
var currentScale = this.map.getScale();
var factor = MY ZOOM SCALE FROM CONFIG / currentScale;
levelOrFactor = this.map.getMaxZoom() > -1 ? this.map.getMaxZoom() : 0.1;
this.map.centerAndZoom(gExtent, factor);
Thanks for any help, Monika
Solved! Go to Solution.
Monika,
Are you already adding this zoom value to the widgets config.json using the getConfig function?
this.config.zoomScale = this.yournumbertextboxcontrol.get('value');
If so then you should be able to do this in the _FeatureTable.js
var factor = this.parentWidget.config.zoomScale;
Hi Robert,
yes, I've been already adding the value to the config. But I wasn't sure how to get hold of it and your line of code worked!
Thanks a lot for your help, Monika
Monika,
Glad to help. Make sure to mark this thread as answered.