[OpenLayers-Users] Displaying a text message

Richard Jones richardjnz at yahoo.com
Wed Aug 1 06:26:33 PDT 2012


I would like to display a 2-line textual message in the *center* of the browser window. This would either be written across the map, or across the empty browser window (if I choose to make the map invisible) using a particular font and point/pixel size.

Is there a simply way to do this?

The only reference I can find to text is the "label" used on point features. I know that I can set a point in the exact center of the viewport and set the label text, but I can't see a way to have the text display with center justification which would be more aesthetically pleasing than starting at a particular X pixel position. It might be possible to set a pixel position if there was a way of measuring the horizontal pixel extent  of a line of text, but I can't see a way of doing that.

If point labels are the only way to display text, then does anyone have any ideas how this might be accomplished?



More information about the Users mailing list