Exemplo n.º 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;
    }
Exemplo n.º 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);
  }