简体   繁体   English

角度传单指令问题:除了地图之外的其他部分不会显示第二次进入页面

[英]Angular leaflet directive issue: other parts besides the map does't show the second time entering the page

Angular leaflet directive issue: other parts besides the map does't show the second time entering the page. 角度传单指令问题:除了地图之外的其他部分不会显示第二次进入页面。 I am using ionic and angular leaflet directive to develop a map function. 我正在使用离子和角度传单指令来开发一个map函数。 On iPhone, iOS10 this issue occurs, while on browser, it works fine. 在iPhone,iOS10上会出现此问题,而在浏览器上,它可以正常工作。

As seen in the picture 1, the panel in the right below corner, will not show the second time I get in the page until I tap the map for one or two times. 如图1所示,右下角的面板不会显示我第二次进入页面,直到我点击地图一两次。 But the first time I get in the page, it works. 但是我第一次进入页面时,它确实有效。

屏幕

The code is listed below: 代码如下:

<div data-tap-disabled="true" class="map-container" style="height:100%">

<leaflet id='mapbox' defaults="defaults"  tiles="tiles" lf-center="mapCenter" event-broadcast="events" maxbounds="maxbounds" markers="markersArray" width="100%" height="100%"></leaflet>

</div>

<div class="button-panel">
    <div class="tripguide-icon-hotel" ng-click="selectSitesAround(1)" ng-class="{selected:hotelSelected, deselected:!hotelSelected}"></div>
    <div class="tripguide-icon-poi" ng-click="selectSitesAround(2)" ng-class="{selected:poiSelected, deselected:!poiSelected}"></div>
    <div class="tripguide-icon-dining" ng-click="selectSitesAround(3)" ng-class="{selected:diningSelected, deselected:!diningSelected}"></div>
    <div class="tripguide-icon-list" ng-click="clickList()" ng-class="{deselected:!listSelected}"></div>
</div>

CSS: CSS:

.button-panel {
   z-index: 1000;
   opacity: 0.85;
   width: 76px;
   right: 80px;
   bottom: 128px;
   position: absolute;
}

I resolved this issue by using ionic's directive instead of using div. 我通过使用ionic的指令而不是使用div解决了这个问题。

<ion-pane class="map-panel-pane">
<div class="button-panel">
    <div class="tripguide-icon-hotel" ng-click="selectSitesAround(1)" ng-class="{selected:hotelSelected, deselected:!hotelSelected}"></div>
    <div class="tripguide-icon-poi" ng-click="selectSitesAround(2)" ng-class="{selected:poiSelected, deselected:!poiSelected}"></div>
    <div class="tripguide-icon-dining" ng-click="selectSitesAround(3)" ng-class="{selected:diningSelected, deselected:!diningSelected}"></div>
    <div class="tripguide-icon-list" ng-click="clickList()" ng-class="{deselected:!listSelected}"></div>

</div>
</ion-pane>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM