java - Android - drawing path as overlay on MapView -


I have a class that extends overlays and overlap overlays. Acceptable I have overridden my Attention method:

  @ Override public zero draw (Canvas Canvas, Map Viv MV, Boolean Shadow) {projection projection = MV. F. Proogation (); ArrayList & LT; GeoPoint & gt; Geo Point = New Arrestist & lt; GeoPoint & gt; (); // Creating geopoints - ommited path for readability p = new path (); (Int i = 0; i & lt; geopoint.size (); i ++) {if (i == geoPoints.size () - 1) {break; } Point = new point (); = Point to new point (); launch. Toxic (geoPoints.get (i)); launch. Pixel (from geoPoints.get (i + 1)); P.moveTo (from.x, from.y); P.lineTo (to.x, to.y); } Paint mPaint = new paint (); MPaint.setStyle (Style.FILL); MPaint.setColor (0xFFFF0000); MPaint.setAntiAlias ​​(right); Canvas leftpath (P, M. Pint); Super.draw (canvas, mv, shadow); }  

As you can see, I make a list of points on the map and I want them to make a polygon shape.

Now, the problem is that when I set the paint style for fill or fil_stuff, nothing appears on the screen, but when I set it to stroke, and set the stroke width , Then draws it properly that it is supposed to attract.

Now, I looked for the solution, but nothing comes, can you tell me whether I am missing something to set myself in the code or while drawing overlay canvas Are there some types of obstacles?

Thanks

some things you need to do p.moveTo (from.x , From.y) should be used; This is the only time that, for the first time you want to do it for the first time.

Try this to set the properties for the paint object used to illustrate the polygon

  polygraph = new paint ( ); PolygonPaint.setStrokeWidth (2); PolygonPaint.setStyle (Paint.Style.STROKE); PolygonPaint.setAntiAlias ​​(true);  

Hope this helps


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -