mapbox-gl-native-android | thoroughly customizable maps in native Android | Map library
kandi X-RAY | mapbox-gl-native-android Summary
kandi X-RAY | mapbox-gl-native-android Summary
Mapbox Maps SDK v10 beta is now available at mapbox/mapbox-maps-android. Mapbox maintains this repo to address bug fixes and security vulnerabilities. The Mapbox Maps SDK for Android is a library based on Mapbox GL Native for embedding interactive map views with scalable, customizable vector maps onto Android devices.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Main thread
- Update the FPS s FPS
- Performs rendering of a draw frame
- Add polygon to the map
- Adds a marker to the map
- Add markers to the map
- Adds polyline options to the map
- Adds the polyline with the given map options
- Adds a polygon to the map
- Creates a unique hash code for this object
- Gets a hashcode for the set
- Force location update
- Makes a request
- Obtains all markers in the specified rectangle
- Returns a hash code for the application
- Compares two MapLoad events
- Converts a string to a human readable string
- Adds the bitmaps to the style
- Returns a JSON representation of this object
- Shows the layer
- Creates a hash code for this foreground
- Writes the contents of the Parcelable object
- Compares this object to another object
- Compares the specified LocationOptions with the specified options
- Initializes an arrow path
- Writes a Parcelable object
mapbox-gl-native-android Key Features
mapbox-gl-native-android Examples and Code Snippets
Community Discussions
Trending Discussions on mapbox-gl-native-android
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 ))
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mapbox-gl-native-android
These instructions are for developers interested in making code-level contributions to the SDK itself. If you instead want to use the SDK in your app, see above.
Latest stable Android Studio and Android SDK.
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