mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
Referencing Waypoint directly again.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// Copyright 2011 Google Inc. All Rights Reserved.
|
||||
package com.google.android.apps.mytracks.io.mymaps;
|
||||
|
||||
import com.google.android.apps.mytracks.content.Waypoint;
|
||||
|
||||
import android.location.Location;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -55,22 +57,6 @@ public interface MapsFacade {
|
||||
boolean uploadMarker(String mapId, String trackName, String trackDescription,
|
||||
Location location, boolean isStart);
|
||||
|
||||
/** Plain data class for waypoints. */
|
||||
public class WaypointData {
|
||||
public String title;
|
||||
public String description;
|
||||
public String iconUrl;
|
||||
public Location location;
|
||||
|
||||
public WaypointData(String title, String description, String iconUrl,
|
||||
Location location) {
|
||||
this.title = title;
|
||||
this.description = description;
|
||||
this.iconUrl = iconUrl;
|
||||
this.location = location;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Uploads a series of waypoints to the given map.
|
||||
*
|
||||
@@ -78,7 +64,7 @@ public interface MapsFacade {
|
||||
* @param waypoints the waypoints to upload
|
||||
* @return true on success, false otherwise
|
||||
*/
|
||||
boolean uploadWaypoints(String mapId, Iterable<WaypointData> waypoints);
|
||||
boolean uploadWaypoints(String mapId, Iterable<Waypoint> waypoints);
|
||||
|
||||
/**
|
||||
* Uploads a series of points to the given map.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2011 Google Inc. All Rights Reserved.
|
||||
package com.google.android.apps.mytracks.io.mymaps;
|
||||
|
||||
import com.google.android.apps.mytracks.content.Waypoint;
|
||||
import com.google.android.apps.mytracks.io.AuthManager;
|
||||
import com.google.android.maps.GeoPoint;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
@@ -209,7 +210,7 @@ public class MapsFacadeImpl implements MapsFacade {
|
||||
*/
|
||||
@Override
|
||||
public boolean uploadWaypoints(
|
||||
final String mapId, final Iterable<WaypointData> waypoints) {
|
||||
final String mapId, final Iterable<Waypoint> waypoints) {
|
||||
return wrapper.runQuery(new MyMapsGDataWrapper.QueryFunction() {
|
||||
public void query(MapsClient client) {
|
||||
// TODO(rdamazio): Stream through the waypoints in chunks.
|
||||
@@ -219,10 +220,10 @@ public class MapsFacadeImpl implements MapsFacade {
|
||||
String featureFeed = MapsClient.getFeaturesFeed(mapId);
|
||||
|
||||
try {
|
||||
for (WaypointData waypoint : waypoints) {
|
||||
for (Waypoint waypoint : waypoints) {
|
||||
MyMapsFeature feature = buildMyMapsPlacemarkFeature(
|
||||
waypoint.title, waypoint.description, waypoint.iconUrl,
|
||||
getGeoPoint(waypoint.location));
|
||||
waypoint.getName(), waypoint.getDescription(), waypoint.getIcon(),
|
||||
getGeoPoint(waypoint.getLocation()));
|
||||
Entry entry = gdataConverter.getEntryForFeature(feature);
|
||||
|
||||
Log.d(MyMapsConstants.TAG,
|
||||
|
||||
Reference in New Issue
Block a user