Skip to content

Commit

Permalink
Fixes [BUG] Map not responding to span (zoom) requests in Windows #1686
Browse files Browse the repository at this point in the history
… (#2323)
  • Loading branch information
mikelor authored Nov 7, 2024
1 parent 341c4c4 commit 63c0618
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ protected override void DisconnectHandler(FrameworkElement platformView)
mapHandler.regionToGo = newRegion;
}

CallJSMethod(handler.PlatformView, $"setRegion({newRegion.Center.Latitude.ToString(CultureInfo.InvariantCulture)},{newRegion.Center.Longitude.ToString(CultureInfo.InvariantCulture)});");
CallJSMethod(handler.PlatformView, $"setRegion({newRegion.Center.Latitude.ToString(CultureInfo.InvariantCulture)},{newRegion.Center.Longitude.ToString(CultureInfo.InvariantCulture)},{newRegion.LatitudeDegrees.ToString(CultureInfo.InvariantCulture)},{newRegion.LongitudeDegrees.ToString(CultureInfo.InvariantCulture)});");
}

static void CallJSMethod(FrameworkElement platformWebView, string script)
Expand Down Expand Up @@ -290,11 +290,9 @@ function setMapType(mauiMapType)
});
}
function setRegion(latitude, longitude)
function setRegion(latitude, longitude, latitudeDegrees, longitudeDegrees)
{
map.setView({
center: new Microsoft.Maps.Location(latitude, longitude),
});
map.setView({bounds: new Microsoft.Maps.LocationRect(new Microsoft.Maps.Location(latitude, longitude), latitudeDegrees, longitudeDegrees) });
}
function addLocationPin(latitude, longitude)
Expand Down

0 comments on commit 63c0618

Please sign in to comment.