如何使用传单在Ant路径中动态暂停



通过使用一个复选框,我想暂停或播放Ant动画,我如何才能达到这个目的?

const path = antPath(latlngs,
{
"delay": 800,
"dashArray": [10,20],
"weight": 4,
"color": "#0000FF",
"pulseColor": "#FFFFFF",
"paused": true or false (depending on chekbox result),
"reverse": false,
"hardwareAccelerated": true
});

非常感谢

最终,解决方案是…

<div class="col-sm-12">
<label for="PathCheck">PathSimulation Pause</label>
<input type="checkbox" id="PathCheck" onclick="IsChecked()">
<label for="PathCheck">PathSimulation Hide</label>
<input type="checkbox" id="PathHide" onclick="IsHide()">
<div id="ChartGeoJson"/>
<script type="text/javascript">
function IsChecked()
{
var checkBox = document.getElementById("PathCheck");
if(checkBox.checked==true)
{path.pause();}
else
{path.resume();}
}
function IsHide()
{
var checkBox = document.getElementById("PathHide");
if(checkBox.checked==true)
{mymap.removeLayer(path);}
else
{mymap.addLayer(path);}
}
var path;
var mymap;

最新更新