Atta Ullah
Atta Ullah

Reputation: 71

draw my Rout on GoogleMaps

I want to draw my Path on GoogleMap in android..as i move Forword a polyline should be drawn...i read some Tutorials about google maps and json parser but i that case we only draw path from start to destinition...I Also Read a tutorial that draws Overlay on MapView..but i want to draw it on GooglMap Class...the code for MapView OverLay is as follow but it didn't work with 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);
    }


}

Upvotes: 0

Views: 138

Answers (1)

Related Questions