WebOSMaps: GetMapCenter()

Hi,

is there a similar functionality like WebGMaps.GetMapCenter() for WebOSMaps?
I cannot find anything though...

Hi,


Unfortunately this functionality is only available in WebGMaps.
This is a limitation of the OpenLayers API which the WebOSMaps is based on.
I know that there isn't a direct way to get this from OSM via Javascript, but this could be easily calculated with vector addition using the bounds, that are known or could be retrieved:

  WebOSMaps.GetMapBounds; //fills OSMapBounds in WebOSMapsBoundsRetrieved()
  OSMapCenter.Longitude := (OSMapBounds.SouthWest.Longitude + OSMapBounds.NorthEast.Longitude) / 2;
  OSMapCenter.Latitude  := (OSMapBounds.SouthWest.Latitude  + OSMapBounds.NorthEast.Latitude)  / 2;

It would be nice to have a GetMapCenter() method for the sake of compatibility to TWebGMaps.


PS: Why is the forum timeout so ridiciously small, that I have to retype my replies again?
  • Thank you for your suggestion.
    We'll consider adding this functionality in a future version of TMS VCL WebOSMaps

    - The timeout behavior of the forum is not intended.
    We'll have to investigate if this behavior can be improved.