There are a couple of options, depending on your definition of min/max coordinates. Number min/max or minimal bounding box min/max values (can cross anti-meridian). For number min/max you can loop through the locations can calculate these values. Here is a code block that returns an array of numbers in the form of a GeoJSON bounding box [minLon, minLat, maxLon, maxLat]
function getExtents(locations) {
if(locations && locations.length > 0){
var minLat = 90
var maxLat = -90;
var minLon = 180;
var maxLon = -180;
for(var i = 0, len = locations.length; i < len; i++){
var lat = locaitons[i].latitude;
var lon = locaitons[i].longitude;
if(lat < minLat) {
minLat = lat;
}
if(lat > maxLat) {
maxLat = lat;
}
if(lon < minLon) {
minLon = lon;
}
if(lon > maxLon) {
maxLon = lon;
}
}
return [minLon, minLat, maxLon, maxLat];
}
return null;
}
For getting the minimal bounding box you can use the LocationRect class. It has two useful functions for your scenario, one that takes in an array of coordinates, and one that takes in an array of shapes.
var bbox = Microsoft.Maps.LocationRect.fromLocations([/*your locations*/]);
var bbox = Microsoft.Maps.LocationRect.fromShapes([/*your shapes*/]);
Docs for this class can be found here: https://learn.microsoft.com/en-us/bingmaps/v8-web-control/map-control-api/locationrect-class