简体   繁体   English

关于Primefaces JSF中折线的标记动画

[英]Marker Animation on polylines in primefaces JSF

I want to show moving marker along polyline in gmap of Primefaces. 我想在Primefaces的gmap中沿折线显示移动标记。 Does gmap supports marker animation along polyline? gmap是否支持沿折线的标记动画? I have searched but did not find any useful link. 我搜索过但没有找到任何有用的链接。

I think you want this animation on polyline with Primefaces GMap Polyline . 我想你想 Primelines GMap Polyline的 折线上使用这个动画 If yes then you can achieve this by getting Polyline Object in JavaScript and then just pass that object to GMap mentioned example (animation on polyline). 如果是,那么你可以通过在JavaScript中获取Polyline Object然后将该对象传递给GM​​ap提到的示例(折线上的动画)来实现这一点。

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. 只需从您的代码中调用javascript函数即可。 Hopefully this will help someone. 希望这会对某人有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM