Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Adding Tilequery API + Static Images API notification example #1297

Merged
merged 1 commit into from
Feb 7, 2020

Conversation

langsmith
Copy link
Contributor

This pr shows an example of using the Mapbox Tilequery API and Static Images API to create rich, mobile notifications.

This pr is a very souped-up version of https://docs.mapbox.com/android/maps/examples/display-a-snapshot-notification/ and is essentially a mobile version of https://labs.mapbox.com/narratives/nyc-wifi/. The lab's blog post is at https://blog.mapbox.com/increase-mobile-engagement-with-rich-notifications-3f388fe85116.

The Tilequery API is used to find Features that are a certain number of feet from the query Point. The info in the response is used for the notification text. The Static Images API is used to eventually create a Bitmap. The Bitmap is given to the notification builder to initially create a notification and then update the notification as the map is tapped on.

Rather than tapping on the map to set the Tilequery API query point, which is how this demo app example is set up, a more real-world scenario would be listening to the device location as the device moves. An Android guide for setting this up can be found at https://docs.mapbox.com/help/tutorials/android-location-listening/).

Then, as the device moves, the latest device location coordinates could be used every XXX (milli-)seconds.

Related to tracking device location, in order to keep the example a bit more manageable, I decided to not add code that simulates the icon moving along a route 👍

ezgif com-resize (6)

ezgif com-resize (7)

@langsmith langsmith self-assigned this Feb 7, 2020
@langsmith
Copy link
Contributor Author

cc @brsbl @mapbox/static-apis

@langsmith
Copy link
Contributor Author

cc @mapbox/tilesets-api as well

@langsmith langsmith merged commit 143efcf into master Feb 7, 2020
@langsmith langsmith deleted the ls-static-image-notification-example branch February 7, 2020 15:46
@langsmith langsmith mentioned this pull request Mar 2, 2020
5 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants