我可以限制用户在Google地图上的特定范围和缩放级别吗? [英] Can I limit users to a specific range and zoom level on Google Maps?

查看:129
本文介绍了我可以限制用户在Google地图上的特定范围和缩放级别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在网页上实施Google地图。为了这个项目的目的,我想限制用户拖动地图的距离,以便他们只能查看属于两个坐标的某个区域(一个指定西北,另一个指定东南,如果您可以获得我的意思)。

I'm implementing a Google Map on a web-page. For the purpose of this project, I want to limit how far users can drag the map, so that they can only view a certain area that falls within two co-ordinates (one specifies north-west, the other, south-east, if you get my meaning).

使用Google Maps API实现此功能的最佳方式是什么?

What's the best way to implement this using the Google Maps API?

有一种方法,我可以调用它会自动执行此操作吗?

Is there a method I can call that will do this automatically?

推荐答案

这种方法做你想做的: http://econym.org.uk/gmap/range.htm

This method does what you want: http://econym.org.uk/gmap/range.htm

这篇关于我可以限制用户在Google地图上的特定范围和缩放级别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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