我想在Android上绘制我在Google MapMap上的路径...我移动Forword应该绘制折线...我读了一些关于谷歌地图和json解析器的教程但是在这种情况下我们只绘制从开始到定义的路径。 ..我还阅读了一个在MapView上绘制Overlay的教程。但我想在GooglMap Class上绘制... MapView OverLay的代码如下,但它不适用于GooglMap
package com.example.PublicSafety;
import java.util.ArrayList;
import java.util.List;
import com.google.android.maps.Overlay;
import android.graphics.Color;
import android.graphics.Paint;
import android.location.Location;
public class RouteOverlay extends Overlay{
private List<Location> locations;
private Paint pathPaint;
private Paint postionPaint;
public RouteOverlay() {
pathPaint = new Paint();
pathPaint.setAntiAlias(true);
pathPaint.setColor(Color.RED);
pathPaint.setStyle(Paint.Style.STROKE);
pathPaint.setStrokeWidth(5);
locations = new ArrayList<Location>();
postionPaint = new Paint();
postionPaint.setAntiAlias(true);
postionPaint.setStyle(Paint.Style.FILL);
}
}
答案 0 :(得分:1)