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

Place a marker on a country

0

Hello guys !

Here's my problem. In my app, I want people to add the countries they have visited. Then, an OSM map (I'm using OpenLayers) would be displayed using all those countries, with markers on them (ideally, only the countries they've visited would appear, but I don't think it's possible).

So, my question is:
Is their a way to use a country name to add a marker ?
If not, how can I get the lat/lon from the country ?
I know of the nominatim, but you have to provide a city so that it works ( http://nominatim.openstreetmap.org/search.php?country=England&format=json doesn't work for example). Is there a way to automatically get the capital (or any city for that matter) so I can retrieve the coordinates ?

Thanks a lot guys !

asked 20 Jul '13, 21:21

kilik2049's gravatar image

kilik2049
56225
accept rate: 0%

edited 20 Jul '13, 21:22

Source code available on GitHub .