Select to view content in your preferred language

Swicth basemap not working

811
2
Jump to solution
08-28-2013 11:18 AM
ionarawilson1
Deactivated User
Can anybody tell me why this sample works if we run it from esri's website but it does not work if we download and run it from our computer?

https://developers.arcgis.com/en/javascript/jssamples/widget_basemap.html
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
It probably will not run properly if you copy it to you computer and double click on it (meaning the browser shows the url something like file:///C:/Users/me/Desktop/index.html). You to set up a development environment.

When developing with the ArcGIS API for JavaScript, a web server is  required. This means that web pages and apps using the ArcGIS API for  JavaScript need to be accessed over http://  (or https://) rather than file://. To meet this requirement, install  and configure a web server. Web server software is available free of  charge for all operating systems. For Windows, IIS is recommended. On Mac OS and Linux, Apache  is a popular option but any web server will do. The important point is  web pages using the ArcGIS API for JavaScript are served over http.

View solution in original post

0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor
It probably will not run properly if you copy it to you computer and double click on it (meaning the browser shows the url something like file:///C:/Users/me/Desktop/index.html). You to set up a development environment.

When developing with the ArcGIS API for JavaScript, a web server is  required. This means that web pages and apps using the ArcGIS API for  JavaScript need to be accessed over http://  (or https://) rather than file://. To meet this requirement, install  and configure a web server. Web server software is available free of  charge for all operating systems. For Windows, IIS is recommended. On Mac OS and Linux, Apache  is a popular option but any web server will do. The important point is  web pages using the ArcGIS API for JavaScript are served over http.
0 Kudos
ionarawilson1
Deactivated User
Thank you Ken. I had forgotten about that!
0 Kudos