当前位置: 首页>>代码示例>>Java>>正文


Java LatLngBounds.contains方法代码示例

本文整理汇总了Java中com.google.android.gms.maps.model.LatLngBounds.contains方法的典型用法代码示例。如果您正苦于以下问题:Java LatLngBounds.contains方法的具体用法?Java LatLngBounds.contains怎么用?Java LatLngBounds.contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.maps.model.LatLngBounds的用法示例。


在下文中一共展示了LatLngBounds.contains方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onLocationChanged

import com.google.android.gms.maps.model.LatLngBounds; //导入方法依赖的package包/类
@Override
public void onLocationChanged(Location location) {
	this.location = location;
	Log.d(LOG_NAME, "Map location updated.");
	if (locationChangedListener != null) {
		locationChangedListener.onLocationChanged(location);
	}

	if (followMe) {
		LatLngBounds bounds = map.getProjection().getVisibleRegion().latLngBounds;
		LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
		if (!bounds.contains(latLng)) {
			// Move the camera to the user's location once it's available!
			map.animateCamera(CameraUpdateFactory.newLatLng(latLng));
		}
	}
}
 
开发者ID:ngageoint,项目名称:mage-android,代码行数:18,代码来源:MapFragment.java

示例2: limitBounds

import com.google.android.gms.maps.model.LatLngBounds; //导入方法依赖的package包/类
public static void limitBounds(GoogleMap map, CameraPosition cameraPosition, LatLngBounds bounds, float minZoom, LatLng centre) {
  if (bounds.contains(map.getCameraPosition().target) && cameraPosition.zoom >= minZoom) {
    return;
  }

  float targetZoom = cameraPosition.zoom;
  if (cameraPosition.zoom < minZoom) {
    targetZoom = minZoom;
  }

  if (centre != null) {
    map.animateCamera(CameraUpdateFactory.newLatLngZoom(centre, targetZoom));
  } else {
    double targetLong = cameraPosition.target.longitude;
    if (cameraPosition.target.longitude < bounds.southwest.longitude) {
      targetLong = bounds.southwest.longitude;
    } else if (cameraPosition.target.longitude > bounds.northeast.longitude) {
      targetLong = bounds.northeast.longitude;
    }

    double targetLat = cameraPosition.target.latitude;
    if (cameraPosition.target.latitude < bounds.southwest.latitude) {
      targetLat = bounds.southwest.latitude;
    } else if (cameraPosition.target.latitude > bounds.northeast.latitude) {
      targetLat = bounds.northeast.latitude;
    }

    LatLng targetLatLng = new LatLng(targetLat, targetLong);
    map.animateCamera(CameraUpdateFactory.newLatLngZoom(targetLatLng, targetZoom));
  }
}
 
开发者ID:fiskurgit,项目名称:KortidTol,代码行数:32,代码来源:MapTools.java

示例3: checkIfOnCampus

import com.google.android.gms.maps.model.LatLngBounds; //导入方法依赖的package包/类
private boolean checkIfOnCampus(double lat, double lng){
    LatLngBounds bounds = new LatLngBounds(new LatLng(53.517288, -113.533018),
            new LatLng(53.530606, -113.511475));
    if (bounds.contains(new LatLng(lat, lng)))
    {
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:cfudge,项目名称:ClassDiscuss,代码行数:13,代码来源:MapActivity.java

示例4: containsInBoundary

import com.google.android.gms.maps.model.LatLngBounds; //导入方法依赖的package包/类
/** Returns true if any point of the feature falls into provided bounds */
public boolean containsInBoundary(LatLngBounds bounds){
    for(LatLng p : points){
        if(bounds.contains(p))
            return true;
    }
    return false;
}
 
开发者ID:MASTUSAID,项目名称:MAST-MOBILE,代码行数:9,代码来源:MapFeature.java

示例5: getPointToSnap

import com.google.android.gms.maps.model.LatLngBounds; //导入方法依赖的package包/类
public LatLng getPointToSnap(LatLngBounds bounds, android.graphics.Point pointToTest, int snappingTolerance){
    for (int i = 0; i < getScreenPoints().size(); i++){
        if (GisUtility.getDistanceBetweenPoints(screenPoints.get(i), pointToTest) <= snappingTolerance) {
            // Test point to be in the visible bound
            if(bounds.contains(points.get(i)))
                return points.get(i);
        }
    }
    return null;
}
 
开发者ID:MASTUSAID,项目名称:MAST-MOBILE,代码行数:11,代码来源:MapFeature.java

示例6: getSegmentPointToSnap

import com.google.android.gms.maps.model.LatLngBounds; //导入方法依赖的package包/类
public LatLng getSegmentPointToSnap(LatLngBounds bounds, LatLng pointToTest, android.graphics.Point screenPointToTest, int snappingTolerance){
    for (int i = 0; i < getScreenPoints().size(); i++){
        if(i + 1 < getScreenPoints().size()){
            if (GisUtility.getDistanceToSegment(screenPointToTest, screenPoints.get(i), screenPoints.get(i + 1)) <= snappingTolerance) {
                LatLng pointToSnap = GisUtility.getClosestPointOnSegment(pointToTest, points.get(i), points.get(i + 1));
                if(bounds.contains(pointToSnap))
                    return pointToSnap;
            }
        }
    }
    return null;
}
 
开发者ID:MASTUSAID,项目名称:MAST-MOBILE,代码行数:13,代码来源:MapFeature.java

示例7: isGroundOverlayContains

import com.google.android.gms.maps.model.LatLngBounds; //导入方法依赖的package包/类
/**
 * Check if a ground overlay contains a point
 * @param groundOverlay
 * @param point
 */
private boolean isGroundOverlayContains(GroundOverlay groundOverlay, LatLng point) {
  LatLngBounds groundOverlayBounds = groundOverlay.getBounds();

  return groundOverlayBounds.contains(point);
}
 
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:11,代码来源:GoogleMaps.java

示例8: isGroundOverlayContains

import com.google.android.gms.maps.model.LatLngBounds; //导入方法依赖的package包/类
/**
 * Check if a ground overlay contains a point
 * @param groundOverlay
 * @param point
 */
private boolean isGroundOverlayContains(GroundOverlay groundOverlay, LatLng point) {
  LatLngBounds groundOverlayBounds = groundOverlay.getBounds();
  
  return groundOverlayBounds.contains(point);
}
 
开发者ID:neo4art,项目名称:neo4art,代码行数:11,代码来源:GoogleMaps.java


注:本文中的com.google.android.gms.maps.model.LatLngBounds.contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。