Fix small issues
This commit is contained in:
parent
3dd8f3c501
commit
f28895a136
2 changed files with 9 additions and 7 deletions
|
@ -60,7 +60,8 @@ public class OsMoGroups implements OsMoReactor, OsmoTrackerListener {
|
||||||
private void connectDeviceImpl(OsMoDevice d) {
|
private void connectDeviceImpl(OsMoDevice d) {
|
||||||
d.enabled = true;
|
d.enabled = true;
|
||||||
d.active = true;
|
d.active = true;
|
||||||
if(!service.getMyGroupTrackerId().equals(d.getTrackerId())) {
|
String mid = service.getMyGroupTrackerId();
|
||||||
|
if(mid == null || !mid.equals(d.getTrackerId())) {
|
||||||
tracker.startTrackingId(d);
|
tracker.startTrackingId(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye
|
||||||
private Paint pointAltUI;
|
private Paint pointAltUI;
|
||||||
private Paint point;
|
private Paint point;
|
||||||
private OsMoPlugin plugin;
|
private OsMoPlugin plugin;
|
||||||
private final static float startZoom = 10;
|
private final static float startZoom = 7;
|
||||||
|
|
||||||
public OsMoPositionLayer(MapActivity map, OsMoPlugin plugin) {
|
public OsMoPositionLayer(MapActivity map, OsMoPlugin plugin) {
|
||||||
this.map = map;
|
this.map = map;
|
||||||
|
@ -55,9 +55,9 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye
|
||||||
pointAltUI.setStyle(Style.FILL);
|
pointAltUI.setStyle(Style.FILL);
|
||||||
|
|
||||||
point = new Paint();
|
point = new Paint();
|
||||||
point.setColor(Color.GRAY);
|
point.setColor(Color.DKGRAY);
|
||||||
point.setAntiAlias(true);
|
point.setAntiAlias(true);
|
||||||
point.setStyle(Style.STROKE);
|
point.setStyle(Style.FILL_AND_STROKE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<OsMoDevice> getTrackingDevices() {
|
public Collection<OsMoDevice> getTrackingDevices() {
|
||||||
|
@ -83,15 +83,16 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDraw(Canvas canvas, RotatedTileBox tb, DrawSettings nightMode) {
|
public void onDraw(Canvas canvas, RotatedTileBox tb, DrawSettings nightMode) {
|
||||||
final int r = getRadiusPoi(tb);
|
final int r = getRadiusPoi(tb) * 3 / 4;
|
||||||
for (OsMoDevice t : getTrackingDevices()) {
|
for (OsMoDevice t : getTrackingDevices()) {
|
||||||
Location l = t.getLastLocation();
|
Location l = t.getLastLocation();
|
||||||
if (l != null) {
|
if (l != null) {
|
||||||
int x = (int) tb.getPixXFromLatLon(l.getLatitude(), l.getLongitude());
|
int x = (int) tb.getPixXFromLatLon(l.getLatitude(), l.getLongitude());
|
||||||
int y = (int) tb.getPixYFromLatLon(l.getLatitude(), l.getLongitude());
|
int y = (int) tb.getPixYFromLatLon(l.getLatitude(), l.getLongitude());
|
||||||
|
|
||||||
pointAltUI.setColor(t.getColor());
|
pointAltUI.setColor(t.getColor());
|
||||||
canvas.drawCircle(x, y, r, pointAltUI);
|
canvas.drawCircle(x, y, r , point);
|
||||||
canvas.drawCircle(x, y, r, point);
|
canvas.drawCircle(x, y, r - 2, pointAltUI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue