什么是印度的LatLngBounds?

Rah*_*raj 3 android google-maps latitude-longitude google-places-api

我在我的Android应用程序中使用自动完成位置小部件.我想把限制只限于印度.但我不知道印度的LatLngBounds.有人对坐标有什么看法吗?

Apa*_*nha 12

你可以用这个..

private static final LatLngBounds BOUNDS_INDIA = new LatLngBounds(new LatLng(23.63936, 68.14712), new LatLng(28.20453, 97.34466));
Run Code Online (Sandbox Code Playgroud)


hum*_*olf 8

如果你想覆盖整个印度(虽然它也将涵盖中国,巴基斯坦和孟加拉国的一些地区),请使用以下范围: -

public static final LatLngBounds BOUNDS_INDIA = new LatLngBounds(new LatLng(7.798000, 68.14712), new LatLng(37.090000, 97.34466));
Run Code Online (Sandbox Code Playgroud)

根据谷歌文档: -

public LatLngBounds (LatLng southwest, LatLng northeast)

Creates a new bounds based on a southwest and a northeast corner.

The bounds conceptually includes all points where:

1. the latitude is in the range [northeast.latitude, southwest.latitude];
2. the longitude is in the range [southwest.longtitude, northeast.longitude] if southwest.longtitude ? northeast.longitude;
Run Code Online (Sandbox Code Playgroud)

要查找任何地方的经纬度,请使用: - http://www.findlatitudeandlongitude.com/