이 페이지에서

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

이 속성은 그려질 경로를 포함하며, 하나의 지리적 경로를 나타내는 데 사용할 수 있습니다.

© 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.