1

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.

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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