Information on updating your 1.5 applications to work with version 2.0 of the ArcGIS API for JavaScript.
The GeometryService now takes geometries as input instead of graphics. Applications that use the following geometry service operations will need to be modified.
Operation | Description |
---|---|
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; }
The following objects are deprecated at 2.0, use the alternatives instead.
Object | Alternative |
---|---|
Layer.onUpdate() | Deprecated at 2.0 use onUpdateStart() and onUpdateEnd() instead |
Geoprocessor.outputSpatialReference | Deprecated use outSpatialReference instead. |
Geoprocessor.setOutputSpatialReference(sr) | Deprecated use setOutSpatialReference(sr) instead. |
ClassBreaksRenderer.breaks | Deprecated use infos instead. |
UniqueValueRenderer.values | Deprecated use infos instead. |
Geoprocessor.outputSpatialReference | Deprecated use outSpatialReference instead. |
Geoprocessor.setOutputSpatialReference | Deprecated use setOutSpatialReference instead. |
VETiledLayer.clientToken | Tokens no longer requried, use a Bing Maps key instead. |
VETiledLayer.serverToken | Tokens no longer requried, use a Bing Maps key instead. |
VETiledLayer.tokenDuration | Tokens no longer requried, use a Bing Maps key instead. |
VETiledLayer.tokenURL | Tokens no longer requried, use a Bing Maps key instead. |
VETiledLayer.setServerToken | Tokens no longer requried, use a Bing Maps key instead. |
VETiledLayer.setClientToken | Tokens no longer requried, use a Bing Maps key instead. |
VEGeocoder.tokenDuration | Tokens no longer requried, use a Bing Maps key instead. |
VEGeocoder.tokenURL | Tokens no longer requried, use a Bing Maps key instead. |
VEGeocoder.serverToken | Tokens no longer requried, use a Bing Maps key instead. |
VEGeocoder.setServerToken | Tokens no longer requried, use a Bing Maps key instead. |