I am trying to get a buffer circle on my map,when I click on map. I tried with the following code, but I got error:

dojo.io.script error Error: Invalid URL

How can I avoid this error?

<!DOCTYPE html>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
    <title>Simple Map</title>
    <link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
      html, body, #map {
        height: 100%;
        width: 100%;
        margin: 0;
        padding: 0;

    <script src="http://js.arcgis.com/3.14/"></script>
      var map;

      require([ "esri/map",
                "dojo/domReady!"], function(Map,on,ArcGISDynamicMapServiceLayer,ImageParameters,Geoprocessor,FeatureSet,dom) {
          map = new Map("map", {
          basemap: "streets",  
          center: [72, 25.75], 
          zoom: 5

        var imageParameters = new ImageParameters();
        imageParameters.format = "PNG24";

         var gp = new Geoprocessor("http://iicss63:6080/arcgis/rest/services/NCAOR/XYZtoR/GPServer");

         map.on("click", createBuffer);
         function createBuffer(){
        var params = {"InputFile":FeatureSet,
        gp.submitJob(params, completeCallback, statusCallback);


        function completeCallback(jobInfo) {
        console.log("getting data");
        gp.getResultData(jobInfo.jobId, displayResult);
            function displayResult(result, messages) {
           var simpleLineSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
              new dojo.Color([255,255,0]), 1);
           var features = result.value.features;
              for (var f=0, fl=features.length; f<fl; f++) {
          var feature = features[f];
        function statusCallback(jobInfo) {



    <div id="map">  
        <span id="xyco" style="position:absolute; left:15px; bottom:5px; color:#000; z-index:50;"></span>

It seems to be that the url in the following line of code is not available:

var gp = new Geoprocessor("http://iicss63:6080/arcgis/rest/services/NCAOR/XYZtoR/GPServer");

You should try to enter the url in your browser to check if it's reachable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.