Fix center location
This commit is contained in:
parent
23c8da8308
commit
e7be02565f
3 changed files with 6 additions and 6 deletions
|
@ -568,7 +568,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
|||
new PointDescription(PointDescription.POINT_TYPE_MARKER, device.getVisibleName()), false,
|
||||
device);
|
||||
}
|
||||
OsMoPositionLayer.setFollowTrackerId(device);
|
||||
OsMoPositionLayer.setFollowTrackerId(device, location);
|
||||
MapActivity.launchMapActivityMoveToTop(OsMoGroupsActivity.this);
|
||||
}
|
||||
} else if (item.getItemId() == ON_OFF_ACTION_ID) {
|
||||
|
|
|
@ -131,11 +131,12 @@ public class OsMoPlugin extends OsmandPlugin implements OsMoReactor {
|
|||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
|
||||
OsMoDevice o = (OsMoDevice) selectedObj;
|
||||
double lat = o.getLastLocation() == null ? latitude : o.getLastLocation().getLatitude();
|
||||
double lon = o.getLastLocation() == null ? longitude : o.getLastLocation().getLongitude();
|
||||
Location loc = o.getLastLocation();
|
||||
double lat = loc == null ? latitude : loc.getLatitude();
|
||||
double lon = loc == null ? longitude : loc.getLongitude();
|
||||
mapActivity.getMapView().setLatLon(lat, lon);
|
||||
MapActivity.getSingleMapViewTrackingUtilities().setMapLinkedToLocation(false);
|
||||
OsMoPositionLayer.setFollowTrackerId(o);
|
||||
OsMoPositionLayer.setFollowTrackerId(o, loc);
|
||||
return true;
|
||||
}
|
||||
}).position(0).reg();
|
||||
|
|
|
@ -297,10 +297,9 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye
|
|||
private static String followDestinationId;
|
||||
private static LatLon followTargetLocation;
|
||||
|
||||
public static void setFollowTrackerId(OsMoDevice d) {
|
||||
public static void setFollowTrackerId(OsMoDevice d, Location l) {
|
||||
if(d != null) {
|
||||
followTrackerId = d.trackerId;
|
||||
Location l = d.getLastLocation();
|
||||
if(l != null) {
|
||||
followMapLocation = new LatLon(l.getLatitude(), l.getLongitude());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue