-1
當數據來自靜態工廠時,我有此工作。現在,來自遠程服務器的AJAX調用($http
)中的數據出於某種原因,標記不會置於地圖上。使用AJAX進行Google地圖標記更新
工作plunker
基本上,如果我取消$http
並更換靜態數據,也不會顯示出來。它會顯示充滿了正確的數據變量markers
,只是不會填充地圖上的相似issue
當數據來自靜態工廠時,我有此工作。現在,來自遠程服務器的AJAX調用($http
)中的數據出於某種原因,標記不會置於地圖上。使用AJAX進行Google地圖標記更新
工作plunker
基本上,如果我取消$http
並更換靜態數據,也不會顯示出來。它會顯示充滿了正確的數據變量markers
,只是不會填充地圖上的相似issue
我的意思是設置mode.state爲true
類的標記加載後:
$scope.mode.state = false;
$scope.change_type = function(val) {
var markers = [];
$scope.eventMarkers = markers // clear the map of markers, before loading new
Events.venues(val.type).then(function(resp){
var venues = $.map(resp.data, function(value, index){return [value]})
for (var i = 0; i < venues.length; i++) {
event = venues[i]
markers.push(createMarker(i,event))
}
console.log(markers)
$scope.eventMarkers = markers
$scope.mode.state = true;
}, function(errror){
console.debug(error)
});
}
我試過ng-如果,它給了我一些奇怪的錯誤:'錯誤:無法執行'節點'上的appendChild':此節點類型不支持此方法。「但它沒有改變任何東西,我讓它工作得很好,用ng-show for來自工廠的靜態數據。 – rodling
與NG嘗試-if並在第一批標記加載後將mode.state設置爲true,在我的應用程序中使用ui-gmap ng-show messes並將其定位錯誤 –
mode.state爲true。地圖清晰可見,標記不是 – rodling
發現類似問題,試圖找出這個 http://stackoverflow.com/questions/22372161/using-ng-repeat-with-markers-in-ngmap – rodling