We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ZoomLevel and GeoCoordinates bindable?

Thread ID:

Created:

Updated:

Platform:

Replies:

145337 Jun 18,2019 07:22 AM UTC Jun 19,2019 01:33 PM UTC Xamarin.Forms 1
loading
Tags: SfMaps
James Lavery
Asked On June 18, 2019 07:22 AM UTC

I want to save the current ZoomLevel and GeoCoordinates, so that the next time the app is started the map displays the area the user was last viewing.

When I try binding these properties, the map does not display. Are they bindable? If not, how can I retrieve them?

Regards,

James

Rachel A [Syncfusion]
Replied On June 19, 2019 01:33 PM UTC

Hi James, 
 
Thanks for your interest in Syncfusion products. 
 
ZoomLevel and GeoCoordinates properties are bindable properties but does not provide two-way binding. Instead, you can get the current ZoomLevel from the ZoomLevelChanging event’s argument of e.CurrentLevel and get the current GeoCoordinates from the GeoCoordinateChanged event’s arguments of e.Center as like the below code snippet. 
 
[XAML] 
 
 
   <maps:ImageryLayer LayerType="OSM" 
                      GeoCoordinateChanged="ImageryLayer_GeoCoordinateChanged" 
                      ZoomLevelChanging="ImageryLayer_ZoomLevelChanging"/> 
 
 
C#: 
 
 
  private void ImageryLayer_GeoCoordinateChanged(object sender, Syncfusion.SfMaps.XForms.GeoCoordinateChangedEventArgs e) 
        { 
            geoPoints.Text = e.Center.X.ToString() + "," + e.Center.Y.ToString(); 
        } 
 
        private void ImageryLayer_ZoomLevelChanging(object sender, Syncfusion.SfMaps.XForms.ZoomLevelChangingEventArgs e) 
        { 
            resetZoom.Text = e.CurrentLevel.ToString(); 
        } 
 
 
 
We have prepared the sample for your reference. Please find the sample from the following location. 
 
 
Please refer the UG link for more information about this. 
 
 
Thanks, 
Rachel. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon