Skip to content
Snippets Groups Projects
Commit 1b846c30 authored by Lauren Bricker's avatar Lauren Bricker
Browse files

Updated README with info on how to do the mapbox challenge

parent aa68abf9
No related branches found
No related tags found
1 merge request!2Mapbox sync
......@@ -20,9 +20,7 @@ About:
Precise Location is required to display the long/lat.
- Noteworthy files to look at:
- `location_layout.xml` > <com.mapbox.maps.MapView...
- `LocationActivity.java` > `customizeMapAppearance()`
- Module Level `build.gradle` > line 37 (declares mapbox dependency)
-
- Mapbox SDK requires a public key (for inflating MapView XML) and secret key (for Mapbox Maven
dependency).
......@@ -35,6 +33,16 @@ About:
TODOs:
0. Add the [Mapbox dependency](https://docs.mapbox.com/android/maps/guides/install/#add-the-dependency):
a. We've already added the `dependencyResolutionManagement...` to `settings.gradle` for you.
b. Open up your *module level* `build.gradle` file and add to the dependencies:
```
implementation 'com.mapbox.maps:android:10.5.0'
```
1. Configure Mapbox Credentials:
a. Register for a free account on Mapbox.
......@@ -69,22 +77,31 @@ TODOs:
a. Insert this XML object
```
<com.mapbox.maps.MapView
android:id="@+id/map_view"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/actual_location"
app:mapbox_cameraTargetLat="40.7128"
app:mapbox_cameraTargetLng="-74.0060"
app:mapbox_cameraZoom="8.0">
android:id="@+id/map_view"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/actual_location"
app:mapbox_cameraTargetLat="40.7128"
app:mapbox_cameraTargetLng="-74.0060"
app:mapbox_cameraZoom="8.0">
</com.mapbox.maps.MapView>
```
inside `location_layout.xml`. This will be the map displayed on the screen.
b. Use the location grabbed from the user's device and display it on the map
when the user presses the "Find My Location" button.
c. Handle the case where the user did not turn on location permissions but tries
to click the "Find My Location" button.
\ No newline at end of file
b. Uncomment the `MapView` declaration
c. Find the other TODOs in the `LocationActivity.java#customizeMapAppearance()`. See the
course slides on Location for details on how to do these.
* Find the map `R.id.map_view` view (by its id) and store it in that `MapView` variable
* Set the zoom level of the map when the zoom in or zoom out buttons are pressed.
* Use the location grabbed from the user's device and display it on the map
when the user presses the "Find My Location" button.
* Handle the case where the user did not turn on location permissions but tries
to click the "Find My Location" button.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment