开发者

point condition to be remove

If I 'm using GPS and adding some Over lay items in the map and i want to play a game when ever my current location is == to the over lay item then remove this item the problem is due to the gps inaccuracy i want to make a margin error around the over lay item so what i did is Since the P is the geo poi开发者_如何学JAVAnt of the overlay item

enter code here
   int error =10 ;
if (loc.getLatitude() * 1E6>=p.getLatitudeE6()-error&&loc.getLongitude() * 1E6 < p.getLatitudeE6()+error)
 mapView.getOverlays().remove(itemizedOverlay);
  mapView.invalidate();

so the question now is this if condition is true or what ??


Use LocationManager.addProximityAlert(double latitude, double longitude, float radius, long expiration, PendingIntent intent). The radius will be the distance you are to the POI.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜