Skip to content

Commit 04eb4d5

Browse files
author
Dmitriy Sidukov
committed
gmaps positioning fix
1 parent e7ad4b1 commit 04eb4d5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

core/src/main/java/com/omega_r/libs/omegaintentbuilder/builders/MapIntentBuilder.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,11 @@ class MapIntentBuilder(private vararg var types: MapTypes) : BaseActivityBuilder
186186

187187
if (startLatitude != null && startLongitude != null) {
188188
if (isDrivingModeEnabled) sb.append("google.navigation:q=", latitude, ",", longitude)
189-
else if (isPositioningEnabled) sb.append("http://maps.google.com/maps?daddr=", latitude, ",", longitude)
190189
else sb.append("http://maps.google.com/maps?saddr=${startLatitude},${startLongitude}&daddr=${latitude},${longitude}")
191-
} else {
190+
} else if (isPositioningEnabled && latitude != null && longitude != null) {
191+
sb.append("http://maps.google.com/maps?daddr=", latitude, ",", longitude)
192+
}
193+
else {
192194
if (viewType == null) {
193195
sb.append("geo:")
194196
if (latitude != null && longitude != null) {

0 commit comments

Comments
 (0)