I am new to javascript. In windows Visual Studio Code, I want to get arcgis api Intellisense , some guidebook says first install node.js and typings, then install arcgis api.
The typings tool may be used to install this using the command:
typings install --global github:Esri/jsapi-resources/4.x/typescript/arcgis-js-api.d.ts
execute above line in cmd.exe , error shows the location is bad.
SO how can I install arcgis-js-api.d.ts
Thanks!
Thanks Robert Scheitlin, GISP for the suggestion. I put together a video that starts from scratch on setting up Visual Studio Code using the ArcGIS API for JavaScript.
TypeScript and Visual Studio Code for ArcGIS API for JavaScript - YouTube
Hopefully that provides a better picture on getting things up and running.
Rene,
I follow your vedeo, step by step, npm install dojo & arcgis api, init project ......, at the step
import Map = Require("esri/map");
import FeatureLayer = Require("esri/layer/featureLayer");
still cannot get the Intellisense. Should I need some extension in VSC?
Thank you so much!
None of my VS Code extensions seem to matter.
What version of TypeScript are you using? You can check via tsc --version in the command line.
Did you restart VS Code?
tsc version 2.03, I restart VS code and the computer.
Hi Wenhua,
I am running into the same problem as you are. I did the same as the video tutorial and it did not work, but the following lines worked for me.
import Map = require("esri/Map");
import FeatureLayer = require("esri/layers/FeatureLayer")
Maybe because the ArcGIS JS library we are getting from npm has been updated to version 4.2, not 3.18, which may have packaged classes and objects differently?
Additionally, though these two import lines worked, I am not getting IntelliSense creating the map constant, e.g., basemap, center. Any idea?
You can still get the 3.x version from NPM if you need it. Below is what you would type at the console to specifically install the 3.x version.
npm install --save @types/arcgis-js-api@">=3.19.0 <4"
@Rene Rubalcava, and others,
good afternoon. I see that Rene's video 'uses' TS - i just completed reading readng a few pages comparing JS vs its superset TS.
I was able to get a sample project going w TS on VS code. I got intellisense.
Does ESRI recommend TS for web app builder and the like?
thanks Mr. Rene for your nice youtube video.
regards
ravi.
Hi,
I'm trying to get intellisense working in VS 2017. I have followed the steps in Rene's video, but no luck so far.
-Used npm to install esri jsapi typings (3.25)
-Edited tsconfig.json file to include reference to typings.d.ts file
-Created typings.d.ts file with references as shown
-Confirmed packge.json exists and configured correctly
I know the video was for vs code, but assuming this can be configured similarly for VS.
Any suggestions.
Thanks