I have a widget that creates a and populates a map after a queryTask returns its results. My problem is when i perform the query a second time with a different result, the map won't recenter nor draw the graphics around the polygon (the result).
I create the map like this:
newExtent = new Extent(results.features[0].geometry.getExtent());
fichaMap = new Map("mapDiv", {
extent: newExtent,
showLabels: true,
logo: false,
zoom: 16,
slider: false
});
After that i create a mapPoint and have a centerAt() inside a on("click") function to recenter the map to the new result as it doesn't do it automatically. Is there anything i can do to make this onCenter work? I can provide more info if needed:
edit: Pastebin with all the code in it(service urls removed for security purposes): [JavaScript] widget.js - Pastebin.com