Show streets and images on Type Satellite by default

1

I want to show the street names and establishments by default. What would be the option? I'm doing this:

var myOptions = {
    scrollwheel: false,
    center: new google.maps.LatLng(lat, centerLon),
    zoom: 15,
    mapTypeId: google.maps.MapTypeId.SATELLITE
};
    
asked by anonymous 14.07.2015 / 15:28

2 answers

1

In map options there are no properties to explicitly enable these options, they already come with the type of visualization. To display as you need, just use HYBRID view, like this:

var options = {
    scrollwheel: false,
    center: new google.maps.LatLng(lat, centerLon),
    zoom: 15,
    mapTypeId: google.maps.MapTypeId.HYBRID
};

See a complete example below:

var gm = google.maps;

function initialize() {
  var options = {
    zoom: 15,
    center: new gm.LatLng(-27.593427, -48.550686),
    mapTypeId: gm.MapTypeId.HYBRID,
    scrollwheel: false
  };

  var map = new gm.Map(document.getElementById("map"), options);

}

gm.event.addDomListener(window, 'load', initialize);
body {
    margin: 0;
}
#map {
  height: 600px;
  width: 100%;
}
<script src="https://maps.googleapis.com/maps/api/js"></script><body><divid="map"></div>
</body>
    
14.07.2015 / 20:41
0

You have to declare the map type as ROADMAP , which is the default option of the MAPS API.

Leave it like this:

var myOptions = {
    scrollwheel: false,
    center: new google.maps.LatLng(lat, centerLon),
    zoom: 15,
    mapTypeId: google.maps.MapTypeId.ROADMAP
};
    
14.07.2015 / 16:50