【发布时间】:2016-08-03 09:34:57
【问题描述】:
我只是在 AngularJS(Ionic) 中使用 Wikiitude 和 Google 地图。我需要在我的控制器中为 InfoWindow 设置 ng-click 事件。我的代码:
google.maps.event.addListenerOnce($scope.map, 'idle', function(){
var marker = new google.maps.Marker({
map: $scope.map,
animation: google.maps.Animation.DROP,
position: latLng
});
var infoWindow = new google.maps.InfoWindow({
content: '<a href="#" ng-click="launchAR(\'my_world_pls\')">CATCH!</a>'
});
google.maps.event.addListener(marker, 'click', function () {
infoWindow.open($scope.map, marker);
});
});
【问题讨论】:
-
好的。当您尝试您的代码时会发生什么?
-
没有渲染标记和信息窗口。但链接无效
-
你能把
a标签上的href去掉试试看吗?
标签: javascript angularjs google-maps ionic-framework