Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show the labels in satellite view in Google Maps

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.

like image 931
Waheed Avatar asked May 02 '12 05:05

Waheed


People also ask

How do I get satellite view on Google Maps without labels?

Open Google Maps. Click Menu ​ Your places Labeled. Next to the label you want to remove, click Remove .

How do I change satellite view in Google Maps?

Go to “Settings” from the navigation menu. Next, scroll to the “Map Type” section. Finally, select the “Satellite” map type. Next, you can open any route on your route planner in satellite map mode.


2 Answers

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); 
like image 124
Mano Marks Avatar answered Sep 16 '22 22:09

Mano Marks


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"}              ]         }     ] 
like image 32
jfoliveira Avatar answered Sep 17 '22 22:09

jfoliveira