How to detemine min and max visible latitude and longitude

Hello,

I'm using the SFMaps component.
I understand how to set the MapsCenterPosition and ZoomSettings in order to position the map.
But I need a way to get the minimum and maximum visible latitude and longitude each time the map is (a) loaded, (b) panned, or (c) zoomed



I tried searching the MapsEvents, but I can't find anything.


8 Replies

IR Indumathi Ravi Syncfusion Team August 16, 2021 11:15 AM UTC

Hi Sorin, 
  
Thank you for contacting Syncfusion Support. 
  
Currently, we do not have support to provide the minimum and maximum values of latitude and longitude coordinates. So, we will analyze the feasibility for your requirement in the Maps component and update you with further details on August 18, 2021. 
  
Regards, 
Indumathi R 



IR Indumathi Ravi Syncfusion Team August 19, 2021 12:58 PM UTC

Hi Sorin, 
  
Currently we do not have support for providing minimum and maximum values of latitude and longitude coordinates in the events of the Maps component. We have considered this requirement as a feature and added it to our features request list. We will include this implementation in any of our upcoming releases. Meanwhile, please find the below feedback link to keep track of this feature. 
  
  
Regards, 
Indumathi R. 



SO Sorin September 8, 2021 10:39 AM UTC

Hello Indumathi,

Thank you for your reply.
I think this would be a necessary feature for any serious map application.
For example, google maps Javascript API supports this function: https://developers.google.com/maps/documentation/javascript/reference/map#Map.getBounds

Also, this need comes up for example on StackOverflow even 10 years ago: https://stackoverflow.com/questions/6910847/get-boundaries-longitude-and-latitude-from-current-zoom-google-maps

Thanks,
Sorin



IR Indumathi Ravi Syncfusion Team September 9, 2021 07:11 PM UTC

  
Hi Sorin,

Thank you for the update.

We will consider your feature request for analysis when we shortlist the features for our 2021 Volume 4 release. We usually consider the features that adds more value to the product and customer usage. This feature may or may not be available in 2021 volume 4 release. But we assure you that this feature will be available in any of our upcoming releases. Please follow the below feedback link to keep track of this feature.

https://www.syncfusion.com/feedback/28030

Regards,
Indumathi R



IR Indumathi Ravi Syncfusion Team December 21, 2021 06:12 PM UTC

Hi Sorin, 
We are unable to implement the support - "Provide minimum and maximum values of latitude and longitude coordinates as event arguments" in our 2021 Volume 4 release. However, the feature will be available in our 2022 Volume 1 release which is expected to be available by March 2022. Please follow the previously provided feedback link to keep track of the feature. 
Sorry for the inconvenience caused. 
Regards, 
Indumathi R 



IR Indumathi Ravi Syncfusion Team April 5, 2022 06:24 PM UTC

Hi Sorin,


We have implemented the feature “Provide minimum and maximum values of latitude and longitude coordinates as event arguments” in the Maps component and the fix is included in our Essential Studio 2022 Volume 1 Main release v20.1.0.47 which is rolled out and is available for download under the following link.


Essential Studio 2022 Volume 1 Main Release v20.1.0.47 is available for download | Announcements Forums | Syncfusion


The minimum and maximum values of the latitude and the longitude is now available in the event arguments of “Loaded”, “OnPan”, “OnZoom” and “OnZoomComplete” events with the properties such as “MaxLatitude”, “MinLatitude”, “MaxLongitude” and “MinLongitude”. Please find the code snippet below.


Code Snippet:

<SfMaps>

    <MapsZoomSettings Enable="true" EnablePanning="true"></MapsZoomSettings>

    <MapsEvents Loaded ="Loaded" OnZoom="Zoom" OnPan="Pan" OnZoomComplete="ZoomComplete"></MapsEvents>

    <MapsLayers>

        <MapsLayer ShapeData='new {dataOptions= https://cdn.syncfusion.com/maps/map-data/world-map.json}' TValue="string">

        </MapsLayer>

    </MapsLayers>

</SfMaps>

 

<div> MaxLatitude   =  @MaxLatitude   </div>

<div> MinLatitude   =  @MinLatitude   </div>

<div> MaxLongitude  =  @MaxLongitude  </div>

<div> MinLongitude  =  @MinLongitude  </div>

 

@code{

 

    public double MaxLatitude { get; set; }

    public double MinLatitude { get; set; }

    public double MaxLongitude { get; set; }

    public double MinLongitude { get; set; }

 

    public void Loaded(LoadedEventArgs args)

    {

        MaxLatitude = args.MaxLatitude;

        MinLatitude = args.MinLatitude;

        MaxLongitude = args.MaxLongitude;

        MinLongitude = args.MinLongitude;

    }

 

    public void Zoom(MapZoomEventArgs args)

    {

        MaxLatitude = args.MaxLatitude;

        MinLatitude = args.MinLatitude;

        MaxLongitude = args.MaxLongitude;

        MinLongitude = args.MinLongitude;

    }

 

    public void Pan(MapPanEventArgs args)

    {

        MaxLatitude = args.MaxLatitude;

        MinLatitude = args.MinLatitude;

        MaxLongitude = args.MaxLongitude;

        MinLongitude = args.MinLongitude;

    }

 

    public void ZoomComplete(MapZoomEventArgs args)

    {

        MaxLatitude = args.MaxLatitude;

        MinLatitude = args.MinLatitude;

        MaxLongitude = args.MaxLongitude;

        MinLongitude = args.MinLongitude;

    }

}


We have created a sample application to demonstrate the same and it can be downloaded from the below link.

https://www.syncfusion.com/downloads/support/directtrac/general/ze/MapsMinMax-103201391


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.


Regards,

Indumathi R



SO Sorin June 23, 2022 11:34 AM UTC

Wow, thank you so much Indumathi, this is great news and will be very helpful!



IR Indumathi Ravi Syncfusion Team June 24, 2022 12:55 PM UTC

Hi Sorin,

 

Most Welcome.

 

Please get back to us if you need any further assistance.

 

Regards,

Indumathi R.


Loader.
Up arrow icon