0
function pauseAnimation() {
    animating = false;
    //=====
    var index = Math.round($("[id='rightfrm:tbv1:txt1']").val() * elapsedTime / 1000);
    (geoMarker.getGeometry()).setCoordinates(line_coordinates[index].lc);
    map.un('postcompose', moveFeature);
}

My problem is elapsedTime -- How can I get that ?

  • That code seems to be based on the OpenLayers example openlayers.org/en/latest/examples/feature-move-animation.html where elapsedTime is calculated inside the moveFeature function. If you need the value outside that function you would need to declare the variable outside the function (as with var speed, now;) and not use var when setting the value inside the function. – Mike Mar 18 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.