MerginMaps / MerginMaps/mobile

Scale bar metric and imperial units for Settings

Open
#567 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
388
Forks
87
Avg merge
2d 7h
Merged PRs (30d)
20

Description

Imperial units may be useful for users in U.S., Myanmar, .. A combo box can be added to settings to choose metric or imerial units.
for main.qml:
```
// Scale bar units
function scalebar_settings(){
if(scalebar_combo.currentIndex === 0){
return QgsQuick.QgsUnitTypes.MetricSystem
}else{
return QgsQuick.QgsUnitTypes.ImperialSystem
}
}
ScaleBar {
id: scaleBar
anchors.bottomMargin: 10
mapSettings: mapCanvas.mapSettings
preferredWidth: Math.min(window.width, 180 * QgsQuick.Utils.dp)
z: zToolkits
systemOfMeasurement: Util.scalebar_settings()
anchors.horizontalCenter: parent.horizontalCenter
}
```
for settings:
```
RowLayout{
Text{
text:qsTr("Scale bar unit: ")
}
QQC2.ComboBox {
id: scalebar_combo
implicitWidth: 200
currentIndex: 0
model: ListModel {
ListElement { text: qsTr("Metric") }
ListElement { text: qsTr("Imperial") }
}
}
}
```
It would be easy to create combo box or radio box dialog with material design. It is just an idea :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with main.qml and the settings UI described in the issue, then trace how the existing scale bar and settings values are connected. Add a Metric/Imperial choice that controls the scale bar's unit system, and verify that changing the choice visibly changes the scale bar units.

Written by the indexing model from the issue text.

Assessment

Domain
design, mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.