JavaScript Api Basic Viewer to configure locally

1429
3
12-23-2011 05:00 AM
SureshRajamani
New Contributor II
I have downloaded the basic viewer template and i need to have this basic viewer inside my existing asp.net application as one of the page.I already configure the javascript api 2.6 in my web application locally,caz i am going to publish my web application in some other server with javascript api,so i didnt configure the api directly in wwwroot of iis.
My question is
I need to point my local javascript api in basic viewer template with all contents (nls folder,javascript folder etc which is all inside basic viewer folder).
Please provide me a sample.
0 Kudos
3 Replies
SureshRajamani
New Contributor II
I am explaining here the issue in more detail

I have an Asp.Net MVC Application. There I am trying to integrate the ArcGIS JavaScript Basic Viewer.
I already configured the ArcGIS Javascript API 2.6 in my Asp.Net application as below here  [ATTACH]10821[/ATTACH]


I have Default.ashx inside jsapicompact folder as mentioned in install.htm of ArcGIS Javascript Api downloaded content.

I am using this script reference.
<script type="text/javascript" src="http://localhost/myapplication/scripts/arcgis_js_api/library/jsapicompact/default.ashx�?� >

Instead of

<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6compact"> 

Here is my dojoConfig
var djConfig = {
    parseOnLoad: true,
    locale:"en-us",
    baseUrl: './',
    modulePaths: {
        "esriTemplate": "../../../Modules/ArcGISMaps/Scripts"
    }
};

The problem is I am not able to make Basic Viewer to work with local ArcGIS Javascript Api. I am getting some error in loading dojo scripts and ArcGIS javascript Api Scripts.

Please help me how to configure the basic viewer with local ArcGIS Javascript Api (http://localhost/myapplication/scripts/arcgis_js_api/library/jsapicompact/default.ashx)

Instead of
Online api (http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6compact)
0 Kudos
JeffPace
MVP Alum
I am explaining here the issue in more detail

I have an Asp.Net MVC Application. There I am trying to integrate the ArcGIS JavaScript Basic Viewer.
I already configured the ArcGIS Javascript API 2.6 in my Asp.Net application as below here  [ATTACH]10821[/ATTACH]


I have Default.ashx inside jsapicompact folder as mentioned in install.htm of ArcGIS Javascript Api downloaded content.

I am using this script reference.
<script type="text/javascript" src="http://localhost/myapplication/scripts/arcgis_js_api/library/jsapicompact/default.ashx�?� >

Instead of

<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6compact"> 

Here is my dojoConfig
var djConfig = {
    parseOnLoad: true,
    locale:"en-us",
    baseUrl: './',
    modulePaths: {
        "esriTemplate": "../../../Modules/ArcGISMaps/Scripts"
    }
};

The problem is I am not able to make Basic Viewer to work with local ArcGIS Javascript Api. I am getting some error in loading dojo scripts and ArcGIS javascript Api Scripts.

Please help me how to configure the basic viewer with local ArcGIS Javascript Api (http://localhost/myapplication/scripts/arcgis_js_api/library/jsapicompact/default.ashx)

Instead of
Online api (http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6compact)


it should just be

<script type="text/javascript" src="http://localhost/myapplication/scripts/arcgis_js_api/library/2.6/jsapi/?v=2.6compact�?� >

unless you changed the folder structure
0 Kudos
SureshRajamani
New Contributor II
it should just be

<script type="text/javascript" src="http://localhost/myapplication/scripts/arcgis_js_api/library/2.6/jsapi/?v=2.6compact�?� >

unless you changed the folder structure


I followed the same procedure mentioned in Install.html of JSAPI downloaded.There it is mentioned to access the JSAPI like this http://<myserver>/arcgis_js_api/library/2.5/arcgis/.

Even i configure the Default.ashx as default document in IIS.I am not able to access like above url.
So i direclty call Default.ashx like this http://<myserver>/arcgis_js_api/library/2.5/arcgis_compact/default.ashx.
Basic viewer is not working for this configuration.
But I am able use the samples which is arcgis.com http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm help for JSAPI instead of using Basic Viewer.

So now i got the javascript file (arcgis.js) from this live url  "http://serverapi.arcgisonline.com/js.../?v=2.6compact"  and save it my application folder.
Now i am using like this
<script type="text/javascript" src="http://localhost/myapplication/scripts/arcgis.js�?� >.

It is working fine.

But i know how to configure the local JSAPI for Basic Viewer without using this <script type="text/javascript" src="http://localhost/myapplication/scripts/arcgis.js�?� >
I would like to use like this <script type="text/javascript" src="http://localhost/myapplication/scripts/arcgis_js_api/library/jsapicompact/default.ashx�?� >

Note: I can able to browse http://localhost/myapplication/scripts/arcgis_js_api/library/jsapicompact/default.ashx in IE.No error.It downloads script partially loaded in browser,but not as file.

But when i use live http://serverapi.arcgisonline.com/js.../?v=2.6compact,this returns script as file.
0 Kudos