+ Reply to Thread
Results 1 to 4 of 4

Thread: Basic Viewer (Javascript) on premise

  1. #1
    Eric Lacoursiere
    Join Date
    Jan 2010
    Posts
    10
    Points
    0
    Answers Provided
    0


    0

    Unhappy Basic Viewer (Javascript) on premise

    Hi,

    I would like to install the Basic Viewer on my webserver and use it along with my ArcGIS Server and ArcGIS Online web services only.

    In the configuration's file, I can find the map key, but don't see where I can define my Content Directory's URL (.../ArcGIS/Mobile/Content/MobileWeb/Maps/) so the ID is related to my "local" json file instead of the ArcGIS Online hosted version.

    My question: Can we use the Basic Viewer (and the others tempates) with the JSON configuration file or if it works only with the ArcGIS Online MapID? (If yes, how?)

    Thanks,

    Eric

  2. #2
    Kelly Hutchins

    Join Date
    Oct 2009
    Posts
    885
    Points
    622
    Answers Provided
    106


    0

    Default Re: Basic Viewer (Javascript) on premise

    Eric,

    If I understand your question correctly then sure you can use the templates with a web map created via json. Here's an example that takes a web map, from the 'Create Web Map from JSON' developer sample and uses that with the Basic Viewer template. I just create the web map then set the web map as the configOptions.webmap value.

    Code:
        <script type="text/javascript">
          dojo.require("dijit.dijit");
          dojo.require("dijit.dijit-all");
          dojo.requireLocalization("esriTemplate","template");
        </script>
        <script type="text/javascript" src="javascript/layout.js">
        </script>
    
        <script type="text/javascript">
         
         var configOptions;
    
          function init() {      
          
           var webmap = {};
            webmap.item = {
              "title":"Soil Survey Map of USA",
              "snippet": "This map shows the Soil Survey Geographic (SSURGO) by the United States Department of Agriculture's Natural Resources Conservation Service.",
              "extent": [[-139.4916, 10.7191],[-52.392, 59.5199]]
            };
    
            webmap.itemData = {
              "operationalLayers": [{
                "url": "http://server.arcgisonline.com/ArcGIS/rest/services/Specialty/Soil_Survey_Map/MapServer",
                "visibility": true,
                "opacity": 0.75,
                "title": "Soil Survey Map",
                "itemId": "204d94c9b1374de9a21574c9efa31164"
              }],
              "baseMap": {
                "baseMapLayers": [{
                  "opacity": 1,
                  "visibility": true,
                  "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer"
                  },{
                  "isReference": true,
                  "opacity": 1,
                  "visibility": true,
                  "url": "http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer"
                  }],
                "title": "World_Terrain_Base"
              },
              "version": "1.1"
            };
          
            configOptions = {
              //The ID for the map from ArcGIS.com     
             //webmap:"dbd1c6d52f4e447f8c01d14a691a70fe",
             webmap:webmap,
             //The id for the web mapping applciation item that contains configuration info - in most
             //cases this will be null. 
              appid:"",
              //set to true to display the title
              displaytitle:true,
              //Enter a title, if no title is specified, the webmap's title is used.
              title:"",
              //Enter a description for the application. This description will appear in the left pane
              //if no description is entered the webmap description will be used.
              description: "",
              //Specify a color theme for the app. Valid options are gray,blue,purple,green and orange
              theme:'gray',
              //Optional tools - set to false to hide the tool
              //set to false to hide the zoom slider on the map 
              displayslider:true, 
              displaymeasure:true,
              displaybasemaps:true,
              displayoverviewmap:true,
              displayeditor:true,////When editing you need to specify a proxyurl (see below) if the service is on a different domain
              //Specify a proxy url if you will be editing
              proxyurl: "http://autumn/proxy/proxy.ashx",
              displaylegend:true,
              displaysearch:true, 
              displaylayerlist:true,
              displaybookmarks:true,
    ....... more config stuff here
          
            };
            
            initMap();
          }
          dojo.addOnLoad(init);
        </script>

  3. #3
    Eric Lacoursiere
    Join Date
    Jan 2010
    Posts
    10
    Points
    0
    Answers Provided
    0


    0

    Default Re: Basic Viewer (Javascript) on premise

    Hi Kelly,

    Thanks for your quick response!

    So, my goal is to host the JSON file on my ArcGIS Server Content (http://*****.com/ArcGIS/Mobile/Content/MobileWeb/Maps/)

    And use the Basic Viewer with this JSON file:
    http://apps.arcgis.com/hosted/OnePan...d296127000dd99

    I need to know where I specify my Server Content URL.

    Cheers,

    Eric

  4. #4
    Suresh Rajamani
    Join Date
    Dec 2011
    Posts
    7
    Points
    0
    Answers Provided
    0


    0

    Default Re: Basic Viewer (Javascript) on premise

    I need to refer my local javascript api for this basic viewer.
    But i m getting error while executing this line dojo.requireLocalization("esriTemplate","template");
    How to configure the Basic Viewer with local arcgis javascripr api in my web server.

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts