Release notes for 4.6
- Topics
- Directions widget (Beta release)
- DirectLineMeasurement3D widget
- Fullscreen widget
- Improved compatibility with JavaScript promises
- Layer refreshing
- Smart Mapping updates
- KMLLayer updates
- 2D WebGL-rendered FeatureLayer progress
- 3DObject SceneLayers and IntegratedMesh layer updates
- Updated vector basemaps
- Support for Slovenian locale
- Draw updates
- TypeScript declaration file improvements
- API updates and enhancements
- Breaking changes
- Bug fixes and enhancements
- Website enhancements
- Additional packages
Topics
Directions widget (Beta release)
Routing is now made simpler with the help of the Directions widget. This widget calculates directions between two or more locations and makes it easy to add turn-by-turn directions to a page as well as a route to a map. The widget takes care of encapsulating routing functionality into an easy-to-use widget with an already defined default user interface. The widget defaults to the ArcGIS Online route service but can be configured to use any ArcGIS Server Network Analyst routing service. To explore further, see the Directions sample.
Currently, the widget is still in its beta version. It does not yet have full parity to the functionality provided in the 3.x Directions widget. Additional functionality is scheduled in a future release.
DirectLineMeasurement3D widget
Measuring the vertical, horizontal, and direct distance between two points is now possible with the DirectLineMeasurement3D widget. When the widget is active, a horizontal "laser" line is drawn which indicates the height at the current mouse position. This line can help in analyzing the heights of objects relative to each other and the terrain.
The Direct line measurement in 3D sample shows how to use this widget.
Fullscreen widget
Fullscreen widget can be used to present the View or a user-defined HTMLElement using the entire screen. To see this widget in action, please refer to the Animate opacity visual variable and Animate color visual variable samples.
Improved compatibility with JavaScript promises
Numerous classes in the API resolve to promises. This is the case for WebMap and WebScene, MapView and SceneView, Basemap, Ground, layers and layerviews.
Prior to 4.6, you needed to call the then() method on classes to ensure a view or layer was ready prior to executing specific code.
At 4.6, then()
is deprecated in favor of when(). The then()
method will still be honored at 4.6, but will throw warning messages in the browser developer console, to ease the process of updating apps to using when(). We made this change to allow the use of native ES6 promises within the context of the ArcGIS API for JavaScript.
Read more about this change on the dedicated blog post.
In a future 4.x version, in 2018, then()
will be removed from all applicable classes, making this a breaking change.
Version | then() | when() |
---|---|---|
4.0 - 4.5 | Available | Not available |
4.6 | Deprecated (warning messages) | Available |
Future 4.x version | Not available | Available |
Prior to 4.6, then()
was used with resolved promises.
view.then(function(){
// do something with loaded view properties here
});
At 4.6, then()
is deprecated in favor of when()
.
view.when(function(){
// do something with loaded view properties here
});
While when()
should be used at 4.6 on all applicable classes, you must specify the following has
flag prior to loading the ArcGIS API for JavaScript for your app to be compatible with native promises. This flag will also prevent the warning messages from appearing in the console if still using then()
:
<script>
var dojoConfig = {
has: {
"esri-promise-compatibility": 1
}
};
</script>
Additionally this change will allow you to take advantage of async/await alongside the ArcGIS API for JavaScript to write asynchronous code that looks synchronous:
var map = new WebMap({
portalItem: {
id: "someid"
}
});
await map.load();
// the code waits for map to load
var view = new MapView({
container: "viewDiv",
map: map
});
await view.when();
// do something with the view
Layer refreshing
Most layers now can be refreshed in 2D MapViews by setting refreshInterval
property or by calling refresh()
method on it.
Smart Mapping updates
At 4.6, the following capabilities are now available as a part of the Smart Mapping modules:
- Generating opacity visual variables
- Changing polygon outline sizes in 2D depending on the view scale
- Generating class breaks using color or size
KMLLayer updates
- KMLLayer now supports viewing KML data in any view projection.
- Added the KMLLayerView class and moved the
allVisibleMapImages
,allVisiblePoints
,allVisiblePolygons
, andallVisiblePolylines
from KMLLayer to KMLLayerView. - Removed
mapImages
,points
,polygons
, andpolylines
from KMLSubLayer.
2D WebGL-rendered FeatureLayer progress
FeatureLayers are now rendered with WebGL by default as of version 4.9.
We're continuing to improve the user experience for the 2D WebGL-rendered version of FeatureLayer, which is still in beta. In 4.6, some of the processing in the layer has moved to workers using the API's workers framework. We'll continue improving the performance of FeatureLayer with the intention of making WebGL the default method of rendering features in a future release.
3DObject SceneLayers and IntegratedMesh layer updates
Scene layer performance has significantly improved in this release. Buildings and integrated mesh scene layers now load up to 50% faster and follow the correct front-to-back displaying order. To help you get started with scene layers, there is a new guide topic on Working with scene layers.
Updated vector basemaps
The named vector basemaps have been updated to use the new v2 vector tile basemaps from Esri. This affects dark-gray-vector
, gray-vector
, streets-vector
, streets-night-vector
, streets-relief-vector
, streets-navigation-vector
and topo-vector
.
Support for Slovenian locale
Version 4.6 adds support for the Slovenian (sl) locale. See Localization topic for more information about using different locales.
Draw updates
- Draw and SketchViewModel now have a support for creating multipoint geometry.
TypeScript declaration file improvements
The TypeScript declaration file for the ArcGIS API for JavaScript describes the shape of the API to TypeScript. Learn more about how to install this file from the dedicated guide page or on GitHub.
Version 4.6 introduces several improvements:
- JSDoc definitions for classes, methods and properties
- Read-only properties marked with
readonly
modifier - Autocasting enhancement for constructor parameters
- Typing improvements to take advantage of discriminated unions
Read more about those improvements on the dedicated blog post
API updates and enhancements
- Added style property on VectorTileLayer.
- Increased compatibility with CSS Flexbox.
- Added state property on Search widget.
- Added locationEnabled property on Search widget.
- Added MultipointDrawAction class.
- Added layer property on SketchViewModel.
- Added complete method on SketchViewModel.
- Added reset method on Draw.
- Added coordinates property on PointDrawAction.
- VectorTileLayer will return results in response to MapView.hitTest.
- Experimental support for mobile devices for WebScenes. Read about the devices we support in the Hardware requirements.
- Added TemplateOptions class.
- Added templateOptions property on Print.
- Added focus and blur methods to the Popup widget.
- Added
refreshInterval
property on BaseDynamicLayer, BaseTileLayer, FeatureLayer, ImageryLayer, MapImageLayer, OpenStreetMapLayer, TileLayer, WebTileLayer, WMSLayer, and WMTSLayer. - Added
refresh()
method on BaseDynamicLayer, BaseTileLayer, FeatureLayer, ImageryLayer, MapImageLayer, OpenStreetMapLayer, TileLayer, WebTileLayer, WMSLayer, and WMTSLayer. - Added create, scaleToZoom, and zoomToScale methods to the TileInfo class.
- Added a storeNode convenience method to the widget helper module.
- Added new module esri/geometry.
- Added new property classificationMethod on class ClassBreaksRenderer.
- Added new class esri/renderers/smartMapping/creators/opacity.
- Added new method createClassBreaksRenderer on class colorRendererCreator.
- Added new method createClassBreaksRenderer on class sizeRendererCreator.
- Added new class esri/renderers/support/AuthoringInfo.
- Added new class esri/renderers/support/AuthoringInfoVisualVariable.
- Added new class esri/symbols/support/symbolPreview.
- Added new event pointer-enter on classes MapView and SceneView.
- Added new event pointer-leave on classes MapView and SceneView.
- Added clone method, and returnCentroid, returnExceededLimitFeatures, and returnM properties to esri/tasks/support/Query.
- Added new method fromJSON to the StatisticDefinition class.
- Added new property group to the Expand widget and ExpandViewModel classes.
- Added new property
useHeadingEnabled
to Locate and Track widgets. - Added new property
legendOptions
to PointCloudClassBreaksRenderer, PointCloudStretchRenderer, PointCloudUniqueValueRenderer.
Breaking changes
attributionText
anditemDelimiter
have moved from AttributionViewModel to the Attribution widget.- Altitude constraints are no longer applied in local scenes.
- SceneView.goTo and MapView.goTo always return a Promise and not a ViewAnimation anymore.
- The Search widget's
searching
property has been replaced with state. relationParam
property on Query is renamed to relationParameter.relationParam
property on RelationParameters is renamed to relationParameter.- VectorTileLayer's url property type is
String
only now. When initializing a VectorTileLayer with style JSON object, use VectorTileLayer's style property instead.
Bug fixes and enhancements
- BUG-000106859 - Certain WMTS services that were unable to display properly now display as expected.
- BUG-000107311 - Fixed an issue where the browser would become unresponsive and crash after adding a VectorTileLayer or a TileLayer with an incorrect URL.
- BUG-000107639 - Updated the API install guide to be more clear.
- BUG-000107686 - Fixed an issue where graphics were not printing correctly using the Print or the PrintTask.
- BUG-000107690 - The Print widget now correctly reflects visibility changes of sublayers in the LayerList widget.
- BUG-000107903 - Fixed an issue when manually zooming into a MapView would zoom further than specified.
- BUG-000108125 - Fixed an issue where multiple errors were thrown in IE 11 while zoomed into a webmap.
- BUG-000108242 - The Print widget no longer only creates PDF files when used with IE 11.
- BUG-000108495 - Fixed a issue where the map would not rotate properly if left or bottom padding was set on the MapView.
- BUG-000109264 - Fixed an issue where some secured VectorTileLayers would not load properly if handled via a proxy file.
- BUG-000108875 - Fixed an issue where the default
zoom
action in the Popup widget would not work if the feature was z-enabled. - Fixed a bug where spatialReference was not set after loading a StreamLayer.
- ENH-000101275 - Made improvements to how SceneLayers renders.
- ENH-000107506 - Added ability to transition smoothly around a circular view of a 3D Scene.
- ENH-000108717 - Updated documentation to clarify that planar distances are used in the offest() method for both geometryEngine and geometryEngineAsync.
- ENH-000108930 - Added a warning message when a browser attempts to load a VectorTileLayer that does not support WebGL.
- ENH-000108944 - Added the ability to add and remove basemaps and automatically refresh the contents of the BasemapGallery widget.
Website enhancements
- Adds Keyboard Accessibility support to Home, Guide, API Reference, Sample Code, and Sandbox. Use
Shift ?
to display the help menu on each page.
Additional packages
Version 4.6 of the ArcGIS API for JavaScript uses Dojo 1.13.0 (since 4.6), dgrid version 1.2.1 (since 4.5), and dstore version 1.1.2 (since 4.5).
Previous releases
- Version 4.8 - July 2018
- Version 4.7 - April 2018
- Version 4.6 - December 2017
- Version 4.5 - September 2017
- Version 4.4 - July 2017
- Version 4.3 - March 2017
- Version 4.2 - December 2016
- Version 4.1 - September 2016
- Version 4.0 - May 2016