Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
UltraGeographicMap Zoom to GeographicSymbolSeries
posted

I'm trying to use the ultraGeographicMap. I'm plotting points, as follows:

            var series = new GeographicSymbolSeries();
            series.LongitudeMemberPath = "X";
            series.LatitudeMemberPath = "Y";
            var geoLocations = new List<Infragistics.Win.DataVisualization.Point>();

            foreach (var point in route)
            {
                geoLocations.Add(new Infragistics.Win.DataVisualization.Point() { X = point.Geocode.DoubleLongitude, Y = point.Geocode.DoubleLatitude });
            }

            series.DataSource = geoLocations;
            this.ultraGeographicMap1.Series.Add(series);

            var geoRegion = new Infragistics.Win.DataVisualization.Rectangle(route.FirstOrDefault().Geocode.DoubleLongitude, route.FirstOrDefault().Geocode.DoubleLatitude, 30, 20);
            this.ultraGeographicMap1.WindowRect = this.ultraGeographicMap1.GetZoomFromGeographic(geoRegion);

Is there a way to zoom to the GeographicSymbolSeries that is being plotted?

Thanks,

Parents
  • 7595
    Offline posted

    Hello James,

    Thank you for posing. Unfortunately, there is no zoom to functionality when it comes to a series. If you are manually providing points to the series then you should be able to calculate the min/max longitude and latitude from all those points and with the min/max you can update the maps WindowRect to encompass that rectangle , which is you you already doing and your code is looking correct to me .

    Try some like this:

    // calculate the min/max longitude and latitudes 
    var minLongitude = GetMinLongitude();
    var maxLongitude = GetMaxLongitude();
    var minLatitude = GetMinLatitude();
    var maxLatitude = GetMaxLatitude();
    
    // use the GetZoomFromGeographic method to generate a new WindowRect
    var rect = this.geoMap.GetZoomFromGeographic(new Point(minLongitude, minLatitude), new Point(maxLongitude, maxLatitude));
    this.geoMap.WindowRect = rect;

    if this dosent work please share your sample to investigate it further.

    Sincerely,
    Divya Jain
    Associate Software Developer

Reply Children
No Data