AnsweredAssumed Answered

Moving infoWindow

Question asked by rjobradley on May 23, 2013
Latest reply on Jun 5, 2013 by rjobradley
I am having an issue with an infoWindow in an application where if the infoWindow is displayed and the map is panned the next identify function's infoWindow is positioned at the screen point of the previous indentify point.

The specific behavior is repeatable as follows:
- map loads normally, zoom to the extent desired with what any means
- click on a point to identify results, the identify data is dynamically loaded into the infoWindow with setContent, title is also added
- the infoWindow is displayed with a line of code:, locmap.getInfoWindowAnchor(idLocPoint.screenPoint));

The first time the map is loaded clicking on any point will produce the expected results: infoWindow is displayed at one of now eight positions (used to be four) with a leader. Also, naviagting the map does not effect expected performance: zooming and panning then clicking on a point all result in viewing the infoWindow at the correct point if the user closes the infoWindow before navigating the map.

If an infoWindow is left open and the map is navigated then the problem starts. So teh steps to repeat are then same as above with an added step to navigate the map.  Panning the map with the infoWindow open moves correctly but identifying another point displays the infoWindow 1st in the correct position as a blink, then infoWindow is moved back to screen position it was at for the previous identify position (appears to jump to previous spot).

What I have tried:
- locmap.reposition(); - did not change the behavior
-; - does not change position
- adding the screen coords and map coords to show new position of identify object and I can see the correct numbers but the behavior did not change.
- adding a function to alert the coords onShow event for infoWindow also shows correct screen and map coords but object is still moved (after onShow event is completed)
- infoWindow.destroy() - kills and future infoWindows from being displayed
-; - always shows infoWindow in upper left corner of map, never moves

Finally, I tried setting a delay in the display of the infoWindow and that did fix the results:
setTimeout(function () {, locmap.getInfoWindowAnchor(idLocPoint.screenPoint)); }, 400);

BUT I do NOT want to keep the delay in there.  Has anyone else ever seen this behavior and if so are there any of remedies I can try? 

Thanks for reading ...