Domanda

I have created a Windows Store app using JavaScript / HTML5 targeting Windows 8.1. The app has a leaflet 0.7.2 map on 3 pages in my single page application. I have the same application which runs great in the browser. The WinRT app also works great while debugging. The problem only occurs when I'm not debugging, then the maps starts freezing on zoom. When I use the app slowly, the map hardly ever freezes, but when I zoom 5- 10 times quickly in a row, the map freezes and only starts being responsive after I navigate to another page and then back to the map page.

I tried the following and these things are still active in my app:

  • set a timeout around my zoomanimation and loadtile function
  • set zoomanimation and fadeanimation to true
  • I set unloadinvisibletiles to true

I turned on WinJS logging and i set WinJS.Application.onerror to log if an error occurs. But no errors or exceptions get thrown whatsever.

Does anyone know what I can do do solve this nasty bug?

Thanks in advance,

Ian

È stato utile?

Soluzione

I've found a bug report which includes a workaround that works!

See here: https://github.com/Leaflet/Leaflet/issues/2693

Specifically, you need to add a bit of code:

map.on('zoomanim', debounce(map._onZoomTransitionEnd, 250));

The debounce function can be found here: http://davidwalsh.name/javascript-debounce-function

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top