Merge branch 'release-ios-v3.5.0-android-v5.0.0'
This commit is contained in:
@@ -2,10 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mapbox.mapboxsdk.testapp">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
|
||||
<application
|
||||
@@ -617,8 +614,6 @@
|
||||
<!-- <meta-data -->
|
||||
<!-- android:name="com.mapbox.SetStorageExternal" -->
|
||||
<!-- android:value="true" /> -->
|
||||
|
||||
<service android:name="com.mapbox.services.android.telemetry.service.TelemetryService"/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -196,6 +196,13 @@ public class MarkerViewActivity extends AppCompatActivity {
|
||||
// open infowindow offscreen markers
|
||||
mapboxMap.selectMarker(markerRightOffScreen);
|
||||
mapboxMap.selectMarker(markerRightBottomOffScreen);
|
||||
|
||||
mapboxMap.setOnMapClickListener(new MapboxMap.OnMapClickListener() {
|
||||
@Override
|
||||
public void onMapClick(@NonNull LatLng point) {
|
||||
Toast.makeText(MarkerViewActivity.this, point.toString(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
package com.mapbox.mapboxsdk.testapp.activity.camera;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import com.mapbox.mapboxsdk.constants.Style;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
public class MaxMinZoomActivity extends AppCompatActivity implements OnMapReadyCallback {
|
||||
|
||||
private MapView mapView;
|
||||
@@ -25,10 +30,21 @@ public class MaxMinZoomActivity extends AppCompatActivity implements OnMapReadyC
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapReady(MapboxMap map) {
|
||||
public void onMapReady(final MapboxMap map) {
|
||||
mapboxMap = map;
|
||||
mapboxMap.setMinZoomPreference(3);
|
||||
mapboxMap.setMaxZoomPreference(5);
|
||||
mapboxMap.setOnMapClickListener(new MapboxMap.OnMapClickListener() {
|
||||
@Override
|
||||
public void onMapClick(@NonNull LatLng point) {
|
||||
map.setStyle(Style.OUTDOORS, new MapboxMap.OnStyleLoadedListener() {
|
||||
@Override
|
||||
public void onStyleLoaded(String style) {
|
||||
Timber.d("Style Loaded %s", style);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,7 +5,9 @@ import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mapbox.mapboxsdk.camera.CameraPosition;
|
||||
import com.mapbox.mapboxsdk.constants.Style;
|
||||
import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
@@ -47,9 +49,21 @@ public class DebugModeActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onMapReady(@NonNull MapboxMap map) {
|
||||
mapboxMap = map;
|
||||
|
||||
mapboxMap.getUiSettings().setZoomControlsEnabled(true);
|
||||
|
||||
// show current zoom level on screen
|
||||
final TextView textView = (TextView) findViewById(R.id.textZoom);
|
||||
mapboxMap.setOnCameraChangeListener(new MapboxMap.OnCameraChangeListener() {
|
||||
@Override
|
||||
public void onCameraChange(CameraPosition position) {
|
||||
textView.setText(String.format(getString(R.string.debug_zoom), position.zoom));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
FloatingActionButton fabDebug = (FloatingActionButton) findViewById(R.id.fabDebug);
|
||||
fabDebug.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -70,7 +84,12 @@ public class DebugModeActivity extends AppCompatActivity {
|
||||
if (currentStyleIndex == STYLES.length) {
|
||||
currentStyleIndex = 0;
|
||||
}
|
||||
mapboxMap.setStyleUrl(STYLES[currentStyleIndex]);
|
||||
mapboxMap.setStyleUrl(STYLES[currentStyleIndex], new MapboxMap.OnStyleLoadedListener() {
|
||||
@Override
|
||||
public void onStyleLoaded(String style) {
|
||||
Timber.d("Style loaded %s", style);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -10,7 +10,18 @@
|
||||
<com.mapbox.mapboxsdk.maps.MapView
|
||||
android:id="@+id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent"
|
||||
app:mapbox_uiAttribution="false"
|
||||
app:mapbox_uiCompass="false"
|
||||
app:mapbox_uiLogo="false"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textZoom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|start"
|
||||
android:layout_margin="8dp"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fabDebug"
|
||||
|
||||
@@ -162,4 +162,5 @@
|
||||
<string name="dynamic_marker_chelsea_snippet">Stamford Bridge</string>
|
||||
<string name="dynamic_marker_arsenal_title">Arsenal</string>
|
||||
<string name="dynamic_marker_arsenal_snippet">Emirates Stadium</string>
|
||||
<string name="debug_zoom">Zoom: %s</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user