I want to show a different View below map (e.g. some animation), and need to make map partially transparent for this. How can I do this with CARTO Mobile SDK?
How to make transparent map background with CARTO mobile SDK
761 Views Asked by JaakL At
1
There are 1 best solutions below
Related Questions in ANDROID
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in IOS
- Overlapping UICollectionView in storyboard
- Cannot pod spec lint because of undeclared type errors
- Is the transactionReceipt data present in dataWithContentsOfURL?
- UIWebView Screen Fitting Issue
- ZXingObjC encoding issues
- iOS: None of the valid provisioning profiles allowed the specific entitlements
- How to hide "Now playing url" in control center
- CloudKit: Preventing Duplicate Records
- Slow performance on ipad erasing image
- Swift code with multiple NSDateFormatter - optimization
- iOS 8.3 Safari crashes on input type=file
- TTTTimeIntervalFormatter always returns strings in English
- How do I add multiple in app purchases in Swift Spritekit?
- Setup code for xibs in iOS. -awakFromNb:
- iOS Voice Over only reads out the title of any alert views
Related Questions in CARTODB
- how to detect polygons within other (many) polygons in postgis
- How to include CartoDB into Meteor
- Does CartoDB have a function to change center location based on user location?
- Cygnus doesn't write on CartoDB
- How to fix error project offline maps used Nutiteq maps SDK
- Map localization in Carto Mobile SDK
- How to query a postgresql table twice in a single SQL statement
- Z-index of map objects
- Carto multiple maps single HTML
- Add layers from cartoDB browser to Android Application
- Is there a good way to display map tiles dynamic and real time?
- Popup content will not appear in the UI - CartoDB Web Mapping Application
- Android + nutiteq: offline map tiles not shown
- LatLng coming up has unidentified
- Having an issue seeing the heat signature on the map using HeatMapWithTime
Related Questions in CARTO-MOBILE
- How to fix error project offline maps used Nutiteq maps SDK
- Map localization in Carto Mobile SDK
- Z-index of map objects
- Error decoding tiles in Bundle MBTiles file using CartoDB SDK
- Issue with fetching a custom tileset from CARTO and displaying it on a MapBox map iOS Swift
- Why does Carto Package Manager can't connect to it's database after resuming?
- Carto MapView re-use causes crash
- Offline geocoding using MBTiles with vector tiles
- Fit map to objects in Carto mobile SDK
- Connecting Firebase and Carto
- How to make transparent map background with CARTO mobile SDK
- Carto Mobile SDK: How to zoom-in when cluster is clicked
- How can I add a customised Carto Map Marker via Carto Map Moblie SDK.UWP?
- Get x and y pixel of touched MapTile in Carto mobile SDK
- How to Move Map in Background with Fixed Marker Pin in Carto Mobile Swift
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Ok, thanks for asking, this actually wasn't the most trivial task.
Details depend what parts of map you want to make transparent. Let's assume you want to sea areas transparent. Essentially, you have four different levels that need to be transparent then:
My example snippets are in Swift, but should be easily convertible to other languages.
In Carto's Mobile SDK, the land is actually solid background color covering whole map, water is placed on top of it as blue (or dark)-colored polygons. So if you wish to make the water layer transparent, you also need to make the map background transparent, but this creates also transparent land. To avoid this you need to 'color' land side with some polygons; normal vector tiles do not have land coverage, but we have created special tileset in a mapbox account, what you can use as VectorTileLayer:
Now that you've got your land area colored, you would add another layer with real basemap. For this we need a customized basemap style - with transparent water/sea - and bundle it with your app. Carto's Voyager style is available here.
Unzip it, and make the following changes in the following files:
hydro.mss:
style.mss:
Compress the files (make sure there is no folder in zip, else the SDK won't find any files) and add the new style to your
assetsfolder (if Android) or anywhere (if iOS).Now you can load your style from an asset file like this:
Then set your GlView's background transparent, and set mapview background bitmap to null, and you're ready to go:
When you're developing Android, you also need to add the following two lines for the transparent NTMapView background to properly render, else it'll stay black:
Here I've set the parent views background to red. Now I see the following when the MapView renders: