I have placed a custom map png on google map. I have removed everything from google maps to only display my custom map. The background color is a light blue and I want to change it to white. Here is the code:
function initialize() {
var myLatLng = new google.maps.LatLng(39, -98.5);
var myOptions = {
maxZoom: 4,
minZoom: 4,
zoom: 4,
panControl: false,
draggable: false,
center: myLatLng,
disableDefaultUI: true,
mapTypeId: google.maps.MapTypeId.ROADMAP,
backgroundColor: '#FFFFFF'
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var mapStyles = [
{
featureType: "all",
stylers: [
{ visibility: "off" }]
}];
map.setOptions({styles: mapStyles});
}
It only flashes white then changes to a light blue. How do I set it to white or transparent?
To color-code your map, just use the same method for the icons – click on the destination and when the box pops up, just click on whatever color you want to make it. You can make all restaurants blue, all shopping pink, all parks green, etc.
Easily create your styleThe new Google Maps APIs Styling Wizard helps you to create a map style in a few clicks. Use one of our pre-built styles or create your own style from scratch.
You can just set backgroundColor: 'none'
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 11,
center: {lat: 41.876, lng: -87.624},
backgroundColor: 'none'
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With