Android Question Google Map Style

Blueforcer

Well-Known Member
Licensed User
Longtime User
Hello!

is it possible to change the Map style like this?
https://snazzymaps.com/style/30/cobalt

this is done by following Javascript:

B4X:
  <script type="text/javascript">
            // When the window has finished loading create our google map below
            google.maps.event.addDomListener(window, 'load', init);
       
            function init() {
                // Basic options for a simple Google Map
                // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions
                var mapOptions = {
                    // How zoomed in you want the map to start at (always required)
                    zoom: 11,

                    // The latitude and longitude to center the map (always required)
                    center: new google.maps.LatLng(40.6700, -73.9400), // New York

                    // How you would like to style the map.
                    // This is where you would paste any style found on Snazzy Maps.
                    styles: [{"stylers":[{"visibility":"simplified"}]},{"stylers":[{"color":"#131314"}]},{"featureType":"water","stylers":[{"color":"#131313"},{"lightness":7}]},{"elementType":"labels.text.fill","stylers":[{"visibility":"on"},{"lightness":25}]}]
                };
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

eurojam

Well-Known Member
Licensed User
Longtime User
it seems that Google has specially developed an API for that:
https://developers.google.com/maps/documentation/javascript/styling
.are the googlemaps and googlemapsextra libraries open source?
I would try to implement this API.
B4A googlemaps and googlemapsextra libraries are based on the googlemaps android API V2, the link you described is googlemaps javascript api V3. This is a completly different thing. The first is based on android the second on javascript and html.
 
Upvote 0
Top