I am trying to create drive time areas for a point. When I call the routine I get the following error.
Uncaught Error: string.substitute could not find key "layername" in template<BR />at js.arcgis.com/3.21/init.js:376<BR />at String.replace (<anonymous>)<BR />at Object.r.substitute (js.arcgis.com/3.21/init.js:376)<BR />at Object._updateAnalysisLayerUI (js.arcgis.com/3.21/esri/dijit/analysis/CreateDriveTimeAreas.js:22)<BR />at Object._buildUI (js.arcgis.com/3.21/esri/dijit/analysis/CreateDriveTimeAreas.js:20)<BR />at Object.postCreate (js.arcgis.com/3.21/esri/dijit/analysis/CreateDriveTimeAreas.js:8)<BR />at Object.create (js.arcgis.com/3.21/init.js:350)<BR />at Object.postscript (js.arcgis.com/3.21/init.js:349)<BR />at Object.advice (js.arcgis.com/3.21/init.js:119)<BR />at Object.c [as postscript] (js.arcgis.com/3.21/init.js:119)
Background -
- I have a small area FeatureLayer on ArcGIS online from which I am creating an activeFeatureLayer programmatically and is as well the active layer on the visible map.
- I also have a mapLayer that is created as an overlay on the current active layers on the map. This layer holds information regarding the drop point on the map with/without buffer distance.
I am following the javascript jsapi 3 documentation(https://developers.arcgis.com/javascript/3/jsapi/createdrivetimeareas-amd.html#createdrivetimeareas1) for this. This is what I am doing -
<SPAN>var activeFeatureLayer = new FeatureLayer("</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fservices5.arcgis.com%2F" target="_blank">https://services5.arcgis.com/</A><SPAN><auth_id>/arcgis/rest/services/<layer_id>/FeatureServer/0");</SPAN>
</CODE></P><P><CODE>var createDriveTimeAreas = new CreateDriveTimeAreas({<BR />inputLayer: activeFeatureLayer,<BR />inputType: "point",<BR />map: this.map,<BR />showReadyToUseLayers: false, // to disable an option to the UI that allows users to choose ready to use analysis layers from the Living Atlas Analysis Layers<BR /><SPAN>portalUrl: "</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fgeofac.maps.arcgis.com" target="_blank">https://<server>.maps.arcgis.com</A><SPAN>"</SPAN><BR />}, "analysis-tool");
- The code breaks when the instantiation of the CreateDriveTimesAreas is called.
- I am not sure whether is pertaining to portalUrl.
Can anyone please tell me what I am doing wrong here?
Thank you.