ionic/angular leaflet directive - zoom in/out buttons do not work

后端 未结 2 644
一整个雨季
一整个雨季 2020-12-31 16:20

I have some problems with default zoom in/out buttons on leaflet map. Everything works fine when I load page directly but when I change one state to state where leaflet dire

相关标签:
2条回答
  • 2020-12-31 16:37

    Seems like ionic has a bug on the touch events handler. However, a colleague of mine came up with a workaround until it gets fixed.

    Basically, use his version of ionic.bundle.js (https://rawgit.com/cachiconato/ionic/angular-leaflet-control/release/js/ionic.bundle.js) and add 'data-do-not-set-coordinates="true"' to each possible tag linking to the map.

    http://codepen.io/anon/pen/sHpoy?editors=101

     <h2 data-do-not-set-coordinates="true">{{location.name}}</h2>
    
    0 讨论(0)
  • 2020-12-31 16:50

    The solution was simple. Ionic was "eating" all click events which was not created by a framework. For the container of leaflet map there was a need to add attribute data-tap-disabled="true"

    <ion-content data-tap-disabled="true">
        <leaflet height="480px"></leaflet>
    </ion-content>
    
    0 讨论(0)
提交回复
热议问题