jQueryGeo / geo

Small, fast & simple JavaScript mapping and geospatial API as a jQuery plugin
http://docs.jquerygeo.com
MIT License
422 stars 74 forks source link

1.0.0-b2 aborts any running AJAX requests #193

Closed EreMaijala closed 8 years ago

EreMaijala commented 8 years ago

Interacting with geomap e.g. by using .geomap('option', 'center', [27, 60]); aborts any running AJAX requests. 1.0.0-b1.5 seems to work properly. Tested with both Firefox 41.0.1 and Chrome 45.0.2454.101 (Mac OS X).

Here is a simple jsfiddle that demonstrates the issue: http://jsfiddle.net/eremaijala/ybLzab8c/1/ Here is a jsfiddle with the older b1.5 version that works: http://jsfiddle.net/eremaijala/twt13ws3/1/

ryanttb commented 8 years ago

Very true! It seems this is a side effect of our attempts to cancel image loading if you change the bbox of the map in any way, e.g., the user pans manually or you change center/zoom/etc via code.

if ( window.stop !== undefined ) {
  window.stop();
} else if( document.execCommand !== undefined ) {
  document.execCommand("Stop", false);
}

I hope there's a clean work around because it's a nice UX feature.

ryanttb commented 8 years ago

Also, thanks @EreMaijala for testing the library & finding this bug!

ryanttb commented 8 years ago

At the very least for b3, we should disable this until we can be sure to not cancel other AJAX requests in the process.