Commit 0e01cfe0 authored by Deployer's avatar Deployer

Fixes an issue in Distance API where wrong pair of latitudes and longitudes were submitted.

parent a5365b7e
...@@ -3,16 +3,16 @@ apply plugin: 'signing' ...@@ -3,16 +3,16 @@ apply plugin: 'signing'
apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.github.dcendents.android-maven'
group = "com.cedarmaps" group = "com.cedarmaps"
version = "3.1.0" version = "3.1.1"
def siteUrl = 'http://cedarmaps.com' def siteUrl = 'http://cedarmaps.com'
def gitUrl = 'http://cedarmaps.com/git' def gitUrl = 'http://cedarmaps.com/git'
android { android {
compileSdkVersion 27 compileSdkVersion 28
defaultConfig { defaultConfig {
minSdkVersion 15 //IceCream Sandwich 4.0.3 minSdkVersion 15 //IceCream Sandwich 4.0.3
targetSdkVersion 27 //Oreo targetSdkVersion 28 //Pie
} }
} }
......
...@@ -389,17 +389,17 @@ public class CedarMaps { ...@@ -389,17 +389,17 @@ public class CedarMaps {
*/ */
public void distance(Pair<LatLng, LatLng>[] coordinatePairs, final GeoRoutingResultListener completionHandler) { public void distance(Pair<LatLng, LatLng>[] coordinatePairs, final GeoRoutingResultListener completionHandler) {
String pairs = ""; StringBuilder pairs = new StringBuilder();
String delimiter = ""; String delimiter = "";
for (Pair<LatLng, LatLng> locationPair : coordinatePairs) { for (Pair<LatLng, LatLng> locationPair : coordinatePairs) {
pairs += delimiter + String.format(Locale.ENGLISH, "%1$s,%2$s;%3$s,%4$s", locationPair.first.getLatitude(), pairs.append(delimiter).append(String.format(Locale.ENGLISH, "%1$s,%2$s;%3$s,%4$s", locationPair.first.getLatitude(),
locationPair.first.getLongitude(), locationPair.second.getLatitude(), locationPair.second.getLatitude()); locationPair.first.getLongitude(), locationPair.second.getLatitude(), locationPair.second.getLongitude()));
delimiter = "/"; delimiter = "/";
} }
String url = String.format(Locale.ENGLISH, String url = String.format(Locale.ENGLISH,
AuthenticationManager.getInstance().getAPIBaseURL() + "distance/%1$s/%2$s", AuthenticationManager.getInstance().getAPIBaseURL() + "distance/%1$s/%2$s",
mDirectionID, pairs); mDirectionID, pairs.toString());
getResponseBodyFromURL(url, new NetworkResponseBodyCompletionHandler() { getResponseBodyFromURL(url, new NetworkResponseBodyCompletionHandler() {
@Override @Override
......
...@@ -38,7 +38,7 @@ Then, add this to the `build.gradle` of your **app** module: ...@@ -38,7 +38,7 @@ Then, add this to the `build.gradle` of your **app** module:
```groovy ```groovy
dependencies { dependencies {
implementation 'com.cedarmaps:CedarMapsSDK:3.1.0' implementation 'com.cedarmaps:CedarMapsSDK:3.1.1'
} }
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment