[GIS] ArcGIS local server using javascript api still does http gets to services.arcgisonline.com (internet)

arcgis-javascript-apiarcgis-server

We have setup a local server hosting the ArcGIS server software (10.1). We installed the ArcGIS JavaScript API on the same local server. Our goal is to supply maps when the client has no internet connection, only a local area connection.

When we run the client (i.e. using the JavaScript API from the local server), we can see that all of the java script files are pulled from the local server. However, once our java script code calls new esri.Map, we see that the javascript code starts to pull map data from http://services.arcgisonline.com.

I looked at the C:\ArcGIS\JavaScriptAPI33\arcgis_js_v33_api\library\3.3\jsapicompact\init.js code (this is where it resides on our local ArcGIS server) and I see many occurrences of http://services.arcgisonline.com. I am thinking I need to change all of these occurrences to be the local server but this was not a step in the installation instructions.

How can we prevent the JavaScript from going to the internet for any files (map data, javascript data, css, etc)?

I understand that the JavaScript is the controlling code that makes this happen but I thought that Esri would have handled that in their JavaScript logic.

Edit

I followed only the steps given in the readme (I have changed nothing else). As I said, all the JavaScript files come from the local server. Once I call "new esri.Map" in our java script code, I see the following "http gets" to services.arcgisonline.com:

 1. services.arcgisonline.com/ArcGIS/rest/info?f=json
 2. services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback
 3. services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer?f=json&callback=dojo.io.script.jsonp_dojoIoScript2._jsonpCallback

You asked me "do we have any basemap or anything else in our map that comes from ArcGIS online?" My answer is no. But clearly (unless there is an ArcGIS bug) something is not working as we want it to because it ends up going to services.arcgisonline.com.

As your response is implying, it seems I do not understand the basemap values since I am using hybrid for the local server. Sounds like I need a different value there.

Here is the code snippet:

var l_Options =
{
zoom: 10,
sliderStyle: "small",
basemap: "hybrid",
infoWindow: g_Popup,
nav: true
};

map = new esri.Map("map_canvas", l_Options);
dojo.connect(map, "onLoad",
function()
{
    var l_ArcGISTiledMapServiceLayer = null;

    switch (g_strMappingEngine)
    {
    case 'esriLocalServer':
        /* ????
        l_ArcGISTiledMapServiceLayer =
        new esri.layers.ArcGISTiledMapServiceLayer(
        l_strMappingDataAddress
        );
        ???? */
        l_ArcGISTiledMapServiceLayer =
        new esri.layers.ArcGISDynamicMapServiceLayer(
        l_strMappingDataAddress
        );
        break;
    case 'esriInternet':
    default:
        l_ArcGISTiledMapServiceLayer =
        new esri.layers.ArcGISTiledMapServiceLayer(
        l_strMappingDataAddress
        );
        break;
    }

    map.addLayer(l_ArcGISTiledMapServiceLayer);
    ...

Best Answer

You are specifying that the map should be loaded with the "hybrid" map type (in your l_Options object), which is is one of the available map services hosted at services.arcgisonline.com/ArcGIS/rest/services.

In order to remove the dependency on ESRI services, you should not specify a basemap, and instead load your own layers from your own instance of ArcGIS Server.