AnsweredAssumed Answered

Crazy Popup Behavior in PhoneGap

Question asked by deleted-user-1_r2dgYuILKY on Apr 12, 2018

I have a PhoneGap app that generates a chart based on the user's location. The app zooms into a flashing point on the user's location on a map. The chart is returned from our server in a popup window which the user can click to see the full sized chart in their web browser. The problem I'm having is that sometimes the popup window appears in the upper left side of the screen, and doesn't move with the map view. I had this problem in the past with web maps and I used infoWindow.reposition() to solve it. I have it set to reposition at the point of the user's location, and stay there if the map view is changed. Sometimes this works, and sometimes it doesn't. I can't figure out why. I use the exact same logic later in the app where a chart is generated for a map click, and the popup works as it should every time. Here is the relevant section of the code:


Latitude = position.coords.latitude;
Longitude = position.coords.longitude;
pt = new Point(Longitude, Latitude);
map.centerAndZoom(pt, 17);;
map.infoWindow.resize(250, 170);
map.infoWindow.setTitle("Click on Chart");