Topic: zoom and CameraUpdate
Good evening.
I need to limit the radius of the map. I inserted my code into your scripts. Now I fix bugs, but it's too difficult, I kind of did everything you need, but it does not work.
It is necessary that the phone has a smooth zoom between 12-19 zoom to the limit of 12 did not go this smooth zoom. Really?
If the scale is < 15, you must set the center of the map to the center of the user around which the radius is. You can only move around the map when you zoom in > 15 and only to the radius boundaries.
The problem is that I don't understand how to limit the smooth scaling to not < 12.
Also, you cannot force the map to set its position during scaling. When I do the fingers the zoom is less than 15, the map should be centered in the user, but this is not happening and position of the card outside of the radius, probably because the method is "UpdateGestureZoom" and "CameraUpdatePosition" do not work at the same time, called "CameraUpdatePosition" in "UpdateGestureZoom" did not give an adequate result.
Please tell me how you can correctly enter it into your plugin?
public bool SetPositionCameraByCircleBorder(double px, double py) {
Vector2 p1 = this.GetPositionPlayerInMeters();
Vector2 p2 = this.GetPositionMapInMeters((float)px, (float)py);
float angle = OnlineMapsUtils.Angle2D(p1, p2);
angle += 90;
float distance = OnlineMapsUtils.DistanceBetweenPointsF(
new Vector2(this.posUser.x, this.posUser.y),
new Vector2((float)px, (float)py)
);
float radius = MyCode.JourneyObject.instance.drawRadiusMapForFog.radiusInKM;
if (radius < distance) {
OnlineMapsUtils.GetCoordinateInDistance(
this.posUser.x, this.posUser.y,
radius,
angle,
out double nlon, out double nlat
);
map.SetPosition(nlon, nlat);
return true;
}
return false;
}