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.
Open Google Maps. Click Menu Your places Labeled. Next to the label you want to remove, click Remove .
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.
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);
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"} ] } ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With