Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

Does anyone have any advice on how we can 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

Thanks for the input. I did follow only the steps given in the readme (I have changed nothing else). As I said, all the java script 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

Also, 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.

Thanks again for the response, we really appreciate the help.

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.

Once again, thank you very much for the help.

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);
    ...
share|improve this question
1  
You need to follow only the steps given in the readme that comes along with downloadable API. You don't need to change anything else. Can you tell us what request is being made to services.arcgisonline.com? Do you have any basemap or anything else in your map that comes from arcgis online? –  Devdatta Tengshe Jun 3 '13 at 15:47
1  
Can you post the complete code that you are using? I believe that the code is calling the hybrid basemap somewhere. –  Devdatta Tengshe Jun 4 '13 at 2:49
add comment

2 Answers

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.

share|improve this answer
add comment

To amplify previous answers : In the options you are passing with new esri.Map, you are passing in basemap: "hybrid". If you totally omit this parameter, your browser will not make any calls back to services.arcgisonline.com to pull map data. You can then load local map services without needing to access the Internet.

Would agree that this is not obvious from the ESRI api which doesn't provide any examples of using local only resources.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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