How to show the labels in satellite view in Google Maps

Google MapsGoogle Maps-Api-3

Google Maps Problem Overview


enter image description here

My map is displaying fine. BUT no lables are shown on it. I can show the lables when I check the satellite => label.

How I can check the satellite => label by default (through code). Now by default no labels are shown.

Google Maps Solutions


Solution 1 - Google Maps

In your MapOptions object that you use to create the map, use MapTypeId.HYBRID, like this:

var myLatlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
  zoom: 8,
  center: myLatlng,
  mapTypeId: google.maps.MapTypeId.HYBRID
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
    myOptions);

Solution 2 - Google Maps

I don't know about an option to explicitly show the labels in the SATELLITE view. The "styles" property was supposed to do this, but I had no lucky when tried this with the code below:

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

I ended up using the HYBRID map type, instead of using the SATELLITE one, and hiding the default user interface to turn off the visibility of the change map type menu, and hided the "road" element:

mapOptions: {
    disableDefaultUI: true,
    mapTypeId: 'hybrid',
styles: [
	    {
		featureType: "road",
		stylers: [
			     {visibility: "off"}
			 ]
	    }
	]

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionWaheedView Question on Stackoverflow
Solution 1 - Google MapsMano MarksView Answer on Stackoverflow
Solution 2 - Google MapsjfoliveiraView Answer on Stackoverflow