2013-07-20 82 views
0

不知道這裏發生了什麼,但我希望它隨着設備移動每秒鐘創造一個額外的圈子。它所做的只是讓1個圈子。我希望圈子突出顯示我採取的路線。建議?由於Android地圖api v2圈子

LocationManager locationmanager = (LocationManager) getSystemService(LOCATION_SERVICE); 
Criteria cr = new Criteria(); 
String provider = locationmanager.getBestProvider(cr, true); 
Location location = locationmanager.getLastKnownLocation(provider); 

locationmanager.requestLocationUpdates(provider, 1000, 0, (LocationListener) this); 




CircleOptions circleOptions = new CircleOptions() 
.center(new LatLng(location.getLatitude(), location.getLongitude())); 
circleOptions.radius(3.048); // In meters 


mMap.addCircle(circleOptions); 
+0

[android maps api v2 adding multiple circles]可能的重複(http://stackoverflow.com/questions/17766544/android-maps-api-v2-adding-multiple-circles) –

+0

沒搞清楚如何將修改的代碼放回問題中。 – johnsonjp34

+0

結帳這個庫:https://github.com/i-schuetz/map_areas – Ixx

回答

1

地說:

CircleOptions circleOptions = new CircleOptions() 
     .center(new LatLng(location.getLatitude(), location.getLongitude())); 
circleOptions.radius(3.048); // In meters 

mMap.addCircle(circleOptions); 

onLocationChanged(Location location)回調。

+0

感謝一堆它工作得很好! – johnsonjp34