moagrius / TileView

TileView is a subclass of android.view.ViewGroup that asynchronously displays, pans and zooms tile-based images. Plugins are available for features like markers, hotspots, and path drawing.
MIT License
1.46k stars 337 forks source link

Path #21

Closed robonity closed 11 years ago

robonity commented 11 years ago

Hi

i have problem draw path. Can someone pls write sample code?

thanks

moagrius commented 11 years ago

You can supply your own DrawablePath instance (which is just a android.graphics.Path instance and a android.graphics.Paint instance), or if you want to use default paint and have the path constructed for you, you can just pass a List of doubles[], each double[] representing a segment on the path, like so

ArrayList<double[]> home = new ArrayList<double[]>();
home.add( new double[] { 42.379676, -71.094919 } );
home.add( new double[] { 42.370000, -71.094919 } );
home.add( new double[] { 42.370000, -71.080000 } );
home.add( new double[] { 42.379676, -71.080000 } );     
tileView.drawPath( home );

The above would draw a square in the city of Boston. Obviously you'd want to use your own coordinates.

Post back if you need more help.

moagrius commented 11 years ago

@robonity did the sample code i provided help? can i close this issue?