I am trying to write some code using the Track Widget functionality demonstrated in the Esri Sample above. It specifically uses an external js library to force a custom location for its geolocation service instead of the current location of the browser. I want to use this method to modify the sample code shown in the Track Widget simulation, however when I try to run the code outside of the sandbox, i keep getting an error in loading the custom js library. Error message listed below:
|Error in my browser's console:|
Failed to load resource: net::ERR_FILE_NOT_FOUND
Error: scriptError: //2gis.github.io/mock-geolocation/dist/geolocate.js
Running the demo in the sandbox works fine, but when I try to run it outside in a standalone html file, the demo code does not work at all.
Weird thing is that I can open the link to the file that the mock-geolocation file is stored in, but for some reason the script in the html cannot. Also even when I give it a modified url to the RAW location of the js library on GitHub, it then fails to recognize the functions of the library.
Please help! Thank you
Strange I saved the file to a virtual directory on my webserver and used a https:// url for my webserver and it worked fine. Note. You can not use file:// url and make this work.
Yes you are correct. I forgot to place the file into a webserver before viewing it.
While I have your attention, I what I am trying to achieve are a few things if you know how to do them or could recommend any examples that do them:
1. Animate a point smoothly from one location to another
2. Have the camera follow the point smoothly as it is moving
Right now in the Track Widget code, the geolocated point is moving instantly from one location to another, and I would like for that movement to be fluent. Also since the point is moving so instantly, the camera following the point is also forced to move quickly, I would like for both of their movements to be smooth. Do you know how to achieve that?
Thank you for the quick response.