[OpenLayers-Users] OpenLayers.Layer.GML and showing name= of OSM data

Hendrik Oesterlin hendrikmail2002 at yahoo.de
Thu May 26 06:07:16 EDT 2011


Hello,

I'm trying to make an overlay to display some circle and the name of
bus stops using OpenStreetMap data.

I have extracted the amenity=bus_station and highway=bus_stop using
osmosis.

I have figured out how to put some circle over the map to show the bus
stops using this code:

var Transports = new OpenLayers.Layer.GML("Transports", "arrets-bus.osm", {format: OpenLayers.Format.OSM,
styleMap:new OpenLayers.StyleMap({
"default": {
pointRadius: 4,
fillColor: "#00DD00",
strokeColor: "#ff0000",
fillOpacity: 0.2
}
})
});
map.addLayer(Transports);

An example is here: http://oesterlin.ile.nc/test/20110526atelier.html

I was not able to display any name= or other custom key beside or
below the circles. In this example, displaying "name=" and
"karuia:MNCP=" would be useful.

Is there a possibility to make OpenLayers filter by itself the
required key from an OpenStreetMap-XML file and display the contents?

Can someone give me some hints or even better some example how to do
this?

Many thanks!

Hendrik Oesterlin



More information about the Users mailing list