This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

How to calculate the coordinates of the 4 corners (edge) of the map with OpenStreetMap?

0

How to calculate the coordinates of the 4 corners (edge) of the map with OpenStreetMap?

asked 27 Jan '23, 08:58

Sultanb's gravatar image

Sultanb
10445
accept rate: 0%

i need the 4 corner coordinates of the map to use as raster

(27 Jan '23, 09:00) Sultanb

One Answer:

1

Set up your own Leaflet map (it's just a few lines of Javascript, see https://leafletjs.com/examples/quick-start/) then use getBounds to retrieve the currently visible map extent: https://stackoverflow.com/questions/22948096/get-the-bounding-box-of-the-visible-leaflet-map

answered 27 Jan '23, 09:28

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Can it be done for desktop application and with c#?

(27 Jan '23, 10:10) Sultanb

Source code available on GitHub .