3

I would like to have a blank google map, without any basemap showing roadmap, terrain, hybrid or satellite data: just a white background to display my layer only.

Is that possible?

2 Answers 2

4

hexblot was correct with his suggestion to look at custom map types documentation. Here is what I did to have a blank map (white background) without any control.

function initialize(){
    var styles = [{
            stylers:[{ color: "#ffffff" }]
        }
    ];
    var styledMap = new google.maps.StyledMapType(styles);
    var centerlatlng = new google.maps.LatLng(0, 0);
    var myOptions = {
        zoom: 3,
        center: centerlatlng,
        disableDefaultUI : true,
        mapTypeControlOptions: {
            mapTypeIds: ['map_style']
        },
        mapTypeId: 'map_style'
    };

    var map = new google.maps.Map(document.getElementById("map"), myOptions);
    map.mapTypes.set('map_style', styledMap);
}
2

you're most probably interested in custom map types, you can reference Google Maps documentation for that here :

https://developers.google.com/maps/documentation/javascript/maptypes?hl=en#CustomMapTypes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.