[OSM-dev] How to get bbox data of OSM export feature to a file

Graham Jones grahamjones139 at gmail.com
Sat Aug 6 15:56:31 BST 2011

Hi Parveen,

> I need to export the data which is in form of latitudes and longitudes
> when we click on the export feature of openstreetmap.org
> I am not sure I understand your question, but what I think you are asking
"How do I display a slippy map on a web site and determine the bounding box
(lon/lat of bottom left and top right corner) of the displayed map once the
user has adjusted it (panned and zoomed to select a particular area)?"

If that is the question, you should look at OpenLayers or Leaflet to display
the map, then extract the appropriate javascript properties to get the
coordinates of the map being displayed.

The OSM Export function will do this (but I am not sure exactly how it works
- you can probably look at the javascript your browser is running to see (I
am sure it will be interacting with OpenLayers).

Alternatively, I have done something similar in Openlayers here:
http://code.google.com/p/townguide/source/browse/#svn%2Ftrunk%2Fwww (look at
SubmitForm.php and osm_map.js,

Or something that I have started on, but not finished using leaflet here:
at the map2json function - map.getBounds seems to do it).

Hope that helps - sorry if I have answered the wrong question!


Graham Jones
Hartlepool, UK.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20110806/1f124a03/attachment.html>

More information about the dev mailing list