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

how to blink a line on a map which is formed by lat lon points through linestring from database the points(lat,lon) comes which is stored in form of MultiLineString. similarly like how a point blinking on a map same way the line should blink on map. (or)

I need to show on a map line blinking below code is displaying a line on the map but it should be made line blinking not all but particular some lines.

code :-

var mainfed = new OpenLayers.Layer.Vector("Mainfed");

$.get('http://'localhost:90'/them/date-feeder.php',function(data) { //getting the data from DB through php

   var records = data.split(',<br>'); //recognize the lat,lon through splitting the  records

 for(var idx=0;idx<records.length;idx++)
    var myarr = records[idx].split(",");
    var points = new Array()
    for(i = 0; i < myarr.length; i++)
        var lon = parseFloat(myarr[i++]);
        var lat = parseFloat(myarr[i]);

                      points.push(new OpenLayers.Geometry.Point(lon,lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) );
         var line = new OpenLayers.Geometry.LineString(points);
         var style = {
         'class': 'lineblink',
          strokeColor: 'red', 
          strokeOpacity: 5,
          strokeWidth: 2
 var lineFeature = new OpenLayers.Feature.Vector(line, null, style); 
    mainfed.addFeatures([lineFeature]); // forming a line through points            
map.addControl(new OpenLayers.Control.DrawFeature(mainfed, OpenLayers.Handler.Path)); 
share|improve this question

You can try using rules to select the needed lines, and then use symbolizer: {display:'none' } to hide matching lines, and "normal" symbolizer to show it on again.

and then using javascript timing ( that switches Rule objects that turn lines on and off.

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.