Questions Answered: Discovering the ArcGIS API 4.x for JavaScript

1454
0
10-02-2017 01:05 PM
AmyNiessen
Esri Regular Contributor
2 0 1,454

We had so many great questions during our "Discovering the ArcGIS API 4.x for JavaScript" webinar, that we decided to share them all with you! We hope by answering some of these questions, we will open up a dialogue with you from the comments you leave below. Feel free to follow up and keep checking this page's comments section for more contribution.

Q: Will Arcade expressions work inside TypeScript? If so how?

A: Arcade is it's own expression language; it's not JavaScript or TypeScript.

Q: I have been looking for a way to use the directions widget in the 4x. But I have not found the documentaion yet except in the 3x. I will be happy if the directions widget could be included in the 4x or could you show me how. 

A: Directions widget is planned for 4x, but there is no timeline on when it will be ready.

Q: If I'm using ArcGIS Online instead, could I do it? I mean, instantiating a web map created in ArcGIS Online and controlling it in JavaScript, because I couldn't find the portal item ID if I created it in the ArcGIS Online or make it public? 

A: This is custom app development using ArcGIS Online services.

Q: What software do we need for creating web GIS apps?

A: An editor like Atom, Visual Studio Code. And just a free developer subscription for creating layer items and web maps.

Q: Can I create one app that works on desktops and phones?

A: You can create a web app that would be performant in both. You can read about Progressive Web Apps here (https://developers.google.com/web/progressive-web-apps/). You may also want to look at Cordova (http://cordova.apache.org/).


Q: If I have a 2D map with multiple layers, say I have two different layers but I want them to be both displayed on the same map, but only certain parts of each legend in each layer - can this be done?

A: You can disable layers from showing in the legend if desired (https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#legendEn...).

Q: What application are you using to write code and view those maps?

A: We are using Reveal and CodePen.

Q: I see a lot of good support for 2D Maps in JS API 4.4, so why we should use 3.21 to build 2D maps and 4.4 to build 3D maps? in other words, what does 3.21 provide that 4.4 does not provide?

A: 4.x is our next generation JavaScript API that implements many of the latest JavaScript patterns and practices. 3.x uses patterns and practices that are now over seven years old. You can refer to the functionality matrix (https://developers.arcgis.com/javascript/latest/guide/functionality-matrix/index.html) to see if you need 3x capabilities or could get by with 4x until feature parity is complete.

Q: Can you code the popup to be moved on the map?

A: This is not a feature built into the popup, but you might be able to customize this yourself. We have no samples of this.

Q: What if you don't have longitude and latitude, but you have X,Y coordinate?

A: X,Y works with defined spatial reference when you create a layer.

Q: Is there a book available to get started with tutorials? This is overwhelming.

A: We recommend reading the topics under the Guide section of the API docs. You can also take a look at our DevLabs which are 10 - 15 minute step-by-step learning aid. Here are the links: https://developers.arcgis.com/labs/ and https://developers.arcgis.com/javascript/latest/guide/discover/index.html. If you are looking for getting started with JavaScript, then we recommend doing internet searchs until you find tutorials that match your expectations. There are so many we can't really determine which ones are best for each person.

Q: Jumping the gun, I know, but I've been working with SceneViews, elevationInfo, and 3D renders a lot lately. Will the API eventually have support for either setting/modifying z values via Arcade expressions or/and setting elevationInfo.offset via Arcade expressions? We have a lot of "3D" data that is not 3D and use cases where we may not want to use actual elevations, for instance, exaggerating vertical distance between building floors to show all space owned by a department within a building. 

A: The 4.5 release and documentation will have a property on elevationInfo called featureExpressionInfo that should meet your needs.

Q: Will we ever be able to set elevationInfo.offset or set/modify Z values via Arcade expresssions?

A: The 4.5 release and documentation will have a property on elevationInfo called featureExpressionInfo that should meet your needs.

Q: Any documentation on "Best Practices when working with JS API for ArcGIS"?

A: Yes, under the https://developer.arcgis.com/javascript home page.

Q: Can we use 3D sketchup models directly into Portal/AGOL using JS API to view the models?

A: You would need to export out of CityEngine or try to convert to multipatch in Pro and publish a scenelayer. This doc may help (http://pro.arcgis.com/en/pro-app/help/projects/styles.htm).

Q: WIll the draw option work in 3D view as well?

A: Not in the 4.5 release, but is on the roadmap for a future release.

Q: Do you require anything other than the out-of-the-box portal to load an Excel sheet (e.g. a geoprocessing server / extension)?

A: No, you just want to save the excel file as a CSV and upload it.

Q: Is there any rest layers grouping option in ArcGIS Online or ArcGIS JavaScript APIs?

A: You may be looking for the GroupLayer (https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html), but you can't group layers in Online at the moment.

Q: Is there still no editing capabilities in JS API 4x?

A: A widget with editing capabilities should be coming early- to mid-2018. However, in the meantime the 4.x API can programmatically add, update or delete features using FeatureLayer.applyEdits().


Q: Do vector tile layers sit on top of basemap layers or are they considred a basemap layer?

A: Vector can be basemap

Q: Do Arcade renderers show up in an updated legend?

A: Arcade is not a renderer; it's used within an existing renderer to extend its capabilities.

Q: Incompatible spatial reference? Does that mean non-web mercator?

A: The map can be in any projection, but we can only reproject layers from mercator <-> web-mercator. 

Q: Can it be used to build mobile web apps with HTML5 Web Storage support (i.e., offline)?

A: It can, but a mobile offline experience is tricky with maps. A better option is our native Runtime SDKs https://developers.arcgis.com/arcgis-runtime/.

Q: Is mapview compatible with other basemaps from Mapbox, CartoDB, etc.?

A: If you can provide the schema of the tiles, you can use WebTileLayer (https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html), but we can't load the Mapbox vector tile.

Q: Can you please recommend an Esri Virtual Course for a true beginner. That is, for the first time a student will be exposed to APIs and JavaScript?

A: We recommend finding an online JavaScript course that fits your needs, W3 schools is a great introduction to the basics: https://www.w3schools.com/js/default.asp. 

Q: What are the main differences between using the ArcGIS API and using ESRI's open source esri-leaflet?

A: The ArcGIS API for JavaScript fully supports the ArcGIS Platform. Esri-leaflet is a good soultion in some cases, but does not support all the features of the platform.

Q: Can we create WebMap Applications using AGS JS API with Angular's latest version? If yes, then how, and can you help me to find resources and help for this?

A: We have various resources on github (https://github.com/Esri/jsapi-resources/tree/master/frameworks/angular).

Q: Streaming Layer, data has to come from geoevents server or we can have a custom service?

A: You can use your own web socket server as long as it emits Esri JSON format.


Q: I'm a beginner level in GIS; please give your valuable suggestions.

A: Please checkout our online free and other paid training opportunities. If you got to the following link and type the word JavaScript into the catalog search you'll find many options: https://www.esri.com/training/catalog/search/.

Q: What is this pricing of this API for commercial apps?

A: Please see this pricing as a starting point: https://developers.arcgis.com/pricing/.


Q: Do you have to use TypeScript when creating your own widgets?

A: If you want to use the widget framework with the API, yes. But you can write widgets in any framework and use the ViewModels if you like.

We hope this list of Q&A helps! Please leave comments below for any other questions you may have. There were also some questions asked during the webinar itself. If you missed it, here is the recording: 

Discovering the ArcGIS API 4.x for JavaScript - YouTube