Solved! Go to Solution.
I have one background street layer and one feature layer with points in it, and after doing a map.centerAndZoom() to one of the points the points either don't show up or they are so large that it blurs the screen. I tried the "hide()" and "show()" methods but they do not help at all. The only way to get everything in focus is to move the map a bit to refresh the extent, as the previous poster suggested.
So is there another way to refresh a feature layer that will work?
Charlie
If you are using a featurelayer, it supports refresh() and redraw() methods. refresh() requeries the server, while redraw() just gets redraws the data from cache. I don't see these methods documented in the API, but there were there before, and I've been using them for a while...
Jay
hmmm, refresh() doesn't seem to do anything.
map.refresh();
Or am I using the incorrect syntax ?
function init() {
//modify the request with a preventCache option before it is sent to the server
// so the feature layer is not cached in the browser
esri.setRequestPreCallback(function (ioArgs) {
try {
if (ioArgs.url.indexOf("FeatureServer") > -1 &&
ioArgs.content.returnGeometry == true) {
ioArgs.preventCache = true;
}
return ioArgs;
} catch (e) {
console.log(e.toString());
return ioArgs;
}
});
//... initialize map here ...
}