Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
224 views
in Technique[技术] by (71.8m points)

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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 ;)).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...