Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using openlayers to visualize an industry using image as the layer. On the raster layer I have created an overlay layer.Is it possible to show updated values (dynamic runtime values - as integer) in the overlay layer that gets updated every second? If so please help me how to get this done in openlayers.

share|improve this question

You can do it with features on a vector layer. Provide a datasource that has features on the same coordinates than your features on the raster layer. Then you can access the attributes of these features. For example, population:

myvectorlayer.features[myfeatureindex].attributes.population = 10000;

(or use one of the myvectorlayer.getFeature* functions)

From now on, you can add a label for the features with Openlayers.Style :

var myStyle = new OpenLayers.Style({
  'label' : '${population}',
  'fontSize' : '8px',
  'fontColor' : 'white',
  'labelOutlineColor' : "#000000", 
  'labelOutlineWidth' : 2});

Where ${population} is the attributes name on the vector layers features.

share|improve this answer

Your Answer


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.