Ejemplo n.º 1
0
  @Override
  public void onReadCameras(ArrayList<BJCamera> cameraBeans) {
    mBeijingCameras = cameraBeans;

    if (geoFenceManager == null) {
      geoFenceManager = new GeoFenceManager(MapsApplication.getAppContext());
    }

    geoFenceManager.requestLocation();
  }
Ejemplo n.º 2
0
  @Override
  public void enableDefaultGeoFences() {
    if (mBeijingCameras != null) {
      ArrayList<GeoFenceInfo> geoFenceInfos = new ArrayList<>();
      for (BJCamera cameraBean : mBeijingCameras) {
        LatLng latLng = new LatLng(cameraBean.getLatitude(), cameraBean.getLongtitude());
        GeoFenceInfo info =
            new GeoFenceInfo(MapsApplication.getAppContext(), latLng, cameraBean.getId());
        geoFenceInfos.add(info);
      }

      if (DEBUG) {
        GeoFenceInfo geoFenceInfo =
            new GeoFenceInfo(
                MapsApplication.getAppContext(), new LatLng(40.09705f, 116.426019f), 100);
        geoFenceInfos.add(geoFenceInfo);
      }

      geoFenceManager.addAllGeoFenceAler(geoFenceInfos);
    }
  }