AnsweredAssumed Answered

routetask does not solve for distances around a few hundred miles

Question asked by davetinkle on Apr 3, 2018

In my local environment using the 4.6 API [running wildfly as my app server], routeTask.solve works just fine for even the most obscene distances in CONUS [i.e., coast-to-coast]. However, when I run the same code in another environment, it will work fine only up to what seems like an arbitrary distance, returning this error message after only a few seconds: "Unable to load <contextRoot>/servlet/Proxy?https://route.arcgis.com/arcgis/rest/services/World/Route/NAS...", where <contextRoot> is that particular environment. My hunch is a returned JSON object hits some ceiling that our web server [apache] finds objectionable, but there are no clues in any logs, and no obvious config vars to tweak.

 

some JS:

 

  var graphics = [];
    var g1 = new Graphic({
     geometry: {
      type: "point",
      longitude: s1x, // -80.05722
      latitude: s1y // 26.618052
     }
    });
    var g2 = new Graphic({
     geometry: {
      type: "point",
      longitude: s2x, // -73.73554
      latitude: s2y // 40.718437
     }
    });
    graphics.push(g1);
    graphics.push(g2);
       var featureSet = new FeatureSet({
        features: graphics
       });
       var sr = new SpatialReference({
        wkid: 102100
       });

   var routeParams = new RouteParameters({
        directionsLengthUnits: "miles",
        stops: featureSet,
        outSpatialReference: sr,
        returnDirections: true,
        returnRoutes: false
       });
       
    urlUtils.addProxyRule({
     proxyUrl: "<contextRoot>/servlet/Proxy",
     urlPrefix: "route.arcgis.com"
    });

    var routeTask = new RouteTask({
     url: (location.protocol + "//" + "route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve")
    });

Outcomes