Hi Noah,
thank you for the fast response. I think I have found the reason and it is not the goTo().
Before calling the goTo() function, I was calling the:
MapView.popup.open({features: selectedFeatures, updateLocationEnabled: true}).
The flag updateLocationEnabled is change the state of animation.
Please find below a small sample to reproduce it. I assume that this is an expected behavior, right?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<title>Sample</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.13/esri/themes/light/main.css" />
<script src="https://js.arcgis.com/4.13/"></script>
<script>
require(["esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer"], function (Map, MapView, FeatureLayer) {
var map = new Map({
basemap: "streets"
});
var view = new MapView({
container: "viewDiv",
map: map,
zoom: 4,
center: [15, 65]
});
var featureLayer = new FeatureLayer({
url:
"https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0"
});
var query = featureLayer.createQuery();
query.where = "tree_id = 102";
featureLayer.queryFeatures(query)
.then((response) => {
view.popup.open({
features: response.features,
// if we set this flag to false, the state of animation will not change
updateLocationEnabled: true
});
});
view.watch("animation", function (response) {
if (response && response.state === "running") {
console.log("Animation in progress");
}
else {
console.log("No animation");
}
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>