このページでは

MapRoute QML Type

MapRoute タイプは、地図上にルートを表示します。詳細...

Import Statement: import QtLocation 6.12
Since: QtLocation 5.0

プロパティ

詳細説明

MapRoute 型は、RouteModel またはその他の手段を通じて取得したルートを、その経路に沿ったポリラインとしてマップ上に表示します。

MapRouteは実際にはMapPolyline ですが、経路はcoordinates に直接指定するのではなく、route プロパティを使用して指定されます。

デフォルトでは、ルートは太さ1ピクセルの黒い線として表示されます。これは、line.width およびline.color プロパティを使用して変更できます。

使用例

以下に、map 上にroute を描画する方法を示します。

import QtQuick
import QtPositioning
import QtLocation

Map {
    RouteModel {
        id: routeModel
    }

    MapItemView {
        model: routeModel
        delegate: routeDelegate
    }

    Component {
        id: routeDelegate

        MapRoute {
            route: routeData
            line.color: "blue"
            line.width: 5
            smooth: true
            opacity: 0.8
        }
    }
}

プロパティのドキュメント

line group

line.color : color

line.width : int

このプロパティは、線プロパティグループの一部です。線プロパティグループには、線の描画に使用される幅と色が定義されています。

幅はピクセル単位で指定され、地図のズームレベルには依存しません。デフォルト値は、幅1ピクセルの黒い枠線に相当します。

線を表示しない場合は、幅を 0 に設定するか、透明色を使用してください。

route : Route

このプロパティには、描画されるルートが格納されており、1つの地理的なルートを表すために使用できます。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.