Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Google Map API 3 help

Featured Replies

I am trying to change the colors of my map, but not sure how to do this.

<script src="https://maps.googleapis.com/maps/api/js"></script>
<script>
    function initialize() {
		var mapCanvas = document.getElementById('map-canvas');
        var mapOptions = {
			center: new google.maps.LatLng(52.409703, -1.974159),
			zoom: 10,
			mapTypeId: google.maps.MapTypeId.ROADMAP
        }
        var map = new google.maps.Map(mapCanvas, mapOptions)
	}
    google.maps.event.addDomListener(window, 'load', initialize);
</script>

In the map options object you declared above, it can have a property called .styles that can accept an array of values.

// declare mapStyles array
var mapStyles= [
  {
    stylers: [
      { hue: "#00ffe6" },
      { saturation: -20 }
    ]
  },{
    featureType: "road",
    elementType: "geometry",
    stylers: [
      { lightness: 100 },
      { visibility: "simplified" }
    ]
  },{
    featureType: "road",
    elementType: "labels",
    stylers: [
      { visibility: "off" }
    ]
  }
];

var mapOptions = {
	center: new google.maps.LatLng(52.409703, -1.974159),
	zoom: 10,
	mapTypeId: google.maps.MapTypeId.ROADMAP,
        // insert the mapStyles array as a value to the styles property
        styles: mapStyles
};

Got from this article https://developers.google.com/maps/documentation/javascript/styling#styling_the_default_map

Edited by rbrtsmith

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.