0

I have used

html {
    -ms-touch-action: none;
    touch-action: none;
}

in styles and

 this.CordovaView.DisableBouncyScrolling = true;

on .cs file of Cordova MainPage.xaml.cs file.

With these fixes I can advance this much:

  1. Before state: map bounces on every touch, no pan possible
  2. After state: no bounce anymore, pan freezes in one minute of usage.

How could I get map functioning with pan events so that map does not freeze, stop working after some swipes there and here? Why map "remembers" some touch event outside the map and zoom happens with one finger only.

My sources:

[1] https://github.com/vilic/cordova-plugin-fix-wp-bouncing

[2] Prevent scrolling out of CordovaView in Cordova for Windows Phone 8

[3] https://github.com/openlayers/ol2/issues/1290

Community
  • 1
  • 1
mico
  • 12,730
  • 12
  • 59
  • 99
  • Pan seems to work better if map is full screen without a menu bar. I'll check that. – mico Aug 24 '16 at 06:46
  • Now it seems that better results come when you limit screen size so that no scroll is needed by the map oversize. – mico Aug 29 '16 at 05:36

1 Answers1

0

Catcha!

I limited the screen size so that map fit in one screen without scroll and then the style thing I mentioned in question was making the bounce go away.

I also limited the style to that page by dynamically adding a class to html and limiting the fix to that class:

js

    function applyClass(name,element,doRemove){
        if(typeof element.valueOf() == "string"){
            element = $wnd.document.getElementsByTagName(element)[0];
        }
        if(!element) return;
        if(doRemove){
            element.className = element.className.replace(new RegExp("\\b" + '\\s' + name + '\\s' + "\\b","g"), "");
        }else{      
            element.className = element.className + " " + name;
        }
    }
    applyClass('scrollfix', 'html', false); 

css

html.scrollfix {
    -ms-touch-action: none;
    touch-action: none;
}

Source of fix:

[1] How to dynamically create CSS class in JavaScript and apply?

Community
  • 1
  • 1
mico
  • 12,730
  • 12
  • 59
  • 99