Skip to content

Commit

Permalink
v0.8.1:
Browse files Browse the repository at this point in the history
  - Initial zoom level setting with translations
  - Native icon to show position + fixed auto-center on Xperia (check horizontalAccuracy)
  • Loading branch information
sthocs committed Nov 18, 2017
1 parent 9d78e57 commit 872dacd
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can also save your favourites stations and see their status on the cover.

500+ cities availables in 50+ countries. Check if yours is there!

Get it on [OpenRepos](https://openrepos.net/content/sthocs/bikeme).
Get it on [OpenRepos](https://openrepos.net/content/sthocs/bikeme).
Translations on [Transifex](https://www.transifex.com/sthocs/harbour-bikeme).

![BikeMe banner](images/banner.png)
Binary file removed qml/icons/me.png
Binary file not shown.
6 changes: 3 additions & 3 deletions qml/items/StationMarker.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ Item {
property string _COLOR_AVAILABLE : "#77A834"
property string _COLOR_ALMOST_EMPTY : "orange"
property string _COLOR_EMPTY : "red"
property string _COLOR_SELECTED1 : "steelblue" // blue when data is available
property string _COLOR_SELECTED1 : "DodgerBlue" // blue when data is available
property string _COLOR_SELECTED2 : "#D60080" // pink when no data is available

Rectangle {
z: 2
width: Theme.iconSizeSmall; height: Theme.iconSizeSmall
radius: 10
color: {
if (!opened) {
if (!opened && !selected) {
return "grey";
}
if (!displayAllStatus || available < 0) {
Expand Down Expand Up @@ -60,7 +60,7 @@ Item {
x: Theme.iconSizeSmall / 4; y: Theme.iconSizeSmall / 4 * 2.5
width: Theme.iconSizeSmall / 2; height: Theme.iconSizeSmall / 2 // c²=512 -> c=22.63 -> c/2=11.31
color: {
if (!opened) {
if (!opened && !selected) {
return "grey";
}
if (selected) {
Expand Down
26 changes: 15 additions & 11 deletions qml/pages/InteractiveMap.qml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ Page {

Component.onCompleted: {
center = QtPositioning.coordinate(43.5508823, 7.0168207);
map.zoomLevel = autoEnableGPS ? 14 : city.zoom || 13;
if (mapPlugin === "osm") {
map.zoomLevel += 1;
}
var zoomSetting = !isNaN(configManager.getSetting("zoomLevel")) ?
parseInt(configManager.getSetting("zoomLevel")) : 15
zoomLevel = zoomSetting >= minimumZoomLevel && zoomSetting <= maximumZoomLevel ?
zoomSetting : 15

updateFilter();
stationLoadingLabel.visible = true;
stations.city = city;
Expand All @@ -74,7 +75,6 @@ Page {
}

gesture.onPanFinished: {
console.log("Pan FINISHED");
updateFilter();
}
gesture.onPinchFinished: {
Expand All @@ -88,10 +88,11 @@ Page {
coordinate: positionSource.position.coordinate
visible: positionReceived
sourceItem: Image {
source: "../icons/me.png"
id: dot
source: "image://theme/icon-m-dot?DodgerBlue"
}
anchorPoint.x: 24
anchorPoint.y: 24
anchorPoint.x: dot.width / 2
anchorPoint.y: dot.height / 2
}

MapMouseArea {
Expand Down Expand Up @@ -279,7 +280,8 @@ Page {
active: false

onPositionChanged: {
if (!positionReceived && active && position.horizontalAccuracyValid) { // First time we receive a valid position, go to it.
if (!positionReceived && active && position.horizontalAccuracyValid &&
position.horizontalAccuracy < 500) { // First time we receive a valid position, go to it.
positionReceived = true;
// Keep coordinates in a different object to avoid map auto-centering.
var pos = QtPositioning.coordinate(positionSource.position.coordinate.latitude,
Expand Down Expand Up @@ -377,7 +379,8 @@ Page {

Image {
id: centerPosIcon
source: positionReceived ? "image://theme/icon-cover-location" : "image://theme/icon-cover-location?gray"
source: positionSource.active && positionSource.position.horizontalAccuracyValid &&
positionSource.position.horizontalAccuracy < 500 ? "image://theme/icon-cover-location" : "image://theme/icon-cover-location?gray"
anchors {
right: gpsIcon.left
rightMargin: Theme.paddingMedium
Expand All @@ -391,7 +394,8 @@ Page {
MouseArea {
anchors.fill: parent
onClicked: {
if (positionReceived) {
if (positionSource.active && positionSource.position.horizontalAccuracyValid &&
positionSource.position.horizontalAccuracy < 500) {
map.center = map.toCoordinate(Qt.point(map.width / 2, map.height / 2));
var pos = QtPositioning.coordinate(positionSource.position.coordinate.latitude,
positionSource.position.coordinate.longitude)
Expand Down
13 changes: 13 additions & 0 deletions qml/pages/Settings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ Page {
checked = configManager.getSetting("autoEnableGPS") !== "false";
}
}
Slider {
label: qsTr("Map initial zoom level")
width: parent.width
minimumValue: 12
maximumValue: 18
value: !isNaN(configManager.getSetting("zoomLevel")) ?
parseInt(configManager.getSetting("zoomLevel")) : 15
valueText: value
stepSize: 1
onValueChanged: {
configManager.saveSetting("zoomLevel", value);
}
}
Item {
width: parent.width
height: Theme.paddingLarge * 5
Expand Down
5 changes: 5 additions & 0 deletions rpm/harbour-bikeme.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
* Mon Nov 13 2017 Sthocs <sthocs@hotmail.com> 0.8.1-1
- Use native icon to show position
- Map initial zoom level setting
- Removed dead systems, added tests, added Rennes (fr)

* Tue Jun 27 2017 Sthocs <sthocs@hotmail.com> 0.8-1
- Added option to use CityBikes as data source
- Workaround for the onPanFinished bug
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-bikeme.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: harbour-bikeme
Summary: Find a bike with your Sailfish OS device!
Version: 0.8
Version: 0.8.1
Release: 1
Group: Qt/Qt
URL: https://openrepos.net/users/sthocs
Expand Down
6 changes: 5 additions & 1 deletion translations/harbour-bikeme-en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</message>
<message>
<source>Many thanks for the translations: %1</source>
<translation>Many thanks for the translations: %</translation>
<translation>Many thanks for the translations: %1</translation>
</message>
<message>
<source>This app helps you to find a bike or a free parking spot for various self-service bicycle schemes arround the world:&lt;ul&gt;%1&lt;li&gt;And more!&lt;/li&gt;&lt;/ul&gt;BikeMe provides a simple interactive map displaying all stations by city, their number of available bikes and free parking spots, and the geolocation.&lt;br /&gt;Click on %2 to activate the geolocation and on %3 to center the map on your position.&lt;br/&gt;Regular users: Save your favourites stations and see their status directly on the cover!</source>
Expand Down Expand Up @@ -254,5 +254,9 @@
<source>Open map on my position</source>
<translation>Open map on my position</translation>
</message>
<message>
<source>Map initial zoom level</source>
<translation>Map initial zoom level</translation>
</message>
</context>
</TS>
4 changes: 4 additions & 0 deletions translations/harbour-bikeme-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,9 @@
<source>Open map on my position</source>
<translation>Abrir mapa en tu posición</translation>
</message>
<message>
<source>Map initial zoom level</source>
<translation>Nivel de zoom inicial en mapa</translation>
</message>
</context>
</TS>
4 changes: 4 additions & 0 deletions translations/harbour-bikeme-fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,9 @@
<source>Open map on my position</source>
<translation>Ouvrir la carte sur ma position</translation>
</message>
<message>
<source>Map initial zoom level</source>
<translation>Zoom initial de la carte</translation>
</message>
</context>
</TS>
4 changes: 4 additions & 0 deletions translations/harbour-bikeme-pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,9 @@
<source>Open map on my position</source>
<translation>Otwórz mapę w mojej lokalizacji</translation>
</message>
<message>
<source>Map initial zoom level</source>
<translation>Początkowy poziom powiększenia mapy</translation>
</message>
</context>
</TS>
4 changes: 4 additions & 0 deletions translations/harbour-bikeme-ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,9 @@
<source>Open map on my position</source>
<translation>Показать мое местоположение на карте</translation>
</message>
<message>
<source>Map initial zoom level</source>
<translation>Масштаб карты при запуске приложения</translation>
</message>
</context>
</TS>
4 changes: 4 additions & 0 deletions translations/harbour-bikeme-sv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,9 @@
<source>Open map on my position</source>
<translation>Öppna kartan på min position</translation>
</message>
<message>
<source>Map initial zoom level</source>
<translation>Kartans inledande zoomnivå</translation>
</message>
</context>
</TS>
4 changes: 4 additions & 0 deletions translations/harbour-bikeme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,9 @@
<source>Open map on my position</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Map initial zoom level</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

0 comments on commit 872dacd

Please sign in to comment.