Having street names on by default for Satellite View

3,228 views
Skip to first unread message

Ice

unread,
Mar 10, 2011, 3:26:29 AM3/10/11
to google-map...@googlegroups.com
Hi I'm having a small issue with API v3
When my page loads I set the default to Satellite view but I have
to check the Labels checkbox to turn the street names on. How do
I make it so that when the page loads by default the street names
or the Labels option is set to true so that street names are visible
without having to check the Labels checkbox

My script is as follows

<script type="text/javascript">
var map;
var image;

function initialize() {
    var myOptions = {
    //zoom: 6,
    mapTypeId: google.maps.MapTypeId.SATELLITE,
    maxZoom: 18,
    zoomControl: true,
    mapTypeControlOptions: {
      style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR
    },
    zoomControlOptions: {
      style: google.maps.ZoomControlStyle.LARGE
    },
    streetViewControl: true
  };

  map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  image = "/images/reddot.png";
    initialLocation = new google.maps.LatLng(-34.07153996863397,18.56987714767456);
    map.setCenter(initialLocation);
    map.setZoom(17);
      marker = new google.maps.Marker({
          position: initialLocation,
          map: map,
          icon: image
      });
}

function loadScript() {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src = "http://maps.google.com/maps/api/js?v=3&sensor=false&callback=initialize&region=ZA";
    document.body.appendChild(script);
  }
 
  window.onload = loadScript;
</script>

Ice

unread,
Mar 10, 2011, 3:29:30 AM3/10/11
to google-map...@googlegroups.com
Sorry to see where I'm using this you can go here
http://www.dining-out.co.za/member_details-MemberID-3104.html

en4ce

unread,
Mar 10, 2011, 5:36:33 AM3/10/11
to Google Maps JavaScript API v3
change the mapTypeId: google.maps.MapTypeId.SATELLITE, to mapTypeId:
google.maps.MapTypeId.HYBRID,

Ice

unread,
Mar 10, 2011, 8:03:16 AM3/10/11
to google-map...@googlegroups.com
Thank you very much

Just for interest sake is there no "labels" boolean option to set
I thought this is what I was looking for

Victor Hall

unread,
Jul 24, 2016, 8:07:58 PM7/24/16
to Google Maps JavaScript API v3, dje...@googlemail.com

thanks!
Reply all
Reply to author
Forward
0 new messages