[英]Leaflet marker icon click event is not working
I'm facing a problem with leaflet marker normally when i refresh the page the marker is clickable but when i come from another page marker is not clickable I try all the thing but did not find any solution. 当我刷新页面时,我通常会遇到小叶标记的问题,该标记是可单击的,但是当我来自另一个页面标记却不可单击时,我尝试了所有操作,但未找到任何解决方案。
JAVASCRIPT: JAVASCRIPT:
angular.extend($scope, {
center: {
lat: 51.505,
lng: -0.09,
zoom: 8
},
markers: {},
}); });
mapService.getLocation(function(location) {
$scope.center = {
lat: location.lat,
lng: location.long,
zoom: 12
};
$scope.$digest($scope.center);
mapService.getMarkers(
new google.maps.LatLng(location.lat, location.long),
document.getElementById('map'), ['school'],
function(results) {
results.forEach(function(marker) {
var __location = marker.geometry.location.toJSON();
$scope.markers[marker.id] = {
lat: __location.lat,
lng: __location.lng,
message: marker.name,
focus: false
}
});
$scope.$digest($scope.markers);
}
)
});
HTML: HTML:
<leaflet
width="100%"
markers="markers"
lf-center="center">
[NOTE] I'm using leaflet(ver: "0.7.7") and angular-leaflet-directive(version: "0.10.0"). [注意]我正在使用传单(版本:“ 0.7.7”)和角叶指令(版本:“ 0.10.0”)。
我的问题仅通过添加传单地图的data-tap-disabled="true"
父标签即可解决
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.