Skip to content

Commit 45b1924

Browse files
committed
fixed 'adding waypoint' bug.
code cleanup.
1 parent 2fe02d8 commit 45b1924

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

Android/build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ repositories {
77
dependencies {
88
compile 'com.android.support:support-v4:19.+'
99
compile 'com.google.android.gms:play-services:4.0.30'
10+
compile 'com.google.guava:guava:16.0.1'
1011
compile 'org.slf4j:slf4j-api:1.7.7'
1112
compile 'org.slf4j:slf4j-nop:1.7.7'
1213
compile 'org.osmdroid:osmdroid-android:4.1'
13-
compile 'com.google.guava:guava:16.0.1'
14-
compile project(':Core')
14+
1515
compile files('libs/usbseriallibrary.jar')
1616
compile files('libs/wearable-preview-support.jar')
17-
compile files('libs/osmbonuspack_v4.3.jar')
18-
19-
20-
17+
compile files('libs/osmbonuspack_v4.4.jar')
18+
19+
compile project(':Core')
2120
compile project(':Mavlink')
2221
compile project(':HorizontalVariableListView:HorizontalVariableListView')
2322
compile project(':usb-serial-for-android:UsbSerialLibrary')

Android/libs/osmbonuspack_v4.3.jar

-154 KB
Binary file not shown.

Android/libs/osmbonuspack_v4.4.jar

156 KB
Binary file not shown.

Android/src/org/droidplanner/android/maps/providers/osm/OSMapFragment.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ private void setupMapUI() {
148148
new MapEventsReceiver() {
149149

150150
@Override
151-
public boolean singleTapUpHelper(IGeoPoint iGeoPoint) {
151+
public boolean singleTapConfirmedHelper(GeoPoint iGeoPoint) {
152152
if (mMapClickListener != null) {
153153
mMapClickListener.onMapClick(DroneHelper.GeoPointToCoord(iGeoPoint));
154154
return true;
@@ -157,7 +157,7 @@ public boolean singleTapUpHelper(IGeoPoint iGeoPoint) {
157157
}
158158

159159
@Override
160-
public boolean longPressHelper(IGeoPoint iGeoPoint) {
160+
public boolean longPressHelper(GeoPoint iGeoPoint) {
161161
if (mMapLongClickListener != null) {
162162
mMapLongClickListener.onMapLongClick(DroneHelper.GeoPointToCoord(iGeoPoint));
163163
return true;
@@ -197,6 +197,16 @@ public void onResume() {
197197
.DEFAULT_TILE_SOURCE.name());
198198
mMapView.setTileSource(tileSource);
199199

200+
mLocationOverlay.enableMyLocation();
201+
mCompassOverlay.enableCompass();
202+
203+
applyMapPreferences();
204+
}
205+
206+
/**
207+
* Applies the map preferences specified by the user.
208+
*/
209+
private void applyMapPreferences(){
200210
//Check if autopan should be enabled.
201211
final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences
202212
(getActivity().getApplicationContext());
@@ -205,9 +215,6 @@ public void onResume() {
205215
if(autoPan) {
206216
mLocationOverlay.enableFollowLocation();
207217
}
208-
209-
mLocationOverlay.enableMyLocation();
210-
mCompassOverlay.enableCompass();
211218
}
212219

213220
@Override

0 commit comments

Comments
 (0)