Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a map being rendered by OpenLayers using GeoServer which is serving maps using PostGIS. In the database for each line feature type (i.e road), I have the name of that road.

I'm looking for a way to display that information while the map is zoomed similar to what we have in Google Maps.

Is this possible in OpenLayers? Can anybody point me to the recommended way of doing this.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

If you are using SLD to style your features you could use Labels and ScaleDenominators (basically Zoom Levelling) to show labels for your line features at higher zoom levels.

For labelling it would be wroth checking out this documentation - GeoServer SLD Cookbook - Labels - and for setting different styles based on zoom level check this out - GeoServer SLD Cookbook - Zoom based lines

Basically you want to set a number of different rules in your SLD for the layer that will turn on labels as you zoom in.

I hope this helps get you started.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.