Skip to content

Conversation

fishjam
Copy link
Contributor

@fishjam fishjam commented Sep 24, 2025

add tianditu(map provider in china) supports.

Description

add tianditu(map provider in china) supports. refer #13429

Test Steps

  1. choose TianDi in Maps > Provider
  2. input the TianDiTu Tokens ( apiKey applied from https://oauth.tianditu.gov.cn/ ), type must be Web App.
  3. then can use map for China.
image image

Checklist:

Related Issue

Closes #13429

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

add tianditu(map provider in china) supports.
@HTRamsey HTRamsey requested a review from Copilot October 6, 2025 04:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for the TianDiTu map provider, including token-based configuration and tile URL generation, enabling map usage within China.

  • Introduces a new tiandituToken app setting and UI field.
  • Adds TianDiTu Road and Satellite providers to the Qt Location plugin.
  • Wires provider sources into build and provider list.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/UI/AppSettings/MapSettings.qml Adds TianDiTu token input to settings UI and a new property for the token.
src/Settings/AppSettings.h Declares tiandituToken as a setting.
src/Settings/AppSettings.cc Registers tiandituToken setting.
src/Settings/App.SettingsGroup.json Defines tiandituToken metadata.
src/QtLocationPlugin/QGCMapUrlEngine.cpp Registers TianDiTu providers in the provider list.
src/QtLocationPlugin/Providers/TianDiMapProvider.h Implements TianDiTu provider classes and configuration.
src/QtLocationPlugin/Providers/TianDiMapProvider.cpp Implements tile URL generation using the TianDiTu token.
src/QtLocationPlugin/CMakeLists.txt Adds TianDiTu provider sources to the plugin build.
src/QmlControls/OfflineMapEditor.qml Adds TianDiTu token property to offline map editor.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

TianDiRoadMapProvider()
: TianDiMapProvider(
QObject::tr("TianDi Road"),
QStringLiteral("cia_w"),
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The map type code for the road map uses 'cia_w', which is the annotations/labels layer in TianDiTu, not the base road tiles. Use 'vec_w' for the street/vector base layer so the Road provider returns actual base map tiles.

Suggested change
QStringLiteral("cia_w"),
QStringLiteral("vec_w"),

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according the http://lbs.tianditu.gov.cn/server/MapService.html ,
vec_w is 矢量底图(Vector base map), there is no streat name in it.
cia_w is 影像注记(Image annotation), there is streat name in it.

I don't know much about map development, but we want the road with streat name.
example: use cia_w , and change 'Road' to a more suitable Provider type, is there any suggestion for it?

@HTRamsey HTRamsey merged commit 28f1657 into mavlink:master Oct 10, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add TiandiTu (Map Provider) support

2 participants