Commit a3f6138a authored by Deployer's avatar Deployer

Added vector styles support. Added POI searching. Added turn by turn…

Added vector styles support. Added POI searching. Added turn by turn instructions in direction results. Added new logo. Updated to Mapbox v6.3.0
parent 910f84de
...@@ -3,7 +3,7 @@ apply plugin: 'signing' ...@@ -3,7 +3,7 @@ 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.0.0" version = "3.1.0"
def siteUrl = 'http://cedarmaps.com' def siteUrl = 'http://cedarmaps.com'
def gitUrl = 'http://cedarmaps.com/git' def gitUrl = 'http://cedarmaps.com/git'
...@@ -17,9 +17,9 @@ android { ...@@ -17,9 +17,9 @@ android {
} }
dependencies { dependencies {
api 'com.cedarmaps:mapbox-android-sdk:6.0.1' api 'com.cedarmaps:mapbox-android-sdk:6.3.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0' implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.google.code.gson:gson:2.8.2' implementation 'com.google.code.gson:gson:2.8.5'
} }
// From https://raw.github.com/mcxiaoke/gradle-mvn-push/master/gradle-mvn-push.gradle // From https://raw.github.com/mcxiaoke/gradle-mvn-push/master/gradle-mvn-push.gradle
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
package="com.cedarstudios.cedarmapssdk"> package="com.cedarstudios.cedarmapssdk">
<application android:allowBackup="true"> <application android:allowBackup="true">
</application> </application>
</manifest> </manifest>
...@@ -68,11 +68,15 @@ final class AuthenticationManager { ...@@ -68,11 +68,15 @@ final class AuthenticationManager {
} }
void setClientID(@NonNull String clientID) { void setClientID(@NonNull String clientID) {
mClientID = clientID; if (!clientID.equals(mClientID)) {
mClientID = clientID;
}
} }
void setClientSecret(@NonNull String clientSecret) { void setClientSecret(@NonNull String clientSecret) {
mClientSecret = clientSecret; if (!clientSecret.equals(mClientSecret)) {
mClientSecret = clientSecret;
}
} }
void getAccessToken(final @Nullable AccessTokenListener completionHandler) { void getAccessToken(final @Nullable AccessTokenListener completionHandler) {
...@@ -123,10 +127,12 @@ final class AuthenticationManager { ...@@ -123,10 +127,12 @@ final class AuthenticationManager {
} }
void setContext(@NonNull Context context) { void setContext(@NonNull Context context) {
mContext = context.getApplicationContext(); if (mContext == null) {
LocalBroadcastManager.getInstance(mContext) mContext = context.getApplicationContext();
.registerReceiver(instance.mapViewError401BroadcastReceiver, LocalBroadcastManager.getInstance(mContext)
new IntentFilter(INTENT_FILTER_TILE_HTTP_CODE_401)); .registerReceiver(instance.mapViewError401BroadcastReceiver,
new IntentFilter(INTENT_FILTER_TILE_HTTP_CODE_401));
}
} }
Context getContext() { Context getContext() {
...@@ -184,7 +190,7 @@ final class AuthenticationManager { ...@@ -184,7 +190,7 @@ final class AuthenticationManager {
} }
@Nullable @Nullable
private String getSavedAccessToken() throws CedarMapsException { String getSavedAccessToken() throws CedarMapsException {
if (mContext == null) { if (mContext == null) {
throw new CedarMapsException("Context is not set. Please call 'setContext' method on CedarMaps.getInstance()"); throw new CedarMapsException("Context is not set. Please call 'setContext' method on CedarMaps.getInstance()");
} }
......
...@@ -9,37 +9,40 @@ import android.support.annotation.Nullable; ...@@ -9,37 +9,40 @@ import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager; import android.support.v4.content.LocalBroadcastManager;
import android.util.AttributeSet; import android.util.AttributeSet;
import com.cedarstudios.cedarmapssdk.listeners.AccessTokenListener;
import com.mapbox.mapboxsdk.Mapbox; import com.mapbox.mapboxsdk.Mapbox;
import com.mapbox.mapboxsdk.maps.MapboxMapOptions; import com.mapbox.mapboxsdk.maps.MapboxMapOptions;
import java.util.Locale; import java.util.Locale;
import java.util.Map;
public class MapView extends com.mapbox.mapboxsdk.maps.MapView { public class MapView extends com.mapbox.mapboxsdk.maps.MapView {
private BroadcastReceiver mBroadcastReceiver = null; private BroadcastReceiver mBroadcastReceiver = null;
private String currentStyle;
public MapView(@NonNull Context context) { public MapView(@NonNull Context context) {
super(context); super(context);
setupBroadcastReceiver(); setupBroadcastReceiver();
setupStyleURL(); setDefaultStyleURL();
} }
public MapView(@NonNull Context context, @Nullable AttributeSet attrs) { public MapView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs); super(context, attrs);
setupBroadcastReceiver(); setupBroadcastReceiver();
setupStyleURL(); setDefaultStyleURL();
} }
public MapView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { public MapView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr); super(context, attrs, defStyleAttr);
setupBroadcastReceiver(); setupBroadcastReceiver();
setupStyleURL(); setDefaultStyleURL();
} }
public MapView(@NonNull Context context, @Nullable MapboxMapOptions options) { public MapView(@NonNull Context context, @Nullable MapboxMapOptions options) {
super(context, options); super(context, options);
setupBroadcastReceiver(); setupBroadcastReceiver();
setupStyleURL(); setDefaultStyleURL();
} }
private void setupBroadcastReceiver() { private void setupBroadcastReceiver() {
...@@ -47,7 +50,11 @@ public class MapView extends com.mapbox.mapboxsdk.maps.MapView { ...@@ -47,7 +50,11 @@ public class MapView extends com.mapbox.mapboxsdk.maps.MapView {
mBroadcastReceiver = new BroadcastReceiver() { mBroadcastReceiver = new BroadcastReceiver() {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
setupStyleURL(); if (currentStyle == null) {
setDefaultStyleURL();
} else {
setStyleUrl(currentStyle);
}
} }
}; };
...@@ -56,12 +63,46 @@ public class MapView extends com.mapbox.mapboxsdk.maps.MapView { ...@@ -56,12 +63,46 @@ public class MapView extends com.mapbox.mapboxsdk.maps.MapView {
} }
} }
private void setupStyleURL() { @Override
String url = String.format(Locale.ENGLISH, public void setStyleUrl(@NonNull final String url) {
AuthenticationManager.getInstance().getAPIBaseURL() if (currentStyle != null && currentStyle.equals(url)) {
+ "tiles/light.json?access_token=%s", return;
Mapbox.getAccessToken()); }
this.setStyleUrl(url); currentStyle = url;
if (url.contains("access_token")) {
super.setStyleUrl(url);
} else {
AuthenticationManager.getInstance().getAccessToken(new AccessTokenListener() {
@Override
public void onSuccess(@NonNull String accessToken) {
String urlWithToken = String.format(Locale.ENGLISH,"%s?access_token=%s", url, accessToken);
MapView.super.setStyleUrl(urlWithToken);
}
@Override
public void onFailure(@NonNull String errorMessage) {
}
});
}
}
private void setDefaultStyleURL() {
AuthenticationManager.getInstance().getAccessToken(new AccessTokenListener() {
@Override
public void onSuccess(@NonNull String accessToken) {
String url = String.format(Locale.ENGLISH,
AuthenticationManager.getInstance().getAPIBaseURL()
+ "styles/cedarmaps.light.json?access_token=%s",
accessToken);
setStyleUrl(url);
}
@Override
public void onFailure(@NonNull String errorMessage) {
}
});
} }
@Override @Override
......
...@@ -46,17 +46,21 @@ public class ForwardGeocode implements Serializable ...@@ -46,17 +46,21 @@ public class ForwardGeocode implements Serializable
@Expose @Expose
private String name; private String name;
@SerializedName("alternate_name") @SerializedName("name_en")
@Expose
private String nameEn;
@SerializedName("alt_name")
@Expose @Expose
private String alternateName; private String alternateName;
@SerializedName("full_name") @SerializedName("alt_name_en")
@Expose @Expose
private String fullName; private String alternateNameEn;
@SerializedName("name_en") @SerializedName("category")
@Expose @Expose
private String nameEn; private String category = null;
@SerializedName("type") @SerializedName("type")
@Expose @Expose
...@@ -84,7 +88,11 @@ public class ForwardGeocode implements Serializable ...@@ -84,7 +88,11 @@ public class ForwardGeocode implements Serializable
@SerializedName("components") @SerializedName("components")
@Expose @Expose
private Component components; private Component components = null;
@SerializedName("slug")
@Expose
private String slug = null;
/** /**
* *
...@@ -106,7 +114,7 @@ public class ForwardGeocode implements Serializable ...@@ -106,7 +114,7 @@ public class ForwardGeocode implements Serializable
/** /**
* *
* @return Alternate name of the result. e.g. Niayesh, Hashemi Rafsanjani * @return Alternate name of the result. e.g. نیایش, هاشمی رفسنجانی
*/ */
@Nullable @Nullable
public String getAlternateName() { public String getAlternateName() {
...@@ -115,11 +123,11 @@ public class ForwardGeocode implements Serializable ...@@ -115,11 +123,11 @@ public class ForwardGeocode implements Serializable
/** /**
* *
* @return Full name of the result. e.g. Hakim, Ayatollah Hakim * @return English alternate name of the result. e.g. Niayesh, Hashemi Rafsanjani
*/ */
@Nullable @Nullable
public String getFullName() { public String getEnglishlternateName() {
return fullName; return alternateNameEn;
} }
/** /**
...@@ -133,6 +141,15 @@ public class ForwardGeocode implements Serializable ...@@ -133,6 +141,15 @@ public class ForwardGeocode implements Serializable
/** /**
* *
* @return Category name of the result if type="poi".
*/
@Nullable
public String getCategory() {
return category;
}
/**
*
* @return Type of the result. e.g. street, locality, place, etc. * @return Type of the result. e.g. street, locality, place, etc.
*/ */
@NonNull @NonNull
...@@ -163,8 +180,17 @@ public class ForwardGeocode implements Serializable ...@@ -163,8 +180,17 @@ public class ForwardGeocode implements Serializable
* *
* @return Detailed address components for the result. * @return Detailed address components for the result.
*/ */
@NonNull @Nullable
public Component getComponents() { public Component getComponents() {
return components; return components;
} }
/**
*
* @return Kikojas slug of the result if type="poi".
*/
@Nullable
public String getSlug() {
return slug;
}
} }
package com.cedarstudios.cedarmapssdk.model.routing;
import android.support.annotation.Nullable;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.List;
public class Instruction implements Serializable {
public static final class Sign {
public static final int TURN_SHARP_LEFT = -3;
public static final int TURN_LEFT = -2;
public static final int TURN_SLIGHT_LEFT = -1;
public static final int CONTINUE = 0;
public static final int TURN_SLIHGT_RIGHT = 1;
public static final int TURN_RIGHT = 2;
public static final int TURN_SHARP_RIGHT = 3;
public static final int FINISH = 4;
public static final int REACHABLE_VIA = 5;
public static final int USE_ROUNDABOUT = 6;
public static final int KEEP_RIGHT = 7;
}
@SerializedName("distance")
@Expose
private Double distance;
@SerializedName("sign")
@Expose
private int sign;
@SerializedName("interval")
@Expose
private List<Integer> interval;
@SerializedName("text")
@Expose
private String text;
@SerializedName("time")
@Expose
private Integer time;
@SerializedName("street_name")
@Expose
private String streetName;
/**
*
* @return Distance of route section in the instruction in meters
*/
@Nullable
public Double getDistance() {
return distance;
}
/**
*
* @return Traffic sign of route section in the instruction. Use Sign class for constants.
*/
public int getSign() {
return sign;
}
/**
*
* @return An array of indices; these indices can be looked up in Route `geometry` property. It shows locations included in this section.
*/
public List<Integer> getInterval() {
return interval;
}
/**
*
* @return Textual instruction of route section.
*/
@Nullable
public String getText() {
return text;
}
/**
*
* @return Time duration of route section in the instruction in seconds
*/
@Nullable
public Integer getTime() {
return time;
}
/**
*
* @return Main street name in the route section.
*/
@Nullable
public String getStreetName() {
return streetName;
}
}
...@@ -28,7 +28,9 @@ public class Route implements Serializable ...@@ -28,7 +28,9 @@ public class Route implements Serializable
@SerializedName("time") @SerializedName("time")
@Expose @Expose
private Integer time; private Integer time;
@SerializedName("instructions")
@Expose
private List<Instruction> instructions = null;
/** /**
* *
* @return Boundary for a route. * @return Boundary for a route.
...@@ -72,4 +74,14 @@ public class Route implements Serializable ...@@ -72,4 +74,14 @@ public class Route implements Serializable
public Integer getTime() { public Integer getTime() {
return time; return time;
} }
/**
*
* @return Turn by turn instructions for a route
*/
@Nullable
public List<Instruction> getInstructions() {
return instructions;
}
} }
...@@ -7,15 +7,12 @@ android { ...@@ -7,15 +7,12 @@ android {
applicationId "com.cedarmaps.sdksampleapp" applicationId "com.cedarmaps.sdksampleapp"
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 27 targetSdkVersion 27
versionCode 97022520 versionCode 97050910
versionName "1.1.1" versionName "1.2.0"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
buildTypes { buildTypes {
debug {
applicationIdSuffix ".debug"
}
release { release {
minifyEnabled true minifyEnabled true
shrinkResources true shrinkResources true
...@@ -27,11 +24,16 @@ android { ...@@ -27,11 +24,16 @@ android {
abortOnError false abortOnError false
} }
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
splits { splits {
abi { abi {
enable true enable true
reset() reset()
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64" // include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
universalApk true universalApk true
} }
} }
...@@ -49,7 +51,7 @@ android { ...@@ -49,7 +51,7 @@ android {
buildConfigField STRING, MARKET, GOOGLE_PLAY buildConfigField STRING, MARKET, GOOGLE_PLAY
dimension "dimension" dimension "dimension"
ndk { ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" abiFilters "armeabi-v7a","arm64-v8a","x86","x86_64"
} }
} }
...@@ -57,19 +59,13 @@ android { ...@@ -57,19 +59,13 @@ android {
buildConfigField STRING, MARKET, CAFE_BAZAAR buildConfigField STRING, MARKET, CAFE_BAZAAR
dimension "dimension" dimension "dimension"
ndk { ndk {
abiFilters "armeabi-v7a", "arm64-v8a" abiFilters "armeabi-v7a","arm64-v8a"
} }
} }
} }
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
} }
ext.abiCodes = ['armeabi-v7a':1, 'arm64-v8a':2, 'x86':3, 'x86_64':4] ext.abiCodes = ['armeabi-v7a':1, 'arm64-v8a':2, 'x86':3, 'x86_64':4]
import com.android.build.OutputFile
android.applicationVariants.all { variant -> android.applicationVariants.all { variant ->
variant.outputs.each { output -> variant.outputs.each { output ->
def baseAbiVersionCode = def baseAbiVersionCode =
...@@ -82,7 +78,7 @@ android.applicationVariants.all { variant -> ...@@ -82,7 +78,7 @@ android.applicationVariants.all { variant ->
dependencies { dependencies {
implementation (project(':CedarMapsSDK')) implementation (project(':CedarMapsSDK'))
implementation("com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.5.0") { implementation("com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.7.1") {
exclude group: 'com.mapbox.mapboxsdk' exclude group: 'com.mapbox.mapboxsdk'
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="com.cedarmaps.sdksampleapp"> package="com.cedarmaps.sdksampleapp">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application <application
...@@ -10,12 +11,13 @@ ...@@ -10,12 +11,13 @@
android:appCategory="maps" android:appCategory="maps"
android:fullBackupContent="true" android:fullBackupContent="true"
android:allowBackup="true" android:allowBackup="true"
android:name=".SampleApp"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name" android:label="@string/app_name"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
tools:ignore="UnusedAttribute"> tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:label="@string/app_name" android:label="@string/app_name"
......
...@@ -6,8 +6,8 @@ public class Constants { ...@@ -6,8 +6,8 @@ public class Constants {
public static final int PERMISSION_LOCATION_REQUEST_CODE = 100; public static final int PERMISSION_LOCATION_REQUEST_CODE = 100;
static final String CLIENT_ID = "YOUR_CLIENT_ID"; static final String CLIENT_ID = "CLIENT_ID";
static final String CLIENT_SECRET = "YOUR_CLIENT_SECRET"; static final String CLIENT_SECRET = "CLIENT_SECRET";
public static final LatLng VANAK_SQUARE = new LatLng(35.7572, 51.4099); public static final LatLng VANAK_SQUARE = new LatLng(35.7572, 51.4099);
} }
...@@ -61,11 +61,6 @@ public class MainActivity extends AppCompatActivity { ...@@ -61,11 +61,6 @@ public class MainActivity extends AppCompatActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
CedarMaps.getInstance()
.setClientID(Constants.CLIENT_ID)
.setClientSecret(Constants.CLIENT_SECRET)
.setContext(this);
CedarMaps.getInstance().prepareTiles(new OnTilesConfigured() { CedarMaps.getInstance().prepareTiles(new OnTilesConfigured() {
@Override @Override
public void onSuccess() { public void onSuccess() {
......
package com.cedarmaps.sdksampleapp;
import android.app.Application;
import com.cedarstudios.cedarmapssdk.CedarMaps;
public class SampleApp extends Application {
@Override
public void onCreate() {
super.onCreate();
CedarMaps.getInstance()
.setClientID(Constants.CLIENT_ID)
.setClientSecret(Constants.CLIENT_SECRET)
.setContext(this)
.setMapID("cedarmaps.mix");
}
}
...@@ -84,6 +84,7 @@ public class ForwardGeocodeFragment extends Fragment { ...@@ -84,6 +84,7 @@ public class ForwardGeocodeFragment extends Fragment {
super.onViewCreated(view, savedInstanceState); super.onViewCreated(view, savedInstanceState);
mMapView = view.findViewById(R.id.mapView); mMapView = view.findViewById(R.id.mapView);
mMapView.setStyleUrl("https://api.cedarmaps.com/v1/tiles/light.json");
mMapView.onCreate(savedInstanceState); mMapView.onCreate(savedInstanceState);
mMapView.getMapAsync(mapboxMap -> { mMapView.getMapAsync(mapboxMap -> {
mMapboxMap = mapboxMap; mMapboxMap = mapboxMap;
......
...@@ -50,6 +50,8 @@ public class ReverseGeocodeFragment extends Fragment { ...@@ -50,6 +50,8 @@ public class ReverseGeocodeFragment extends Fragment {
mMapView.onCreate(savedInstanceState); mMapView.onCreate(savedInstanceState);
mMapView.setStyleUrl("https://api.cedarmaps.com/v1/styles/cedarmaps.dark.json");
mMapView.getMapAsync(mapboxMap -> { mMapView.getMapAsync(mapboxMap -> {
mMapboxMap = mapboxMap; mMapboxMap = mapboxMap;
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="266.21622"
android:viewportHeight="266.21622">
<group android:translateX="34.60811"
android:translateY="35.60811">
<path
android:pathData="M196.5,51.34L196.5,32.92C196.5,14.33 182.09,-0.5 163.5,-0.5L125.22,-0.5 154.77,71.34 196.5,51.34ZM196.5,51.34"
android:fillColor="#F9B718"
android:strokeColor="#00000000"/>
<path
android:pathData="M1.32,162.92C2.05,178.63 13.64,191.63 28.71,194.53L57.29,136.61 1.32,162.92ZM1.32,162.92"
android:fillColor="#7764AA"
android:strokeColor="#00000000"/>
<path
android:pathData="M0.5,96.71L0.5,143.49 52.12,119.22 0.5,96.71ZM0.5,96.71"
android:fillColor="#AB519D"
android:strokeColor="#00000000"/>
<path
android:pathData="M134.67,135.67L196.86,162.96C196.88,162.43 196.5,161.89 196.5,161.35L196.5,70.79 152.96,91.45 134.67,135.67ZM134.67,135.67"
android:fillColor="#59A646"
android:strokeColor="#00000000"/>
<path
android:pathData="M139.22,78.83L106.15,-0.5 72.91,-0.5 76.77,108.28 139.22,78.83ZM139.22,78.83"
android:fillColor="#F26D4A"
android:strokeColor="#00000000"/>
<path
android:pathData="M79.72,130.6L48.04,194.5 90.44,194.5 111.69,144.37 79.72,130.6ZM79.72,130.6"
android:fillColor="#2F4858"
android:strokeColor="#00000000"/>
<path
android:pathData="M118.54,128.64L129.51,102.65 95.55,118.62 118.54,128.64ZM118.54,128.64"
android:fillColor="#000000"
android:strokeColor="#00000000"/>
<path
android:pathData="M55.3,-0.5L35.07,-0.5C16.49,-0.5 0.5,14.33 0.5,32.92L0.5,77.51 58.58,102.85 55.3,-0.5ZM55.3,-0.5"
android:fillColor="#EB298B"
android:strokeColor="#00000000"/>
<path
android:pathData="M109.55,194.5L163.5,194.5C175.3,194.5 185.73,188.69 191.78,179.46L127.82,151.41 109.55,194.5ZM109.55,194.5"
android:fillColor="#016CAB"
android:strokeColor="#00000000"/>
</group>
</vector>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/> <background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> <foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon> </adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
\ No newline at end of file
CedarMapsSampleApp/src/main/res/mipmap-hdpi/ic_launcher.png

4.22 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-hdpi/ic_launcher.png

3.43 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-hdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-hdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-hdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-hdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
CedarMapsSampleApp/src/main/res/mipmap-mdpi/ic_launcher.png

2.4 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-mdpi/ic_launcher.png

2.41 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-mdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-mdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-mdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-mdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
CedarMapsSampleApp/src/main/res/mipmap-mdpi/ic_launcher_round.png

3.64 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-mdpi/ic_launcher_round.png

3.31 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-mdpi/ic_launcher_round.png
CedarMapsSampleApp/src/main/res/mipmap-mdpi/ic_launcher_round.png
CedarMapsSampleApp/src/main/res/mipmap-mdpi/ic_launcher_round.png
CedarMapsSampleApp/src/main/res/mipmap-mdpi/ic_launcher_round.png
  • 2-up
  • Swipe
  • Onion skin
CedarMapsSampleApp/src/main/res/mipmap-xhdpi/ic_launcher.png

6.22 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-xhdpi/ic_launcher.png

4.61 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-xhdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-xhdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-xhdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-xhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
CedarMapsSampleApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png

10.4 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png

7.22 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png
CedarMapsSampleApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png
CedarMapsSampleApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png
CedarMapsSampleApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  • 2-up
  • Swipe
  • Onion skin
CedarMapsSampleApp/src/main/res/mipmap-xxhdpi/ic_launcher.png

10.5 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-xxhdpi/ic_launcher.png

6.74 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-xxhdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-xxhdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-xxhdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-xxhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
CedarMapsSampleApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png

15.6 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png

9.13 KB | W: | H:

CedarMapsSampleApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png
CedarMapsSampleApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
This guide will take you through the process of integrating CedarMaps into your Android application. This guide will take you through the process of integrating CedarMaps into your Android application.
All the mentioned methods and tools in this document are tested on Android Studio v3.1. All the mentioned methods and tools in this document are tested on Android Studio v3.1.3.
## Table of Contents ## Table of Contents
- [Installation](#installation) - [Installation](#installation)
...@@ -28,7 +28,7 @@ To install the current stable version, first add the address of CedarMaps maven ...@@ -28,7 +28,7 @@ To install the current stable version, first add the address of CedarMaps maven
```groovy ```groovy
repositories { repositories {
maven { maven {
url "http://repo.cedarmaps.com/android/" url "https://repo.cedarmaps.com/android/"
} }
} }
``` ```
...@@ -37,13 +37,18 @@ Then, add this to the `build.gradle` of your **app** module: ...@@ -37,13 +37,18 @@ Then, add this to the `build.gradle` of your **app** module:
```groovy ```groovy
dependencies { dependencies {
implementation 'com.cedarmaps:CedarMapsSDK:3.0.0' implementation 'com.cedarmaps:CedarMapsSDK:3.1.0'
} }
``` ```
### Required Permissions ### Required Permissions
If your App needs to access location services, add the following to `AndroidManifest.xml`: Make sure your app can access internet by adding this to `AndroidManifest.xml`:
```xml
<uses-permission android:name="android.permission.INTERNET"/>
```
If your App needs to access location services, add the following as well:
```xml ```xml
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
...@@ -73,7 +78,7 @@ CedarMaps.getInstance() ...@@ -73,7 +78,7 @@ CedarMaps.getInstance()
### Mapbox ### Mapbox
CedarMaps SDK is based on [Mapbox GL Android SDK v6.0.1](https://github.com/mapbox/mapbox-gl-native) and provides extra API methods over Mapbox. CedarMaps SDK is based on [Mapbox GL Android SDK v6.3.0](https://github.com/mapbox/mapbox-gl-native) and provides extra API methods over Mapbox.
For more information about how to use MapView and other components such as **Adding Markers**, **Showing Current Location**, etc., please see [Mapbox Getting Started](https://www.mapbox.com/help/first-steps-android-sdk/). For more information about how to use MapView and other components such as **Adding Markers**, **Showing Current Location**, etc., please see [Mapbox Getting Started](https://www.mapbox.com/help/first-steps-android-sdk/).
#### MapView #### MapView
...@@ -137,6 +142,19 @@ mMapView.getMapAsync(new OnMapReadyCallback() { ...@@ -137,6 +142,19 @@ mMapView.getMapAsync(new OnMapReadyCallback() {
}); });
``` ```
##### Changing Map Style
You can set various style URLs to instances of `MapView`:
```java
mMapView.setStyleUrl("STYLE_URL");
// Light Vector (Default): "https://api.cedarmaps.com/v1/styles/cedarmaps.light.json"
// Dark Vector: "https://api.cedarmaps.com/v1/styles/cedarmaps.dark.json"
// Raster: "https://api.cedarmaps.com/v1/tiles/light.json"
```
Make sure to use your base URL if you have one.
#### Plugins #### Plugins
Mapbox uses [Plugins](https://github.com/mapbox/mapbox-plugins-android) to add extra functionality to the base SDK. Mapbox uses [Plugins](https://github.com/mapbox/mapbox-plugins-android) to add extra functionality to the base SDK.
......
...@@ -6,7 +6,7 @@ buildscript { ...@@ -6,7 +6,7 @@ buildscript {
google() google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.0.1' classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
......
GROUP=com.cedarmaps GROUP=com.cedarmaps
VERSION_NAME=2.0.0 VERSION_NAME=3.1.0
# Project-wide Gradle settings. # Project-wide Gradle settings.
......
#Sun Apr 22 17:11:36 IRDT 2018 #Tue Jul 31 16:50:23 IRDT 2018
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
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