dtechlearn
dtechlearn

Reputation: 362

is it possible to delete background from google map?

I have created layer that I have put over the google map: picture here

What I am trying to solve is, how can I remove the rectangle background from google maps? Is it possible? I wasn't able to find it.

My initialize method looks like this, I have set background color to white:

function initialize() {
  var mapOptions = {
  zoom: 8,
  center: myLatlng,
  mapTypeId: google.maps.MapTypeId.ROADMAP,
  backgroundColor: '#FFF',
  disableDefaultUI: true,
  draggable: true,
  scaleControl: false,
  scrollwheel: false,

 styles: [
{
"featureType": "water",
"elementType": "geometry",
"stylers": [
  { "visibility": "off" }
]
},{
"featureType": "landscape",
"stylers": [
  { "visibility": "off" }
]
},{
"featureType": "road",
"stylers": [
  { "visibility": "off" }
]
},{
"featureType": "administrative",
"stylers": [
  { "visibility": "off" }
]
 },{
"featureType": "poi",
"stylers": [
  { "visibility": "off" }
]
},{
"featureType": "administrative",
"stylers": [
  { "visibility": "off" }
]
},{
"elementType": "labels",
"stylers": [
  { "visibility": "off" }
]
},{
}
]
};

 var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

Upvotes: 1

Views: 543

Answers (1)

Paul Thomas
Paul Thomas

Reputation: 2776

This might do it. Hard to tell without an example set up though.

var mapOptions = {
  zoom: 8,
  center: myLatlng,
  mapTypeId: google.maps.MapTypeId.ROADMAP,
  backgroundColor: 'hsla(0, 0%, 0%, 0)',
  disableDefaultUI: true,
  draggable: true,
  scaleControl: false,
  scrollwheel: false,

  styles: [
    {
    "featureType": "all",
    "elementType": "all",
    "stylers": [
        {
            "visibility": "off"
        }
    ]
  }
]

Upvotes: 1

Related Questions