Giuseppe, There is no example that I am aware of. Adding a raster to a service is has nothing to do with flex or the viewer app and has everything to do with publishing services using ArcGIS Server. Just add the raster to your MXD and then publish the map service and when you add the map service as a dynamic layer it will just be part of that map service layer.
private function addDynamicLayerToMap(simpleRenderer:SimpleRenderer):void { var geoDbFileId:String = getGeoDbFileIdFromUrl(); // for example: geoDbFileId = "edifici" var agsDynamicUrl:String = "http://<AGS server>/arcgis/rest/services/test/MapServer/dynamicLayer"; var tableDataSource:TableDataSource = new TableDataSource(); tableDataSource.workspaceId = "DBMasterDynamicWorkspaceID"; // where "DBMasterDynamicWorkspaceID" is dynamic workspace (type = Database) defined in AGS tableDataSource.dataSourceName = geoDbFileId; var layerDataSource:LayerDataSource = new LayerDataSource(); layerDataSource.dataSource = tableDataSource; var featureLayer:FeatureLayer = new FeatureLayer(agsDynamicUrl, null, agsSecurityToken); featureLayer.renderer = simpleRenderer; featureLayer.source = layerDataSource; featureLayer.name = nameLayer; map.addLayer(featureLayer); }
var rasterDataSource:RasterDataSource = new RasterDataSource(); rasterDataSource.workspaceId = workspaceName; rasterDataSource.dataSourceName = geoDbFileId; layerDataSource.dataSource = rasterDataSource;
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.