Browser refresh resets GoogleMap markers, map center

0
0

The first load of my form places markers on the map, and centers coordinates.  If I hit Refresh in the browser, the markers disappear, and the map centers on Null Island (even though other elements, like listview items, remain the same)

So unless this is a WiseJ bug, I need to detect this refresh event (which does not fire form Load event), and re-draw the map markers, and re-center the map.  Where should I do this? thanks

 

 

  • You must to post comments
0
0

When the browser refreshes the page, everything is lost from the browser’s perspective. It’s just like navigating to another page. Wisej takes care of the state of all its controls, including GoogleMaps, but not for its internal objects. The GoogleMaps Wisej widget will restore the options, that’s probably why it centers at the original null. If you set the center in the options that it will persist.

To handle the Application.ApplicationRefresh event (or ApplicationExit, BeginRequest, etc.) attach to it in the Form’s constructor or in the Load event. ApplicationRefresh is fired when the browser reloads. When the handler is in the form, it’s a local method like any other in the form.

HTH

/Luca

 

  • You must to post comments
0
0

I realize there is Application_ApplicationRefresh event, but this fires in Program.vb and not frmMapView.vb — so if I were to use this event, I’m not sure how to check for an existing instance of the form containing the map, and then call a public method to redraw the map markers…

 

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.