0

Peace be upon you all

I have a simple question. I want to embed a Google map in my website in which it only shows USA map without allowing users to zoom out from USA map to somewhere else. Most importantly i want it to show only names of states with default view and display only corresponding names of cities by zooming when clicking on particular state not anything else.

So is there a way to do that or i have to look for some other services?? Any idea, suggestion or help will be appreciated.

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
function initialize() {
  var myLatlng = new google.maps.LatLng(39.574912, -102.344687);
  var mapOptions = {
    zoom: 4,
    maxZoom: 7,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
}

google.maps.event.addDomListener(window, 'load', initialize);

    </script>

    <div id="map-canvas"></div>
  • 1
    see this anwser http://stackoverflow.com/a/19999036/142904 and this https://support.google.com/earth/answer/148130?hl=en – Kristian Damian Oct 22 '14 at 15:23
  • Show your Code please. – Jenson M John Oct 22 '14 at 15:25
  • Hey i have edited the question and put the code. I know about maxzoom and zoom in map options but i want it to be what i mentioned in my question..is it possible with google maps? – Mohammed Samiullah Oct 22 '14 at 16:40
  • @KristianDamian in the link you have given is only showing some region mentioned in code with their popularity values. i want it to zoom as we click on it and get corresponding cities...by the way i was not expecting -2 from someone – Mohammed Samiullah Oct 22 '14 at 17:09

0 Answers0