Пример #1
0
    @Override
    protected Cursor doInBackground(String... params) {
      fDAO = new FacilityDAO(myActivity);
      fDAO.open();

      c = fDAO.search(params[0]);
      while (c.moveToNext()) {

        String category = c.getString(c.getColumnIndex("category"));
        double lat = c.getDouble(c.getColumnIndex("latitude"));
        double lon = c.getDouble(c.getColumnIndex("longitude"));

        MapPOIItem marker = new MapPOIItem();
        marker.setItemName(params[2]);
        marker.setTag(0);
        marker.setMapPoint(MapPoint.mapPointWithGeoCoord(lat, lon));
        marker.setMarkerType(MapPOIItem.MarkerType.CustomImage);
        marker.setCustomImageResourceId(Integer.parseInt(params[1]));
        marker.setCustomImageAutoscale(true);
        marker.setCustomImageAnchor(0.5f, 1.0f);

        mapView.addPOIItem(marker);
      }

      fDAO.close();
      return null;
    }
Пример #2
0
  public void traceSkid(double lat, double lon) {
    // Polyline 좌표 지정.
    polyline.addPoint(MapPoint.mapPointWithGeoCoord(lat, lon));

    // Polyline 지도에 올리기.
    mapView.addPolyline(polyline);

    marker.setItemName("Default Marker");
    marker.setTag(0);
    marker.setMapPoint(MapPoint.mapPointWithGeoCoord(lat, lon));

    marker.setMarkerType(MapPOIItem.MarkerType.BluePin);
    marker.setSelectedMarkerType(MapPOIItem.MarkerType.RedPin);
    MapPointBounds mapPointBounds = new MapPointBounds(polyline.getMapPoints());
    int padding = 100; // px
    mapView.moveCamera(CameraUpdateFactory.newMapPointBounds(mapPointBounds, padding));
    mapView.addPOIItem(marker);
  }
Пример #3
0
  @Override
  public void onPOIItemSelected(MapView mapView, MapPOIItem mapPOIItem) {
    Log.i("TAG", "onPOIItemSelected");

    if (CurrentZoomLevel > MapManager.STEP2_ZOOMLEVEL) {
      mMapView = mMapManeger.GoStep2(mapView, mapPOIItem);
    } else if (CurrentZoomLevel > MapManager.STEP3_ZOOMLEVEL) {
      mMapView = mMapManeger.GoStep3(mapView, mapPOIItem);
    } else if (CurrentZoomLevel > MapManager.STEP4_ZOOMLEVEL) {

    } else {

    }
    CurrentSelect = mapPOIItem.getTag();
    btn_steps = mMapManeger.SelectCity(CurrentSelect, btn_steps);
  }