0

I'm learning html/JavaScript code from ArcGIS API Sandbox. (http://help.arcgis.com/en/webapi/javascript/arcgis../sandbox/sandbox.html?sample=map_webmap) The code in the sandbox works fine and creates a map in the 'results pane'. However, If I download and save the code from the sandbox to my desktop in html format, and then I open the html it won't generate any map.

I've tried changing parts of the code (like some parameters in the tags, even the '<'!DOCTYPE> line) but I still can make it work. Any advice on how to make that code run?

1 Answer 1

0

In your browser, does the URL start with "file://"? Take a look at the documentation page "Set up a Development Environment" so you'll access it through a web server via "http://" or "https://".

Also be aware that your sample is a very old version that uses what's called the legacy style of coding. This has been replaced by AMD style code, which is what you should be learning how to use. The updated version of the sample is found here. While version 3.x allows for both styles, version 4.x only uses AMD style.

1
  • @kenbruja, thanks for all your good advices. (Replacing https:// didn't work either, but that is a thing of the past. I've got to learn the current JS now!). So, I'm interested in learning/developing things in ArcGIS & JavaScript. I've been doing GIS & python for three years already developing wind, soils, vegetation models. Where would you recomend me to start with? Your answer above seems in the right path to what I'm looking for. Any other advice? Thanks again for your help.
    – Delonix R.
    Commented Aug 9, 2017 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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