如何在Google地图上为起点和终点禁用信息窗口?

我正在Google地图上创建导航服务。一切正常。 我想仅禁用标记的起点(A)和终点(B)的信息窗口。如何隐藏或删除它?

Check this attached image for more details

如何在Google地图上为起点和终点禁用信息窗口?

这里是设置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);

    }
});


a178738667 回答:如何在Google地图上为起点和终点禁用信息窗口?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3161996.html

大家都在问