Hide Table of Contents
What's New archive
Migrating to 2.0

Information on updating your 1.5 applications to work with version 2.0 of the ArcGIS API for JavaScript.

Breaking Changes

The GeometryService now takes geometries as input instead of graphics. Applications that use the following geometry service operations will need to be modified.

OperationDescription
areasAndLengths The graphics parameter was replaced by areasAndLengths.
buffer The BufferParameters features option was replaced by geometries.

Version 1.x

function doBuffer(evt){
  var graphic = new esri.Graphic(evt.mapPoint, symbol);
  var params = new esri.tasks.BufferParameters();
  params.features = [ graphic ];
  ...

Version 2.0

function doBuffer(evt) {
  var params = new esri.tasks.BufferParameters();
  params.geometries = [ evt.mapPoint ];
  ...
labelPoints The polygons parameter changed from an array of graphics to an array of geometries v2.0
lengths The graphics parameter was replaced by lengthsParameter.

Version 1.x

geometryService.lengths(graphics);

Version 2.0

lengthParams.polylines = [geometry];
geometryService.lengths(lengthParams);
project The graphics parameter was replaced by geometries.

Version 1.x

gsvc.project([ graphic ], outSR, function(features) {});

Version 2.0

function projectToLatLong() {
  gsvc.project([ pt ], outSR, function(projectedPoints) {
    ...
  });
});
relation The graphics1,graphics2, spatialRelationship and comparisonString parameters were replaced by relationParameter.
simplify The graphics parameter was replaced by geometries.

The RouteTask.onSolveComplete event now returns an anonymous solveResult object which contains: routeResults, barriers, polylineBarriers, polygonBarriers, and messages.

Version 1.x

function showRoute(routeResults, barriers) {
  map.graphics.add(routeResults[0].route.setSymbol(routeSymbol));
}

Version 2.0

function showRoute(solveResult) {
  directions = solveResult.routeResults[0].directions;
  directionFeatures = directions.features;
}

Deprecated

The following objects are deprecated at 2.0, use the alternatives instead.

ObjectAlternative
Layer.onUpdate()Deprecated at 2.0 use onUpdateStart() and onUpdateEnd() instead
Geoprocessor.outputSpatialReferenceDeprecated use outSpatialReference instead.
Geoprocessor.setOutputSpatialReference(sr)Deprecated use setOutSpatialReference(sr) instead.
ClassBreaksRenderer.breaksDeprecated use infos instead.
UniqueValueRenderer.valuesDeprecated use infos instead.
Geoprocessor.outputSpatialReferenceDeprecated use outSpatialReference instead.
Geoprocessor.setOutputSpatialReferenceDeprecated use setOutSpatialReference instead.
VETiledLayer.clientTokenTokens no longer requried, use a Bing Maps key instead.
VETiledLayer.serverTokenTokens no longer requried, use a Bing Maps key instead.
VETiledLayer.tokenDurationTokens no longer requried, use a Bing Maps key instead.
VETiledLayer.tokenURLTokens no longer requried, use a Bing Maps key instead.
VETiledLayer.setServerTokenTokens no longer requried, use a Bing Maps key instead.
VETiledLayer.setClientTokenTokens no longer requried, use a Bing Maps key instead.
VEGeocoder.tokenDurationTokens no longer requried, use a Bing Maps key instead.
VEGeocoder.tokenURLTokens no longer requried, use a Bing Maps key instead.
VEGeocoder.serverTokenTokens no longer requried, use a Bing Maps key instead.
VEGeocoder.setServerTokenTokens no longer requried, use a Bing Maps key instead.
Show Modal