public class MapUtils extends Object
| Constructor and Description |
|---|
MapUtils() |
| Modifier and Type | Method and Description |
|---|---|
static BoundingBox |
buildClickBoundingBox(LatLng latLng,
View view,
GoogleMap map,
float screenClickPercentage)
Build a bounding box using the click location, map view, map, and screen percentage tolerance.
|
static LatLngBoundingBox |
buildClickLatLngBoundingBox(LatLng latLng,
View view,
GoogleMap map,
float screenClickPercentage)
Build a lat lng bounding box using the click location, map view, map, and screen percentage tolerance.
|
static LatLngBounds |
buildClickLatLngBounds(LatLng latLng,
View view,
GoogleMap map,
float screenClickPercentage)
Build a lat lng bounds using the click location, map view, map, and screen percentage tolerance.
|
static BoundingBox |
getBoundingBox(GoogleMap map)
Get the WGS84 bounding box of the current map view screen.
|
static float |
getCurrentZoom(GoogleMap map)
Get the current zoom level of the map
|
static double |
getToleranceDistance(LatLng latLng,
View view,
GoogleMap map,
float screenClickPercentage)
Get the allowable tolerance distance in meters from the click location on the map view and map with the screen percentage tolerance.
|
static double |
getToleranceDistance(View view,
GoogleMap map)
Get the tolerance distance meters in the current region of the map
|
static boolean |
isPointNearMarker(LatLng point,
MarkerOptions shapeMarker,
double tolerance)
Is the point near the shape marker
|
static boolean |
isPointNearMultiLatLng(LatLng point,
MultiLatLng multiLatLng,
double tolerance)
Is the point near any points in the multi lat lng
|
static boolean |
isPointNearPoint(LatLng point,
LatLng shapePoint,
double tolerance)
Is the point near the shape point
|
static boolean |
isPointOnMultiPolygon(LatLng point,
MultiPolygonOptions multiPolygon,
boolean geodesic,
double tolerance)
Is the point on the multi polygon
|
static boolean |
isPointOnMultiPolyline(LatLng point,
MultiPolylineOptions multiPolyline,
boolean geodesic,
double tolerance)
Is the point on the multi polyline
|
static boolean |
isPointOnPolygon(LatLng point,
PolygonOptions polygon,
boolean geodesic,
double tolerance)
Is the point of the polygon
|
static boolean |
isPointOnPolyline(LatLng point,
PolylineOptions polyline,
boolean geodesic,
double tolerance)
Is the point on the polyline
|
static boolean |
isPointOnShape(LatLng point,
GoogleMapShape shape,
boolean geodesic,
double tolerance)
Is the point on or near the shape
|
public static float getCurrentZoom(GoogleMap map)
map - google mappublic static double getToleranceDistance(View view, GoogleMap map)
view - viewmap - google mappublic static BoundingBox getBoundingBox(GoogleMap map)
map - google mappublic static BoundingBox buildClickBoundingBox(LatLng latLng, View view, GoogleMap map, float screenClickPercentage)
latLng - click locationview - viewmap - Google mapscreenClickPercentage - screen click percentage between 0.0 and 1.0 for how close a feature
on the screen must be to be included in a click querypublic static LatLngBounds buildClickLatLngBounds(LatLng latLng,
View view,
GoogleMap map,
float screenClickPercentage)
latLng - click locationview - viewmap - Google mapscreenClickPercentage - screen click percentage between 0.0 and 1.0 for how close a feature
on the screen must be to be included in a click querypublic static double getToleranceDistance(LatLng latLng,
View view,
GoogleMap map,
float screenClickPercentage)
latLng - click locationview - map viewmap - mapscreenClickPercentage - screen click percentage between 0.0 and 1.0 for how close a feature
on the screen must be to be included in a click querypublic static LatLngBoundingBox buildClickLatLngBoundingBox(LatLng latLng, View view, GoogleMap map, float screenClickPercentage)
latLng - click locationview - map viewmap - mapscreenClickPercentage - screen click percentage between 0.0 and 1.0 for how close a feature
on the screen must be to be included in a click querypublic static boolean isPointOnShape(LatLng point,
GoogleMapShape shape,
boolean geodesic,
double tolerance)
point - lat lng pointshape - map shapegeodesic - geodesic check flagtolerance - distance tolerancepublic static boolean isPointNearMarker(LatLng point,
MarkerOptions shapeMarker,
double tolerance)
point - pointshapeMarker - shape markertolerance - distance tolerancepublic static boolean isPointNearPoint(LatLng point,
LatLng shapePoint,
double tolerance)
point - pointshapePoint - shape pointtolerance - distance tolerancepublic static boolean isPointNearMultiLatLng(LatLng point,
MultiLatLng multiLatLng,
double tolerance)
point - pointmultiLatLng - multi lat lngtolerance - distance tolerancepublic static boolean isPointOnPolyline(LatLng point,
PolylineOptions polyline,
boolean geodesic,
double tolerance)
point - pointpolyline - polylinegeodesic - geodesic check flagtolerance - distance tolerancepublic static boolean isPointOnMultiPolyline(LatLng point,
MultiPolylineOptions multiPolyline,
boolean geodesic,
double tolerance)
point - pointmultiPolyline - multi polylinegeodesic - geodesic check flagtolerance - distance tolerancepublic static boolean isPointOnPolygon(LatLng point,
PolygonOptions polygon,
boolean geodesic,
double tolerance)
point - pointpolygon - polygongeodesic - geodesic check flagtolerance - distance tolerancepublic static boolean isPointOnMultiPolygon(LatLng point,
MultiPolygonOptions multiPolygon,
boolean geodesic,
double tolerance)
point - pointmultiPolygon - multi polygongeodesic - geodesic check flagtolerance - distance tolerance