here the boundaries of the markers are determined, but the route does not say anything about its position (((
the route is located not at one point, but at some borders "from and to".
Here is an example of how this can be reflected:
this block of code
{
// left
if(m.Position.Lng < left)
{
left = m.Position.Lng;
}
// top
if(m.Position.Lat > top)
{
top = m.Position.Lat;
}
// right
if(m.Position.Lng > right)
{
right = m.Position.Lng;
}
// bottom
if(m.Position.Lat < bottom)
{
bottom = m.Position.Lat;
}
}
replace with this block of code
{
double leftPosition, topPosition, rightPosition, bottomPosition;
if (m is GMapRoute)
{
GMapRoute routeMarker = m as GMapRoute;
leftPosition = routeMarker.Points.Min(p => p.Lng);
topPosition = routeMarker.Points.Max(p => p.Lat);
rightPosition = routeMarker.Points.Max(p => p.Lng);
bottomPosition = routeMarker.Points.Min(p => p.Lat);
}
else
{
leftPosition = m.Position.Lng;
topPosition = m.Position.Lat;
rightPosition = m.Position.Lng;
bottomPosition = m.Position.Lat;
}
// left
if (leftPosition < left)
{
left = leftPosition;
}
// top
if (topPosition > top)
{
top = topPosition;
}
// right
if (rightPosition > right)
{
right = rightPosition;
}
// bottom
if (bottomPosition < bottom)
{
bottom = bottomPosition;
}
}
without these specifications (if there is a route among the markers, then the map area does not reflect the real picture), the GetRectOfAllMarkers method does not work correctly, and for this reason the ZoomAndCenterRoute method
thanks bro
P.S.
Winform version processes route points directly without taking into account markers. that is, the situation is the opposite
https://github.com/radioman/greatmaps/blob/aebad7aa58f894ed93f2a07a7d41bf4b641f8793/GMap.NET.WindowsPresentation/GMap.NET.WindowsPresentation/GMapControl.cs#L1145
Here is an example of how this can be reflected: this block of code
replace with this block of code
without these specifications (if there is a route among the markers, then the map area does not reflect the real picture), the GetRectOfAllMarkers method does not work correctly, and for this reason the ZoomAndCenterRoute method
thanks bro
P.S. Winform version processes route points directly without taking into account markers. that is, the situation is the opposite