forked from organicmaps/organicmaps
[android] Fixed bug with null location.
This commit is contained in:
parent
d0ccae4bf0
commit
799433aeb2
1 changed files with 8 additions and 6 deletions
|
@ -526,17 +526,19 @@ public class MapInfoView extends LinearLayout implements View.OnClickListener
|
|||
{
|
||||
if (mGeoLayout != null && mMapObject != null)
|
||||
{
|
||||
Location l = MWMApplication.get().getLocationService().getLastKnown();
|
||||
final DistanceAndAzimut distanceAndAzimuth = Framework.getDistanceAndAzimutFromLatLon(mMapObject.getLat(),
|
||||
mMapObject.getLon(), l.getLatitude(), l.getLongitude(), northAzimuth);
|
||||
if (distanceAndAzimuth.getAthimuth() > 0)
|
||||
final Location l = MWMApplication.get().getLocationService().getLastKnown();
|
||||
if (l != null)
|
||||
{
|
||||
mAvDirection.setAzimut(distanceAndAzimuth.getAthimuth());
|
||||
final DistanceAndAzimut da = Framework.getDistanceAndAzimutFromLatLon(
|
||||
mMapObject.getLat(), mMapObject.getLon(),
|
||||
l.getLatitude(), l.getLongitude(), northAzimuth);
|
||||
|
||||
if (da.getAthimuth() >= 0)
|
||||
mAvDirection.setAzimut(da.getAthimuth());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void fillPlacePagePoi(MapObject poi)
|
||||
{
|
||||
mPlacePageContainer.removeAllViews();
|
||||
|
|
Loading…
Add table
Reference in a new issue