Marker Animation on polylines in JSF meshes

I want to show a moving marker along a polyline in gmap of Primefaces. Does gmap support animating a marker along a polyline? I searched but could not find any useful link.

+3


source to share


1 answer


I think you need this polyline animation with Primefaces GMap Polyline . If so, you can achieve this by getting a Polyline object in JavaScript, and then just pass that object to the above GMap (animation on a polyline) example.

function initMap(){
    var gmap = PF('gmap').getMap();                             
    var line = gmap.polylines[0];              
    animateCircle(line);
}
function animateCircle(line) {
      var count = 0;
      window.setInterval(function() {
        count = (count + 1) % 200;

        var icons = line.get('icons');
        icons[0].offset = (count / 2) + '%';
        line.set('icons', icons);
    }, 20);
  }

      



Just call javascript funtion from your code. Hope this helps someone.

+1


source







All Articles