Skip to content

Commit 6ef36c8

Browse files
committed
small changes to testapp
1 parent 325f846 commit 6ef36c8

6 files changed

Lines changed: 14 additions & 22 deletions

File tree

libandroid/app/src/main/java/com/mapbox/services/android/testapp/geocoding/GeocodingReverseActivity.java

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
package com.mapbox.services.android.testapp.geocoding;
22

3-
import android.support.v7.app.AppCompatActivity;
43
import android.os.Bundle;
4+
import android.support.v7.app.AppCompatActivity;
55
import android.support.v7.widget.Toolbar;
66
import android.util.Log;
77
import android.widget.TextView;
88

99
import com.mapbox.mapboxsdk.annotations.MarkerOptions;
10-
import com.mapbox.mapboxsdk.camera.CameraPosition;
11-
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
12-
import com.mapbox.mapboxsdk.constants.Style;
1310
import com.mapbox.mapboxsdk.geometry.LatLng;
1411
import com.mapbox.mapboxsdk.maps.MapView;
1512
import com.mapbox.mapboxsdk.maps.MapboxMap;
@@ -51,24 +48,12 @@ protected void onCreate(Bundle savedInstanceState) {
5148
textView = (TextView) findViewById(R.id.message);
5249
setMessage("Tap the map to trigger the reverse geocoder.");
5350

54-
final LatLng dupontCircle = new LatLng(38.90962, -77.04341);
55-
5651
mapView = (MapView) findViewById(R.id.mapview);
5752
mapView.setAccessToken(Utils.getMapboxAccessToken(this));
5853
mapView.onCreate(savedInstanceState);
5954
mapView.getMapAsync(new OnMapReadyCallback() {
6055
@Override
61-
public void onMapReady(MapboxMap mapboxMapReady) {
62-
mapboxMap = mapboxMapReady;
63-
mapboxMap.setStyleUrl(Style.MAPBOX_STREETS);
64-
65-
// Animate map
66-
CameraPosition cameraPosition = new CameraPosition.Builder()
67-
.target(dupontCircle)
68-
.zoom(15)
69-
.build();
70-
mapboxMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
71-
56+
public void onMapReady(final MapboxMap mapboxMap) {
7257
// Click listener
7358
mapboxMap.setOnMapClickListener(new MapboxMap.OnMapClickListener() {
7459
@Override

libandroid/app/src/main/res/layout/content_geocoding_reverse.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
5+
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
78
android:orientation="vertical"
89
app:layout_behavior="@string/appbar_scrolling_view_behavior"
9-
tools:context="com.mapbox.services.android.testapp.GeocoderReverseActivity"
10+
tools:context="com.mapbox.services.android.testapp.geocoding.GeocodingReverseActivity"
1011
tools:showIn="@layout/activity_geocoding_reverse">
1112

1213
<com.mapbox.mapboxsdk.maps.MapView
1314
android:id="@+id/mapview"
1415
android:layout_width="match_parent"
1516
android:layout_height="0dp"
16-
android:layout_weight="5" />
17+
android:layout_weight="5"
18+
mapbox:style_url="@string/default_style"
19+
mapbox:center_latitude="38.90962"
20+
mapbox:center_longitude="-77.04341"
21+
mapbox:zoom="15"/>
1722

1823
<TextView
1924
android:id="@+id/message"

libandroid/app/src/main/res/layout/content_geocoding_service.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
android:paddingTop="@dimen/activity_vertical_margin"
1010
android:paddingBottom="@dimen/activity_vertical_margin"
1111
app:layout_behavior="@string/appbar_scrolling_view_behavior"
12-
tools:context=".service.GeocoderServiceActivity"
12+
tools:context="com.mapbox.services.android.testapp.geocoding.GeocodingServiceActivity"
1313
tools:showIn="@layout/activity_geocoding_service">
1414

1515
<Button

libandroid/app/src/main/res/layout/content_geocoding_widget.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
android:layout_height="match_parent"
77
android:orientation="vertical"
88
app:layout_behavior="@string/appbar_scrolling_view_behavior"
9-
tools:context="com.mapbox.services.android.testapp.GeocoderWidgetActivity"
9+
tools:context="com.mapbox.services.android.testapp.geocoding.GeocodingWidgetActivity"
1010
tools:showIn="@layout/activity_geocoding_widget">
1111

1212
<com.mapbox.services.android.geocoder.ui.GeocoderAutoCompleteView

libandroid/app/src/main/res/layout/content_static_image.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
android:paddingRight="5dp"
1010
android:paddingTop="5dp"
1111
app:layout_behavior="@string/appbar_scrolling_view_behavior"
12-
tools:context=".StaticImageActivity"
12+
tools:context="com.mapbox.services.android.testapp.staticimage.StaticImageActivity"
1313
tools:showIn="@layout/activity_static_image">
1414

1515
<android.support.v7.widget.RecyclerView

libandroid/app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<string name="app_name">Mapbox Android Services</string>
44
<string name="action_settings">Settings</string>
55

6+
<string name="default_style">mapbox://styles/mapbox/streets-v8</string>
7+
68
<string name="category">category</string>
79
<string name="category_directions">Directions</string>
810
<string name="category_geocoding">Geocoding</string>

0 commit comments

Comments
 (0)