如何只显示一个国家或在使用API​​谷歌地图的特定区域? [英] How to display only one country or a specific area in Google maps using the api?

查看:1181
本文介绍了如何只显示一个国家或在使用API​​谷歌地图的特定区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用谷歌地图中的一个项目,我想只显示在我的地图窗口即国家地图我想只有美国表现出对我的地图不坎达和墨西哥等,切掉了的superflous信息应用程序我建立。

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.

我发现了一些东西,在那里你可以限制布满一些JavaScript面积不过这仍然给了我很多额外的地图区域为地理区域通常不符合正方形。

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.

另外关于我受时间,$,PHP和JavaScript的限制,所以我不能真正做到这一点涉及到大量的工作,即通常设置一些花哨的定制解决方案。

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.

推荐答案

检查出的麦克威廉姆斯一个人伟大的GMaps实现教程:在那里,他展示了如何限制缩放和平移地图中的

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

这篇关于如何只显示一个国家或在使用API​​谷歌地图的特定区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆