JSFiddle - React, Tailwind, and code Playground
by Jefferson Lima
HTML
<!DOCTYPE html>
<html>
<head>
<title>Styled Maps - Night Mode</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
function initMap() {
// Styles a map in night mode.
var map = new google.maps.Map(document.getElementById('map'), {
center: {
lat: 40.674,
lng: -73.945
},
zoom: 12,
styles: [{
elementType: 'geometry',
stylers: [{
color: '#242f3e'
}]
}, {
elementType: 'labels.text.stroke',
stylers: [{
color: '#242f3e'
}]
}, {
elementType: 'labels.text.fill',
stylers: [{
color: '#746855'
}]
}, {
featureType: 'administrative.locality',
elementType: 'labels.text.fill',
stylers: [{
color: '#d59563'
}]
}, {
featureType: 'poi',
elementType: 'labels.text.fill',
stylers: [{
color: '#d59563'
}]
}, {
featureType: 'poi.park',
elementType: 'geometry',
stylers: [{
...