I have a MapImageLayer with a point sublayer that I insert data outside the API, mt problem is that the newly inserted data is not refreshed until I move the map, how to refresh te MapImageLayer to reflect the changes made outside the API?
Solved! Go to Solution.
Rodrigo,
Since there is no such thing as view.reresh or layer refresh or any other method I can find to force a referesh you will have to use a workaround like view.goto. The best way to do this is to get the current view center and add 1 to the X or Y and use view goto with that new point coordinates. This will force a refresh and have minimal effect on the maps extent.
Rodrigo,
Since there is no such thing as view.reresh or layer refresh or any other method I can find to force a referesh you will have to use a workaround like view.goto. The best way to do this is to get the current view center and add 1 to the X or Y and use view goto with that new point coordinates. This will force a refresh and have minimal effect on the maps extent.
I was having a similar problem and fixed it like this:
view.extent = view.extent;
Robert's solution definitely works too, but just wanted to share this if anyone else is having this issue.
Cheers
Just a quick update:
The above method of setting view.extent = view.extent has been unreliable for me, so I'm using Robert's suggested method now as well.
Cheers
Most layers now can be refreshed in 2D MapViews by setting refreshInterval
property or by calling refresh()
method on it.