Forum Xamarin Xamarin.Forms

Xam.Forms.Maps - Zoom level or Similar

I am developing a system for IOS with maps using the "Xamarin.Forms.Maps".

This system contains massive pins (~ 34k), the problem is that the performance is extremely slow when Zoom out which visualize all. When zooming in and points decrease over the viewing area performance improves.

Question, it is possible as well as on Google Maps to get the points only appear when you are near the well far.

f you do not have it, someone suggests an idea to improve performance?

Best Answer

Answers

  • RafaelMouraRafaelMoura BRInsider, University, Developer Group Leader ✭✭✭
    Accepted Answer

    Hey @LUISFERNANDOANDRADE

    For this u need implement one new function at map :(

    After user movement map, u call a method do get pins nearby center point :)

    About map, see my component

    https://www.nuget.org/packages/Xam.Plugin.MapExtend/1.2.0

  • Thanks for your help, your component is serving a lot of help.

    Now my only problem I'm discouraged about finding a solution is to add a Click event to each of the Pins.

    I was looking for and found many people with this problem and one possible does not support this.

    That was the way I found (her help with component) to show just a few Pins, since they display all the application is too heavy.

        btnNearbyLocation.Clicked += async (sender, args) => {
                    List<Model.Point> lPoint = obj.ListAll ();
                    List<Pin> Pins = new List<Pin> ();
                    var ZoomDistance = map.VisibleRegion;
                    var Radius = ZoomDistance.Radius;
                    if (lPoint.Count != 0) {
                        foreach (var item in lPoint) {
                            var posPoint = new Position (Convert.ToDouble (item.Y), Convert.ToDouble (item.X));
                            var posMy = new Position (Convert.ToDouble (mPos.Latitude), Convert.ToDouble (mPos.Longitude));
                            double Dist = map.GetDistance (posMy, posPoint, 'K');
                            if (Dist <= Radius.Kilometers && Dist < 300) {
                                var pin = new Pin () {
                                    Position = posPoint,
                                    Label = item.Id.ToString (), Type = PinType.SavedPin
                                };
                                Pins.Add (pin); 
                            }
                        }   
                    }
                    if (Pins.Count != 0) {
                        foreach (var item in Pins) {
                            map.Pins.Add (item);
                        }
                    }
                };
    
  • This is the point where I'm standing, the event simply does not fire


  • _Jai_Jai USMember ✭✭

    I want to show the center point of view in map with its alignment how can i do that.? I got the center points

Sign In or Register to comment.