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?

kenbuja
5,9152 gold badges20 silver badges31 bronze badges
asked Aug 8, 2017 at 18:25

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.

answered Aug 8, 2017 at 19:23
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. Commented Aug 9, 2017 at 12:54

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.