- Home
- Forum
- Xamarin.Forms
- ZoomLevelChanging problem
ZoomLevelChanging problem
Hi,
I have a SfMap with an OSM ImageryLayer with the MinZoom property set to 6, i don't want the user to zoom out further.
If you keep zooming out while at this ZoomLevel (6), the ZoomLevelChangingEventArgs.CurrentLevel of the ZoomLevelChanging event keep going down even tho the MinZoom is 6.
This cause a problem when the user then try to zoom in, it cause a flashing visual glitch where the map is not really zooming in until the ZoomLevelChangingEventArgs.CurrentLevel reach 6 or higher.
Can you fix the CurrentLevel property of ZoomLevelChangingEventArgs so it doesn't go lower than the MinZoom property?
Thanks
SIGN IN To post a reply.
6 Replies
RA
Rachel A
Syncfusion Team
August 2, 2019 12:29 PM UTC
Hi Nicholas,
Greetings from Syncfusion.
We would like to inform you that the MinZoom and MaxZoom properties are supported only for ShapeFileLayer. We can achieve the requirement by cancelling the zooming based on CurrentLevel argument value in ZoomLevelChanging Event in ImageryLayer as per the below snippet
[XAML]:
|
<Grid x:Name="MainGrid" BackgroundColor="White">
<maps:SfMaps x:Name="Maps"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
ZoomLevel="6">
<maps:SfMaps.Layers>
<maps:ImageryLayer x:Name="MapsLayer"
LayerType="OSM"
ZoomLevelChanging="MapsLayer_ZoomLevelChanging">
</maps:ImageryLayer>
</maps:SfMaps.Layers>
</maps:SfMaps>
</Grid> |
[C#]:
|
private void MapsLayer_ZoomLevelChanging(object sender, ZoomLevelChangingEventArgs e)
{
if (e.CurrentLevel < 6)
{
e.Cancel = true;
}
} |
Please find the sample from the below link.
Note: We are facing issue when the cancelling the zoom the CurrentLevel event argument value is not updated properly. So, we will fix this issue and move the fix in our next weekly Nuget which is scheduled to be released on 13th August 2019.
Please let us know if you have any other queries.
Regards,
Rachel.
RA
Rachel A
Syncfusion Team
August 14, 2019 03:39 AM UTC
Hi Nicholas,
We are glad to announce that our weekly NuGet was rolled out today and fix for the reported issue was included in the weekly NuGet.
NuGet Version: 17.2.0.41
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
NuGet Version: 17.2.0.41
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Thanks,
Rachel.
JL
James Lavery
January 7, 2020 08:50 PM UTC
I have just tried this solution, using SfMaps version 17.4.0.40, and it is not working. Is there still a problem with the e.Cancel not updating the CurrentLevel?
James
VR
Vignesh Ramesh
Syncfusion Team
January 8, 2020 09:47 AM UTC
Hi James,
We have prepared a simple SfMaps sample with the solution that we have provided in our earlier and checked the reported problem. But we afraid that, we are not able to reproduce the reported problem in our side. Can you please check with the sample and video in the following location?
So, we suspect that the NuGet cache wat not properly cleared, this may be the reason for the reported problem. Please check by clearing the NuGet cache by using the instruction given in the following link.
If still you face the problem, please provide the issue reproducing sample. This would be helpful for us to give better solution in this.
We have tested with the below configuration.
In UWP:
OS: Windows 10
OS: Windows 10
Windows Version: 1903
In Android:
Simulator: Nexus 5X
API Version: 27
In iOS:
Simulator: iPhone 11 – 13.0
Simulator: iPhone 11 – 13.0
XCode Version: 11.0
Visual Studio version: 2019 Version: 8.3.3 (build 8)
Visual studio version: Professional 2019, V16.3.3
Syncfusion Version: 17.4.0.40 & 17.4.0.41
Regards,
Vignesh.
JL
James Lavery
February 16, 2020 11:37 AM UTC
Thanks - I've managed to get it working now, with the help of your sample.
RS
Ramya Soundar Rajan
Syncfusion Team
February 17, 2020 06:14 AM UTC
Hi James Lavery,
Thanks for your update. We are glad to hear that our given solution works.
Please let us know if you need any further assistance.
Regards,
Ramya
SIGN IN To post a reply.
- 6 Replies
- 5 Participants
-
NF NICHOLAS FORTIER
- Aug 1, 2019 07:35 PM UTC
- Feb 17, 2020 06:14 AM UTC