mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2025-02-21 23:21:08 +01:00
Maps: Properly handle invisible map items and impossible lines
Fixes #49
This commit is contained in:
parent
9870ba795f
commit
c618221a38
@ -38,6 +38,7 @@ import org.oscim.layers.marker.MarkerSymbol;
|
||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||
import org.oscim.layers.vector.geometries.Drawable;
|
||||
import org.oscim.map.Layers;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.map.Viewport;
|
||||
@ -171,7 +172,10 @@ public class BackendMap implements ItemizedLayer.OnItemGestureListener<MarkerIte
|
||||
private synchronized void updateDrawableLayer() {
|
||||
drawables.clear();
|
||||
for (DrawableMarkup markup : drawableMarkups) {
|
||||
drawables.add(markup.getDrawable(mapView.map()));
|
||||
Drawable drawable = markup.getDrawable(mapView.map());
|
||||
if (drawable != null) {
|
||||
drawables.add(drawable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,6 +148,10 @@ public class PolylineImpl extends IPolylineDelegate.Stub implements DrawableMark
|
||||
@Override
|
||||
public Drawable getDrawable(Map map) {
|
||||
if (!isVisible() || removed) return null;
|
||||
if (options.getPoints().size() < 2) {
|
||||
// You hardly draw a line with less than two points
|
||||
return null;
|
||||
}
|
||||
List<GeoPoint> points = new ArrayList<GeoPoint>();
|
||||
for (LatLng point : options.getPoints()) {
|
||||
points.add(GmsMapsTypeHelper.fromLatLng(point));
|
||||
|
Loading…
x
Reference in New Issue
Block a user