mapbox-android-demo | Google Play demo app for the Mapbox Maps SDK for Android | Map library
kandi X-RAY | mapbox-android-demo Summary
kandi X-RAY | mapbox-android-demo Summary
This is a public demo of the Mapbox Maps SDK for Android. The demo app is available now in the Google Play Store and it shows off many of the examples found on:. There are also examples that only live in the app. The app's "labs" section has examples which often combine various Mapbox tools to create more complex examples. Visit the overview page to get started using the Mapbox Maps SDK for Android in your Android project.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initialize the model .
- Initialize the heatmap colors .
- Downloads a list of regions .
- Init feature list .
- Adds a new clustering source to the map .
- Initialize the OnActionButtonClickListener .
- Creates an api call with the given mapbox point .
- Initializes the hit result spinner options .
- Query the feature query using the tilequery API .
- Set up the example .
mapbox-android-demo Key Features
mapbox-android-demo Examples and Code Snippets
Community Discussions
Trending Discussions on mapbox-android-demo
QUESTION
I need to add some aeronautical layers taken from FAA to the map. The layers are provided as GeoTIFF files.
Steps- Downloaded a GeoTiff file from FAA website.
- Using QGis app clipped the legend from the file. Actually the issue occurs without this step as well.
- Reprojected it to
EPSG:3857
using GDAL commandgdalwarp -q -t_srs EPSG:3857 -dstalpha -of vrt Albuquerque\ SEC\ 104-cut.tif /vsistdout/ | gdal_translate -co compress=lzw /vsistdin/ Albuquerque\ SEC\ 104-north-up-cut.tif
. Otherwise I gotError creating Mapnik Datasource: Invalid raster: Invalid rotation value in geotransform array
when uploading to Mapbox. - Created a Tileset by uploading GeoTIFFs to Mapbox.
- Created a new style in the Mapbox Studio.
- Added the tilesets as layers.
The map is showing well in Mapbox Studio:
Android ResultHowever in Android app this style shows with some black borders of random width depending on zoom level and camera position. Here is how it looks in android:
I tried it on Pixel 3a (Android 10), Nexus 5x (Android 8.1) and Android emulator (Android 10). I have good internet connection and gave it enough time so the tiles are loaded.
The source code where the map is embedded is official Demo app. I just replaced token and style URL:
...ANSWER
Answered 2020-May-28 at 14:11The black borders should be transparent, but the raster image format Mapbox is using (JPG) does not support transparency, which is a known issue that exists in every gl-native-based SDK. This issue presents itself when you reference a style that has the raster layer built in.
As a workaround, you can follow Mapbox's troubleshooting guide on troubleshooting raster images with black backgrounds to make your tileset transparent and then add the tileset as a RasterSource
within your Android application to display the raster tile as expected.
Please take a look at the following example as a reference for adding a RasterSource:
Instead of calling the rasterSource using "mapbox://username.tilesetID", you need to call it similarly to the Add a WMS Source example. The code below will resolve your issue:
style.addSource(RasterSource( "albuquerque-source", TileSet( "tileset", "https://api.mapbox.com/v4//{z}/{x}/{y}.png?access_token=" ), 256 ))
QUESTION
Hello i am "Location picker, I want to get location with. I did and it happened according to the link below.
https://github.com/prensmiskin/fff/blob/master/one
But I want to use the "Location picker" structure in a class extended by fragment. But I get an error.
The above code works, but I get an error when I make it in a class that is extent by fragment.
I get an error when I do as follows.
https://github.com/prensmiskin/fff/blob/master/two
Errors I Received
...ANSWER
Answered 2020-Mar-24 at 15:22QUESTION
I am following this example: https://docs.mapbox.com/android/maps/examples/symbol-layer-info-window/
Also here:
It is loading a number of points with descriptions from a file.
On line 271: String geoJson = loadGeoJsonFromAsset(activity, "us_west_coast.geojson");
What I need is to do the same dynamically. I have the information already as features in the map. I can get Title and Description from there. What I need is to use GenerateViewIconTask and setUpInfoWindowLayer when this event is triggered: onMapClick.
So basically a user taps on the map, I get the coordinates and search in the map's features, get the lat/lng, title and description and show up a callout on the map.
I can handle tapping, getting the map's feature, extracting title and description. What I need to do to finish with showing a nice callout on this location with title and description.
...ANSWER
Answered 2019-Jun-05 at 21:07Sorry for the late response. You can either show a label by setting the textfield
property or (according to the docs) create an info window by setting the iconImage
property to a string, like iconImage("{title}")
.
Sadly I've rarely used the latter as it never worked for me.
QUESTION
Timeout error is thrown every time when I try to download an offline area.
The reference for my implementation is in the following link below: Link to offline manager
Also the "onError(OfflineRegionError error)" method from the observer keeps on getting called multiple times.
The downloading used to happen without any issues sometimes ago. No code changes have been made. This happens both in mapbox versions 4.2.1 and 6.5.0.
...ANSWER
Answered 2018-Nov-24 at 11:42This issue may occur when there is sudden drop in network (network interruption) also - so you have to check network once when this error comes and handle accordingly.
QUESTION
I'm testing an app with mapbox sdk and instead of mapbox's location Engine provider i've created a class named "GoogleLocationEngine" using this link in order to track user location (Google API): https://github.com/mapbox/mapbox-android-demo/issues/449
but the app gives me this error (usually when it's in the background) :
...ANSWER
Answered 2018-Jun-05 at 08:34the Issue's been solved! based on this paragraph :
It's important to include the location layer onStart() and onStop() lifecycle events in their respective activity methods. This prevents memory leaks from occurring and reduces battery consumption. The plugin has support for the new LifecycleObserver APIs, by adding the plugin as a lifecycle observer in your activity, you won't need to handle the lifecycles manually.
source link : mapbox_locationLayer
and this mapboxDemo_LocationLayerPluginActivity.java (GitHub), i should use these methods in my functions :
QUESTION
I am using this demo: https://github.com/mapbox/mapbox-android-demo/blob/a411fa95cd71c1b90a30895060b319310444aebb/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/plugins/LocationPluginActivity.java
I am trying to enable locationlayer
in Mapbox to track my users location, the map works okay when I don't try to use locationlayer
(without tracking), but I have copied that exact code into my app and all it does is crash on startup, this is the only Logcat
message I get:
ANSWER
Answered 2018-Mar-07 at 00:24Okay after doing a lot of searching I found out that if you add the following to your build.gradle it will resolve your issue, it seems to be a bug that isn't reported any where from Mapbox.
QUESTION
I'm currently implementing MapBox in a Xamarin.Android
application, I'm looking at the examples from MapBox Github, this one in specific https://github.com/mapbox/mapbox-android-demo/blob/master/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/OptimizationActivity.java, which I'm translating to C#, but now I'm facing a problem. In this example they use a class called "MapboxOptimizedTrips" which comes from lib 'com.mapbox.services.api.optimizedtrips.v1.MapboxOptimizedTrips'. In Xamarin I have imported all libraries that Xamarin made for MapBox, which is these 3:
MapBoxSDK.Android
MapBoxSDK.AndroidServices
MapBoxSDK.JavaServices
None of these includes the Optimized Trips API related classes. Has anyone faced this issue before?
...ANSWER
Answered 2018-Feb-03 at 18:08I thought you read and followed this document from Mapbox?
- Mapbox Navigation library is kept changing and adding new features
- There are two DirectionsRoute class from Mapbox libraries
- both DirectionsRoute returned by Mapbox Optimization packages doesn't fit with what NavigationRoute does.
I think you have to go with the way you mentioned, call to API directly. Or wait for Mapbox to evolve their library.
Cheers.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mapbox-android-demo
You can use mapbox-android-demo like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the mapbox-android-demo component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page