AnsweredAssumed Answered

Getting error while instantiation of CreateDriveTimeAreas

Question asked by FACarcgis on Nov 1, 2017
Latest reply on Apr 3, 2018 by gsubbiah-esristaff

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
at js.arcgis.com/3.21/init.js:376
at String.replace (<anonymous>)
at Object.r.substitute (js.arcgis.com/3.21/init.js:376)
at Object._updateAnalysisLayerUI (js.arcgis.com/3.21/esri/dijit/analysis/CreateDriveTimeAreas.js:22)
at Object._buildUI (js.arcgis.com/3.21/esri/dijit/analysis/CreateDriveTimeAreas.js:20)
at Object.postCreate (js.arcgis.com/3.21/esri/dijit/analysis/CreateDriveTimeAreas.js:8)
at Object.create (js.arcgis.com/3.21/init.js:350)
at Object.postscript (js.arcgis.com/3.21/init.js:349)
at Object.advice (js.arcgis.com/3.21/init.js:119)
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 -

 

var activeFeatureLayer = new FeatureLayer("https://services5.arcgis.com/<auth_id>/arcgis/rest/services/<layer_id>/FeatureServer/0");

var createDriveTimeAreas = new CreateDriveTimeAreas({
inputLayer: activeFeatureLayer,
inputType: "point",
map: this.map,
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
portalUrl: "https://<server>.maps.arcgis.com"
}, "analysis-tool");

 

  1. The code breaks when the instantiation of the CreateDriveTimesAreas is called.
  2. I am not sure whether is pertaining to portalUrl.

 

Can anyone please tell me what I am doing wrong here?

 

Thank you.

Outcomes