I want to do the following and are stuck on these for a few days:
-
I was trying to attract polythene (I have encoded polylines, but have managed to decode them) When I take the map Strong>. The only solution I found is that Geopoints will be converted into screen coordinates ... which I will not do to move the map.
-
To add about 150 markers and it gets very slow .
Any idea what to do? I was thinking about the thread (handler). -
I have been using a type of timer function for a function from time to time , say, every 1 minute or so Even more.
-
I was also looking for ways to clear Google Maps from all markers / lines , etc.
Answer below:
1 ) Here's a solution I've used:
/ ** is when the activity has been created earlier. * / Private list & amp; Overlay & gt; MapOverlays; Private projection projection; Override public null on @reate (bundle saved instainstate) {super.naught (savedinstenstate); SetContentView (R.layout.main); LinearLayout = (linear timer) findViewById (R.id.zoomview); MapView = (map view) ViewById (R.id.mapview); MapView.setBuiltInZoomControls (true); Mapoverre = Mapweivate Overlay (); Projection = mapView.getProjection (); MapOverlays.add (new MyOverlay ()); } @ Override protected boolean is the path (return); } Class MyOverlay overlays {public MyOverlay () {} Public zero-less (Canvas canvas, map map, Boolean shadow) {super.draw (canvas, map, shadow); Paint mPaint = new paint (); MPaint.setDither (true); MPaint.setColor (Color.RED); MPaint.setStyle (Paint.Style.FILL_AND_STROKE); MPaint.setStrokeJoin (Paint.Join.ROUND); MPaint.setStrokeCap (Paint.Cap.ROUND); MPaint.setStrokeWidth (2); Geopoint GP1 = new geopoint (19240000, -99120000); Geopoint GP2 = new geographic (37423157, -122085008); Point p1 = new point (); Point P2 = New Point (); Path path = new path (); Launch projection Pixel (gp1, p1); launch. Two pixels (GP2, P2); Path.moveTo (p2.x, p2.y); Path.lineTo (p1.x, p1.y); Canvas navepath (route, MP); }
courtesy:
2) What has been done for me here:
createMarkers () {for: BigList) {Geopoint geographical = new geographic (int) (elem.getLat () * 1000000, (int) (elem.getLon (* * 1000000)); Overlayite overlayem = new overlay etam (Bhuooin, elem.getName (), elem.getData ()); ItemizedOverlay.addOverlay (overlayItem); } ItemizedOverlay.populateNow (); MapOverlays.add (itemizedOverlay); // for the outside loop}
and in MyOverlay:
Public Zero addOverlay (overlayover overlay) {m_overlays.add (overlay); } Public Zero populateNow () {populate (); }
courtesy: stackoverflow.com unknown link
3) Using the timer class best way.
4) I used this code:
if (! Map overlay. IEETT) {mapOverlays.clear (); MapView.invalidate (); }
Hope these answers help at least one other person. Thank you.
Comments
Post a Comment