0
我正在开发一个aplication与IonicFramework与phonegap-googlemaps-plugin,当在信息窗口的标记的用户点击,它会调用确认功能,然后调用launchNavigation如果真。
我的问题是,如果我使用本机确认功能它的伟大工程,但是当我试图用$ionicPopup.confirm({})我不能点击确认的按钮。看起来我不断点击地图。
我已经尝试更改类'popup-containe'的z-index属性,但似乎不按我期望的方式工作。
data.map(function (m) {
var latLng = new plugin.google.maps.LatLng(m.lat, m.lng)
latLngs.push(latLng);
map.addMarker({
position: latLng,
title: m.placa,
snippet: 'Clique para ir nessa localização.',
styles : {
'text-align': 'center',
'font-weight': 'bold'
}
}, function (marker) {
marker.addEventListener(plugin.google.maps.event.INFO_CLICK, function(marker) {
var confirm = $ionicPopup.confirm({
title: m.placa,
template: 'Abrir navegação para essa localização?',
okText: 'Sim',
cancelText: 'Não'
})
document.getElementsByClassName('popup-container')[0].style.zIndez = 999999;
confirm.then(function (response) {
if (response) {
map.getMyLocation(function (location) {
mobileLocation = location.latLng;
marker.getPosition(function(markerLocation) {
plugin.google.maps.external.launchNavigation({
'from': mobileLocation,
'to': markerLocation
});
})
})
}
})
$timeout(function() {
confirm.close();
}, 3000);
/*
if (confirm("Abrir direção para " + m.placa)) {
map.getMyLocation(function(location) {
mobileLocation = location.latLng;
marker.getPosition(function (markerLocation) {
plugin.google.maps.external.launchNavigation({
"from": mobileLocation,
"to": markerLocation
});
});
});
}
*/
});
});
});
感谢
尝试'$ scope.confirm'而不是'var confirm'。 –
@mudasserajaz没有工作。这样,即使在这里超时工作关闭。 idk为什么。 – SillasSoares