I just want to show one country's map by google maps API v3, how to do? And I don't want get any geo info on this map,such as river,road,etc.
-
Starting from v 3.35 you can use `restriction` option in order to limit viewport of the map. Have a look at example and explanations in https://stackoverflow.com/a/54717220/5140781. – xomena Feb 15 '19 at 21:27
1 Answers
There is a way to limit zoom and pan, but as far as I know the thing you want to do isn't supported in Gmaps. You can combine limiting zoom/pan with displaying a blank white zone over the areas you don't want to be displayed, and which appear in your zoom/pan range (outside your country's borders, for instance, whithin a certain range).
Try this tutorial for zoom/pan limitations : http://econym.org.uk/gmap/range.htm.
Concerning the fact you don't want rivers, roads, to be displayed, could I advise you this link : http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html. It's the styled maps wizard, and if I were you I think I'd try to make all the elements you don't want to be displayed, the same color as the background.
For instance, white background, white rivers, white roads. I think you can even find a way in this wizard to not display them at all, there are lots of options :)
EDIT : oh yeah, you can definitely NOT show roads, rivers... Click on one element on the top list, and select "visibility : off". Works for almost everything.

- 21,522
- 15
- 80
- 131