Android 使用映射覆盖识别变量类型时出现问题
我正试图实现这个非常好的代码。我只看了最后几行,但我不知道可变位置覆盖是什么类型。有没有人有谷歌地图安卓系统的经验,谁可以知道这是什么类型的?我盯着它看了很长一段时间,但我什么也没得到。多谢各位Android 使用映射覆盖识别变量类型时出现问题,android,google-maps-android-api-2,Android,Google Maps Android Api 2,我正试图实现这个非常好的代码。我只看了最后几行,但我不知道可变位置覆盖是什么类型。有没有人有谷歌地图安卓系统的经验,谁可以知道这是什么类型的?我盯着它看了很长一段时间,但我什么也没得到。多谢各位 public class RouteActivity extends MapActivity implements LocationListener { @Override public void onLocationChanged(Location location) { drawUserPosit
public class RouteActivity extends MapActivity implements LocationListener {
@Override
public void onLocationChanged(Location location) {
drawUserPosition(location);
}
private void drawUserPosition(Location location) {
GeoPoint currentLocation;
currentLocation = new GeoPoint((int) ( location.getLatitude() * 1E6), (int) ( location
getLongitude() * 1E6));
OverlayItem currentLocationOverlay = new OverlayItem(currentLocation, getString(R.string.your_location),
getString(R.string.current_location));
mapOverlays.clear();
if (locationOverlays.size() > 1) {
// remove the old user position if there is one
locationOverlays.removeOverlay(1);
}
//add new user position
locationOverlays.addOverlay(currentLocationOverlay, this.getResources().getDrawable(R.drawable.someImage));
mapOverlays.add(locationOverlays);
//.
//. calculate / set the mapcenter, zoom to span
//. see in previous posts
//.
RouteThread rt = new RouteThread(currentLocation, synyxGeoPoint, routeHandler);
rt.start();
}
您正在尝试关注使用不推荐的Maps API v1的博客。即使你完成了,你也不会得到任何好的结果 改为使用。如果你想关注某个博客,可以搜索2013年或更高版本的内容