diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AMapLayer.java b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AMapLayer.java index 79f82d97bc..8ab1b0ee26 100644 --- a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AMapLayer.java +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AMapLayer.java @@ -16,6 +16,14 @@ public class AMapLayer implements Parcelable { private float zOrder = 5.5f; private Map points = new ConcurrentHashMap<>(); + private boolean imagePoints = false; + private int circlePointMinZoom = 0; + private int circlePointMaxZoom = 6; + private int smallPointMinZoom = 7; + private int smallPointMaxZoom = 13; + private int bigPointMinZoom = 14; + private int bigPointMaxZoom = 22; + public AMapLayer(String id, String name, float zOrder, List pointList) { this.id = id; this.name = name; @@ -70,11 +78,74 @@ public class AMapLayer implements Parcelable { points.remove(pointId); } + public boolean isImagePoints() { + return imagePoints; + } + + public void setImagePoints(boolean imagePoints) { + this.imagePoints = imagePoints; + } + + public void copyZoomBounds(AMapLayer layer) { + circlePointMinZoom = layer.circlePointMinZoom; + circlePointMaxZoom = layer.circlePointMaxZoom; + smallPointMinZoom = layer.smallPointMinZoom; + smallPointMaxZoom = layer.smallPointMaxZoom; + bigPointMinZoom = layer.bigPointMinZoom; + bigPointMaxZoom = layer.bigPointMaxZoom; + } + + public void setCirclePointZoomBounds(int min, int max) { + circlePointMinZoom = min; + circlePointMaxZoom = max; + } + + public void setSmallPointZoomBounds(int min, int max) { + smallPointMinZoom = min; + smallPointMaxZoom = max; + } + + public void setBigPointZoomBounds(int min, int max) { + bigPointMinZoom = min; + bigPointMaxZoom = max; + } + + public int getCirclePointMinZoom() { + return circlePointMinZoom; + } + + public int getCirclePointMaxZoom() { + return circlePointMaxZoom; + } + + public int getSmallPointMinZoom() { + return smallPointMinZoom; + } + + public int getSmallPointMaxZoom() { + return smallPointMaxZoom; + } + + public int getBigPointMinZoom() { + return bigPointMinZoom; + } + + public int getBigPointMaxZoom() { + return bigPointMaxZoom; + } + public void writeToParcel(Parcel out, int flags) { out.writeString(id); out.writeString(name); out.writeFloat(zOrder); out.writeTypedList(new ArrayList<>(points.values())); + out.writeByte((byte) (imagePoints ? 1 : 0)); + out.writeInt(circlePointMinZoom); + out.writeInt(circlePointMaxZoom); + out.writeInt(smallPointMinZoom); + out.writeInt(smallPointMaxZoom); + out.writeInt(bigPointMinZoom); + out.writeInt(bigPointMaxZoom); } private void readFromParcel(Parcel in) { @@ -86,6 +157,13 @@ public class AMapLayer implements Parcelable { for (AMapPoint p : pointList) { this.points.put(p.getId(), p); } + imagePoints = in.readByte() == 1; + circlePointMinZoom = in.readInt(); + circlePointMaxZoom = in.readInt(); + smallPointMinZoom = in.readInt(); + smallPointMaxZoom = in.readInt(); + bigPointMinZoom = in.readInt(); + bigPointMaxZoom = in.readInt(); } public int describeContents() { diff --git a/OsmAnd-telegram/src/net/osmand/telegram/helpers/OsmandAidlHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/OsmandAidlHelper.kt index 63fb92b18f..e3d8fec7ef 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/helpers/OsmandAidlHelper.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/helpers/OsmandAidlHelper.kt @@ -474,6 +474,7 @@ class OsmandAidlHelper(private val app: Application) { if (mIOsmAndAidlInterface != null) { try { val layer = AMapLayer(id, name, zOrder, points) + layer.isImagePoints = true return mIOsmAndAidlInterface!!.addMapLayer(AddMapLayerParams(layer)) } catch (e: RemoteException) { e.printStackTrace() @@ -495,6 +496,7 @@ class OsmandAidlHelper(private val app: Application) { if (mIOsmAndAidlInterface != null) { try { val layer = AMapLayer(id, name, zOrder, points) + layer.isImagePoints = true return mIOsmAndAidlInterface!!.updateMapLayer(UpdateMapLayerParams(layer)) } catch (e: RemoteException) { e.printStackTrace()