|
How to limit the pan in google maps |
|
Écrit par Cédric Pelloquin
|
|
04-11-2009 |
|
If you want to limit the range of panoramic that the user is allowed to use on your google map, you can add listeners for the "move" event, and intercept any operations that go outside the permitted region.
What I've done for the position is to specify an allowable region in GLatLngBounds() format (from South-West to North-East). Then I check that the upper edge of the google map, is located less north than the licensed area. The same process is used for other directions. There are other methods to control the center of the map is in the licensed area. In my example I also blocked the zoom. Sample : How to limit the pan in google maps |
|
Dernière mise à jour : ( 06-11-2009 )
|