我正在Google地图上创建导航服务。一切正常。 我想仅禁用标记的起点(A)和终点(B)的信息窗口。如何隐藏或删除它?
Check this attached image for more details
这里是设置Google Map的代码。它用角形书写。
$scope.directionsService.route({
origin: {'placeId': $scope.originPlaceId},destination: {'placeId': $scope.destinationPlaceId},travelMode: defaultTravelMode
},function (response,status) {
if (status === 'OK') {
$scope.directionsDisplay.setDirections(response);
$scope.path = new google.maps.Polyline({
path: response.routes[0].overview_path
});
// filter stores by path
$scope.filterStoresByDirectionPath($scope.path);
}
});
//function to design infowindow of marker
$scope.newMarker = function (opts) {
let marker = new google.maps.Marker(opts);
marker.travelTime = opts.travelTime;
marker.timeValue = opts.timeValue;
marker.url = opts.url;
$scope._on({
obj: marker,event: 'click',callback: function () {
let content = 'Marker content';
if ($scope.infoWindow) {
$scope.infoWindow.close();
}
$scope.infoWindow = new google.maps.InfoWindow({content: content});
$scope.infoWindow.open($scope.map,marker);
}
});