Hi Andrew, have you tried this to log an event?
var trackOn = track.on("track", function(event) {
console.log(event);
});
Also make sure you're on a site using https or using localhost.
The following was working for me..
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<title>Track current location - 4.10</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link
rel="stylesheet"
href="https://js.arcgis.com/4.10/esri/css/main.css"
/>
<script src="https://js.arcgis.com/4.10/"></script>
<script>
require([
"esri/widgets/Track",
"esri/views/MapView",
"esri/Map"
], function(Track, MapView, Map) {
var map = new Map({
basemap: "topo"
});
var view = new MapView({
map: map,
container: "viewDiv"
});
track = new Track({
view: view
});
view.ui.add(track, "top-left");
var trackOn = track.on("track", function(event) {
console.log(event);
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>