1
我正在使用ngMap,但infowindows未與標記對齊。他們通常看起來大約在他們的標記左上方50px。我要指出它的工作原來,那我們從蒙戈改爲SQL,出於某種原因,它從來沒有後對準....NgMap infowindow未與標記對齊
截圖
模板
<!-- the map -->
<ng-map
id="map"
scrollwheel="false"
class="row"
>
<marker
id="{{p.scheduleId}}"
ng-repeat="p in locatorGridData track by p.scheduleId"
position="{{p.latitude}}, {{p.longitude}}"
icon="{
url:'app/assets/img/placeholder.png',
scaledSize:[30,30]
}"
on-click="vm.selectFromMap(p)"
class="markers"
></marker>
<info-window id="infoWindow" visible-on-marker="vm.p.scheduleId">
<div ng-non-bindable="" ng-click="vm.selectFromMap({},vm.p)" style="cursor: pointer;">
<div class="practice-name">{{vm.p.locName}}</div>
<div class="name-specialty">{{vm.p.firstName}} {{vm.p.lastName}}, {{vm.p.speciality}}</div>
<div class="other-text-for-info-window">
{{vm.p.address1}}<br>
{{vm.p.city}}, {{vm.p.state}}<br>
{{vm.p.zip}}
</div>
</div>
</info-window>
</ng-map>
控制器
NgMap.getMap({id:'map'}).then(function(map) {
vm.map = map;
//GEOCODER
patientPos(vm.patientLat, vm.patientLon);
});
function patientPos(patientLat, patientLon) {
console.log(patientLat,patientLon, 'patient coordinate')
var bounds2 = new google.maps.LatLngBounds();
var latLng2 = new google.maps.LatLng($sessionStorage.patient_location.patientLat, $sessionStorage.patient_location.patientLon);
bounds2.extend(latLng2);
vm.map.fitBounds(bounds2);
vm.map.setZoom(12);
}
vm.showDetail = showDetail;
vm.hideDetail = hideDetail;
vm.selectFromMap = selectFromMap;
//info window stuff
function showDetail (e, p) {
vm.p = p;
console.log('showdetail', e, p)
vm.map.showInfoWindow('infoWindow', p.scheduleId);
};
function selectFromMap(e,p){
vm.p = p;
vm.map.showInfoWindow('infoWindow', p.scheduleId);
var getAllRows = $scope.grid1Api.core.getVisibleRows($scope.grid1Api.grid);
// c.log(getAllRows);
// console.log(schedules);
console.log(p)
vm.schedules.forEach(function(schedule,idx){
if(schedule.scheduleId == p.scheduleId){
$scope.grid1Api.selection.selectRow(vm.schedules[idx]);
console.log(schedules[idx]);
console.log(idx);
$scope.grid1Api.grid.getColumn('locName').filters[0] = {
term: vm.schedules[idx].locName
};
}
})
}
function hideDetail (e, p) {
if(vm.map){
vm.map.hideInfoWindow('infoWindow');
}
}
THANK YOU!你是正確的,id不能是一個整數。一旦我們將其更改爲字符串,所有餘額都會返回到Universe。我認爲在大規模(對於那些在路上看這個問題的人),如果你做了數據庫更改,請確保你的標記和infowindows上的新ID是字符串。 – IWI