views:

437

answers:

1

I want to have a vector layer of the world, which shows the country borders, states and their names in English. Is there a layer that exists that I can control the colours?

Cloudmade doesn't let me quite do this, nor does openstreetmap and a bunch of others. I'm thinking I might need to create a raster image and overlay that except I dont know where to get an accurate EPS/vector map I can edit and overlay.

Running out of options!

+2  A: 

You have different options depending of your needs:

  1. The easiest one is to use a public WMS service that offers the information you need. You can check catalogues like this one or a Google search like this. If your are lucky to find a service that suits you, just add it as a WMS layer in OpenLayers as described in this example.

  2. If you can't find a public service, you will have to serve the geographic data yourself. You have to find a dataset of the world countries (the most common formats are ESRI shapefile and KML).

    • If you find a shapefile (try here), you will have to serve it via a map server like MapServer or Geoserver. Both are pretty straightforward to set up, but choose the one that suits you best (MapServer is a CGI and Geoserver is Java-based). Once you have configured a WMS service with the countries data, you can add it to your OpenLayers app following the previous example.

    • If you can't or don't want to use a map server and you have a KML file of the world countries, you can also add a vector layer to OpenLayers from a KML file, as described in this example. Be careful, because all geometries will be rendered in the user's browser (with SVG or VML) and for large datasets, this can be a performance issue. Check this example to see it in action.

I hope this give you a few clues.

amercader