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,
Thanks for the help.I've tried this with my control and I'm not getting any zoom.I might have a unique situation where all 3 points that I'm plotting are all at the same location (same lat/long)
Here is what I have
var minLongitude = route.Min(x => x.Geocode.DoubleLongitude); var maxLongitude = route.Max(x => x.Geocode.DoubleLongitude); var minLatitude = route.Min(x => x.Geocode.DoubleLatitude); var maxLatitude = route.Max(x => x.Geocode.DoubleLatitude); var northWestPoint = new Infragistics.Win.DataVisualization.Point(minLongitude, minLatitude); var southEastPoint = new Infragistics.Win.DataVisualization.Point(maxLongitude, maxLatitude); // use the GetZoomFromGeographic method to generate a new WindowRect var rect = this.ultraGeographicMap1.GetZoomFromGeographic(northWestPoint, southEastPoint); this.ultraGeographicMap1.WindowRect = rect;
The values I'm getting are:
Thanks,-James
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 JainAssociate Software Developer