Some messing around + Googling, and this bit of code does the trick for me.
Hope this is helpful to someone else.
As a side note - this would be a nice thing to integrate into the RadMap control...
01.
Protected
Sub
setMap(MappedNames
As
List(Of GeocodedAddress), map
As
RadMap)
02.
03.
Dim
mapWidth
As
Integer
= 1050
04.
Dim
paddingFactor
As
Double
= 1.2
05.
06.
Dim
minY
As
Double
= MappedNames.Min(
Function
(x) x.Latitude)
07.
Dim
maxY
As
Double
= MappedNames.Max(
Function
(x) x.Latitude)
08.
Dim
minX
As
Double
= MappedNames.Min(
Function
(x) x.Longitude)
09.
Dim
maxX
As
Double
= MappedNames.Max(
Function
(x) x.Longitude)
10.
Dim
centerY
As
Double
= (minY + maxY) / 2
11.
Dim
centerX
As
Double
= (minX + maxX) / 2
12.
13.
Dim
minRadianY
As
Double
= Math.Log((Math.Sin(Degree2Radian(minY)) + 1) / Math.Cos(Degree2Radian(minY)))
14.
Dim
maxRadianY
As
Double
= Math.Log((Math.Sin(Degree2Radian(maxY)) + 1) / Math.Cos(Degree2Radian(maxY)))
15.
Dim
centerRadianY
As
Double
= (minRadianY + maxRadianY) / 2
16.
centerY = Radian2Degree(Math.Atan(Math.Sinh(centerRadianY)))
17.
18.
Dim
deltaX
As
Double
= maxX - minX
19.
Dim
resolutionX
As
Double
= deltaX / mapWidth
20.
21.
Dim
vy0
As
Double
= Math.Log(Math.Tan(Math.PI * (0.25 + centerY / 360)))
22.
Dim
vy1
As
Double
= Math.Log(Math.Tan(Math.PI * (0.25 + maxY / 360)))
23.
Dim
viewHeightHalf
As
Double
= map.Height.Value / 2
24.
Dim
zoomFactorPowered
As
Double
= viewHeightHalf / (40.7436654315252 * (vy1 - vy0))
25.
Dim
resolutionY
As
Double
= 360.0 / (zoomFactorPowered * 256)
26.
27.
Dim
resolution
As
Double
= Math.Max(resolutionX, resolutionY) * paddingFactor
28.
Dim
zoom
As
Double
= Math.Log(360 / (resolution * 256), 2)
29.
30.
map.Zoom = Math.Floor(zoom)
31.
map.CenterSettings.Latitude = centerY
32.
map.CenterSettings.Longitude = centerX
33.
34.
End
Sub