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