BrianBunker / cmv-widgets

Widgets based on the Esri jsapi, configured for the Configurable Map Viewer. Widgets include Drag and Drop, Goto, Map Navigation Hash, and Nearby.
https://brianbunker.github.com/cmv-widgets
MIT License
18 stars 24 forks source link

Navigation Hash Widget Error in Google Chrome Browser #47

Open drusexton opened 7 years ago

drusexton commented 7 years ago

@BrianBunker

When using Google Chrome to access an application that implements the Navigation Hash widget there is an error when you attempt to open a new tab in the browser window and access another URL that has a Navigation hash reference. I have tested this issue in other browsers, but have only been able to recreate it in Google Chrome. The error occurs almost every single time, but on occasion will not.

In #740 I list the following steps to recreate this issue:

  1. Open the application in Google Chrome using the following public URL.
  2. Open a new tab in the same browser window.
  3. Paste the public URL from step 1 into the address bar and hit enter.
  4. There are no errors in the browser console.

The map should zoom to the same extent in the second browser tab as it does in the first browser tab. Rather what you will see is that in the second browser tab the latitude and longitude has been ignored, and that the map is instead zoomed to the extent of the map center using the specified zoom from the Navigation Hash widget.

Any help to resolve this issue would be excellent!

BrianBunker commented 7 years ago

Just an observation: the nav hash does not update on pan/zoom in second tab since there seems to be a race condition with the map panning/zooming events that happen on application load. If you manually update the nav hash in the url, the app will pan to the correct location.

gregoryj98 commented 7 years ago

I set the initial extent of the map (on load) to that of the coordinates in the URL and that seemed to fix things up...but probably not the correct way to fix the problem - I am not super familiar with dojo stuff.