Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSE340 Sensing and Location
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cse340
exercises
CSE340 Sensing and Location
Commits
1b846c30
Commit
1b846c30
authored
2 years ago
by
Lauren Bricker
Browse files
Options
Downloads
Patches
Plain Diff
Updated README with info on how to do the mapbox challenge
parent
aa68abf9
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Mapbox sync
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+35
-18
35 additions, 18 deletions
README.md
with
35 additions
and
18 deletions
README.md
+
35
−
18
View file @
1b846c30
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment