How to display only one country or a specific area in Google maps using the api?

26,683

Check out one of Mike Williams' great GMaps tutorials: in there, he shows how to limit zoom and pan in your map.

If you want some areas to be non-visible, try this one: I think that's closest to what you want (the example actually does the same thing you want, but it seems to be geared towards Canadians ;)).

Share:
26,683
Reed Richards
Author by

Reed Richards

PhD Student robotics / machine learning / computer vision.

Updated on October 29, 2020

Comments

  • Reed Richards
    Reed Richards over 3 years

    I am using Google Maps in a project and I want to display only a country map in my map window i.e. I want only the US to show on my map not Canda and Mexico and so on, cutting away the superflous information for the app I am building.

    I found some stuff where you can restrict the area covered with some javascript however this still gives me a lot of extra map area as geographic areas usually do not conform to squares.

    Further on I am limited by time, $, php and javascript so I can't really do some fancy custom solution that involves lots of work i.e. the usual setting.

  • Reed Richards
    Reed Richards almost 15 years
    Not exactly to the point but close enough, upon googling about it, it seems that it's not supported in the google maps api.