Like Google maps have functions like Question: How to get the bounding box for a center point in Is this link of some relevance here? From that link:
In this code, what are the north east and south west coordinates? asked 04 Oct '12, 12:24 Anisha Kaul SomeoneElse ♦ |
The question has been closed for the following reason "Question is off-topic or not relevant" by SomeoneElse 04 Oct '12, 14:20
As OpenStreetMap is only a dataset it does not have those functions. You would have to look at javascript libraries for slippy maps like OpenLayers or Leaflet for that. answered 04 Oct '12, 12:38 Gnonthgol ♦ And you might want to start looking here.
(04 Oct '12, 14:19)
SomeoneElse ♦
Gnonthgol, I have found your leaflet link helpful. I am using that API now. Thanks to @SomeonElse too.
(05 Oct '12, 12:23)
Anisha Kaul
|
@SomeoneElse I have read the FAQ. In which way do you think this is offtopic? Can't we have an bounding box solution for openstreet maps?
The reason why questions that start "Like Google maps..." get closed here is that often they refer to the use of external Javascript libraries, which are documented elsewhere - the three links below are excellent places to start.
Openstreetmap is essentially "all about the data", and you can do with it what you like whereas with Google you're presented with only one way of interacting with map data - their "API".
(and actually, it wasn't me that originally closed the question - I reopened it to add a comment to it!)
@SomeoneElse The google maps thing was just an "example" - just to show that I made an effort. In fact I even linked a page there to ask for confirmation if I am looking in the right direction.
Is there a way that I can make it look on topic?
First, I'd have a read of the links below.
Specifically, if you read the Leaflet docs page you'll see "getBounds()" mentioned pretty near the top, which does exactly what you want. I'm sure that OpenLayers offers something similar.
However, until you've read a bit of background on how the OSM slippy map works (follow the http://wiki.openstreetmap.org/wiki/Slippy_Map link from the top of the page in your question) some of the references may be a bit confusing.
@SomeoneElse You've been helpful and thanks for that.