Anh*_*ong 6 android google-maps-android-api-2
以前,我创建了一个在Android Map API v1中扩展GeoPoint的类:
class CyclePoint extends GeoPoint {
public float accuracy;
public double altitude;
public float speed;
public double time;
public CyclePoint(int lat, int lgt, double currentTime) {
super(lat, lgt);
this.time = currentTime;
}
public CyclePoint(int lat, int lgt, double currentTime, float accuracy) {
super(lat, lgt);
this.time = currentTime;
this.accuracy = accuracy;
}
public CyclePoint(int lat, int lgt, double currentTime, float accuracy, double altitude, float speed) {
super(lat, lgt);
this.time = currentTime;
this.accuracy = accuracy;
this.altitude = altitude;
this.speed = speed;
}
}
Run Code Online (Sandbox Code Playgroud)
现在我切换到V2,我应该扩展什么?它应该是LatLng吗?但是当我切换到LatLng时,它说:类型CyclePoint不能继承最终类LatLng.谁能帮我这个?非常感谢!
小智 11
LatLng对象! http://developer.android.com/reference/com/google/android/gms/maps/model/LatLng.html
这个对象非常有用!你只需要创建一个实例
ex:
LatLng home = new LatLng(-34.3232,-8.31331); // instanciate a new Latlng
home.getLatitude(); // get latitude
home.getLongitude(); // get longitude
Run Code Online (Sandbox Code Playgroud)
ps:纬度和经度必须是双重类型.
| 归档时间: |
|
| 查看次数: |
6843 次 |
| 最近记录: |