var geocoder;
var map;
function getColor() {
var red = (Math.floor((256 - 199) * Math.random()) + 200);
var green = (Math.floor((256 - 199) * Math.random()) + 200);
var blue = (Math.floor((256 - 199) * Math.random()) + 200);
var color = "#" + red.toString(16) + green.toString(16) + blue.toString(16);
return color;
}
function initialize() {
var styles = [{
elementType: 'geometry',
stylers: [{
color: getColor()
}]
}, {
elementType: 'labels.text.stroke',
stylers: [{
color: getColor()
}]
}, {
elementType: 'labels.text.fill',
stylers: [{
color: getColor()
}]
}, {
featureType: 'administrative.locality',
elementType: 'labels.text.fill',
stylers: [{
color: getColor()
}]
}, {
featureType: 'poi',
elementType: 'labels.text.fill',
stylers: [{
color: getColor()
}]
}, {
featureType: 'poi.park',
elementType: 'geometry',
stylers: [{
color: getColor()
}]
}, {
featureType: 'poi.park',
elementType: 'labels.text.fill',
stylers: [{
color: getColor()
}]
}, {
featureType: 'road',
elementType: 'geometry',
stylers: [{
color: getColor()
}]
}, {
featureType: 'road',
elementType: 'geometry.stroke',
stylers: [{
color: getColor()
}]
}, {
featureType: 'road',
elementType: 'labels.text.fill',
stylers: [{
color: getColor()
}]
}, {
featureType: 'road.highway',
elementType: 'geometry',
stylers: [{
color: getColor()
}]
}, {
featureType: 'road.highway',
elementType: 'geometry.stroke',
stylers: [{
color: getColor()
}]
}, {
featureType: 'road.highway',
elementType: 'labels.text.fill',
stylers: [{
color: getColor()
}]
}, {
featureType: 'transit',
elementType: 'geometry',
stylers: [{
color: getColor()
}]
}, {
featureType: 'transit.station',
elementType: 'labels.text.fill',
stylers: [{
color: getColor()
}]
}, {
featureType: 'water',
elementType: 'geometry',
stylers: [{
color: getColor()
}]
}, {
featureType: 'water',
elementType: 'labels.text.fill',
stylers: [{
color: getColor()
}]
}, {
featureType: 'water',
elementType: 'labels.text.stroke',
stylers: [{
color: getColor()
}]
}]
var map = new google.maps.Map(document.getElementById('map'), {
center: {
lat: 47.730,
lng: -122.323
},
zoom: 12,
styles: styles
});
}
google.maps.event.addDomListener(window, "load", initialize);
html,
body,
#map {
height: 100%;
width: 100%;
margin: 0px;
padding: 0px
}
<script src="https://maps.googleapis.com/maps/api/js"></script>
<div id="map"></div>