-2

i am developing mvc application with google map,i was following below link to display google map but i need to display only particular country(like US Or UK) or City if its possible to do?

https://developers.google.com/maps/documentation/javascript/adding-a-google-map

  • using above link working fine.but when i trying to use geoxml.parse("mylocalpath") is not working, getting error like "Failed to load file:///myfilepath.kmz". how to handle local .kmz file in geoxml.parse method – Suresh Sankar Jan 11 '18 at 13:00

1 Answers1

0

You can do this by setting the coordinates to your City or Country you want to see. Then just adjust the zoom.

https://jsfiddle.net/z2gwf0c1/1/

function initMap() {
  var uluru = {lat: -25.363, lng: 131.044};
  var map = new google.maps.Map(document.getElementById('map'), {
    zoom: 12,
    center: uluru
  });
  var marker = new google.maps.Marker({
    position: uluru,
    map: map
  });
}
Josh Adams
  • 2,113
  • 2
  • 13
  • 25
  • when i zoom out the map it will display all country but i need display only particular city or country when i zoomin or zoomout its possible? – Suresh Sankar Jan 08 '18 at 13:28