Zoom Level at Higher DPI

I have a small demo in which I set the a default lat/long and zoom level. If I run it on a regular monitor at 96 dpi, Canada seems to fit nicely within the map. If I run it on a 4k monitor at 200% 192 dpi (or drag it onto the 4k screen) the map is zoomed out too much (not the same level as on the 100% 96 dpi monitor).


<DELPHI>
const
  CenterCanadaLatitude = 61;
  CenterCanadaLongitude = -96.302713;

procedure TForm15.Button1Click(Sender: TObject);
begin
  WebGMaps1.APIKey := <YOUR API KEY>;
  WebGMaps1.AutoLaunch := False;

  // Default to the center of Canada
  WebGMaps1.MapOptions.DefaultLatitude := CenterCanadaLatitude;
  WebGMaps1.MapOptions.DefaultLongitude := CenterCanadaLongitude;

  WebGMaps1.MapOptions.ZoomMap := 3;
  WebGMaps1.Launch;
end;

</DELPHI>

How can I get around this, or how can I get the correct zoom level for the high DPI monitor>

I've emailed TMS my demo. 


If you happen to know the outer bounds of Canada (or whatever you want to zoom to), you can zoom to the bounds with:

WebGMapBounds.NorthEast.Latitude  := 11.23;
WebGMapBounds.NorthEast.Longitude :=2.2;
WebGMapBounds.SouthWest.Latitude  := 3.1;
WebGMapBounds.SouthWest.Longitude := 4.0;
WebGMap.MapZoomTo(WebGMapBounds)

This should be independent from the DPI of your monitor and size of the map.

Thanks for the suggestion. However, even with using MapZoomTo, upon dragging onto a higher DPI monitor, the issue persists (Zoom is far too much out).


The fact that the code I posted behaves differently depending on which monitor it is displayed is problematic (the zoom shouldn't change, what I see on the map should basically be the same on both monitors).

Hi,


Please note that this is a limitation of the TWebBrowser component which the TWebGMaps is based on.
Unfortunately we are not aware of a possible fix or workaround at this time.
We'll have to investigate this as soon as we have been able allocate sufficient development time.

Thanks Bart.


Looking forward to a work around.