use of org.odk.collect.geo.maps.MapPoint in project collect by opendatakit.
the class OsmDroidMapFragment method addDraggablePoly.
@Override
public int addDraggablePoly(@NonNull Iterable<MapPoint> points, boolean closedPolygon) {
int featureId = nextFeatureId++;
features.put(featureId, new PolyFeature(map, points, closedPolygon));
return featureId;
}
use of org.odk.collect.geo.maps.MapPoint in project collect by opendatakit.
the class GoogleMapFragment method addMarker.
@Override
public int addMarker(MapPoint point, boolean draggable, @IconAnchor String iconAnchor) {
int featureId = nextFeatureId++;
features.put(featureId, new MarkerFeature(map, point, draggable, iconAnchor));
return featureId;
}
use of org.odk.collect.geo.maps.MapPoint in project collect by opendatakit.
the class GoogleMapFragment method fromMarker.
@NonNull
private static MapPoint fromMarker(@NonNull Marker marker) {
LatLng position = marker.getPosition();
String snippet = marker.getSnippet();
String[] parts = (snippet != null ? snippet : "").split(";");
double alt = 0;
double sd = 0;
try {
if (parts.length >= 1) {
alt = Double.parseDouble(parts[0]);
}
if (parts.length >= 2) {
sd = Double.parseDouble(parts[1]);
}
} catch (NumberFormatException e) {
Timber.w("Marker.getSnippet() did not contain two numbers");
}
return new MapPoint(position.latitude, position.longitude, alt, sd);
}
Aggregations