我正在尝试让这个地图库正常工作......它似乎已经正确设置但我无法让它运行。这是带控制器的plunkr。 getOffices不会触发
<form ng-submit="getOffices()">
<input type="submit" id="submit" value="Show Map" />
</form>
$scope.getOffices = function () {
alert('1');
try{
alert('2');
var tmp = mapDataFactory.query();
alert('data: ' + tmp[0]);
$scope.GlobalOffices = $.grep(tmp, function (e) {
if (e.locationType === "HEADQUARTERS") {
e.markerIcon = $scope.map.icon.Headquarters;
}
else {
e.markerIcon = $scope.map.icon.Branch;
}
return true;
});
}
catch(e){
alert('e: ' + e);
}
}
http://plnkr.co/edit/WrfzbQSt1erFMCUsdTah?p=preview
谢谢!