Provide a solution using Silverlight API for ArcGIS to upload shapefiles from their computer to Silverlight Map directly
最後に公開された状態: August 25, 2014ArcGIS API for Silverlight
機能拡張 ID 番号
NIM079697
送信されました
August 22, 2014
最終更新日
June 5, 2024
適用対象
ArcGIS API for Silverlight
見つかったバージョン
2.4
プログラム言語
xaml
ステータス
Will Not Be Addressed
開発チームは、この問題またはリクエストを検討した結果、これに対処しないことに決定しました。 問題の「参考情報」セクションに、さらに詳細な説明が示されていることがあります。
参考情報
Will not be part of ArcGIS SL API, however they can upload to a server that generates features the ArcGIS SL API can understand.
他のワークフロー
private void openFileDialog_Click( object sender, RoutedEventArgs e ) { //Create the dialog allowing the user to select the "*.shp" and the "*.dbf" files OpenFileDialog ofd = new OpenFileDialog(); ofd.Multiselect = true;
if( !( ofd.ShowDialog() ?? false ) ) return;
//Get the file info objects for the SHP and the DBF file selected by the user FileInfo shapeFile = null; FileInfo dbfFile = null; foreach( FileInfo fi in ofd.Files ) { if( fi.Extension.ToLower() == ".shp" ) { shapeFile = fi; } if( fi.Extension.ToLower() == ".dbf" ) { dbfFile = fi; } }
//Read the SHP and DBF files into the ShapeFileReader ShapeFile shapeFileReader = new ShapeFile(); if( shapeFile != null && dbfFile != null ) { shapeFileReader.Read( shapeFile, dbfFile ); } else { HtmlPage.Window.Alert( "Please select a SP and a DBF file to proceed." ); return; }
//Add the shapes from the shapefile into a graphics layer named "shapefileGraphicsLayer" //the greaphics layer should be present in the XAML or created earlier GraphicsLayer graphicsLayer = MyMap.Layers[ "shapefileGraphicsLayer" ] as GraphicsLayer; foreach( ShapeFileRecord record in shapeFileReader.Records ) { Graphic graphic = record.ToGraphic(); if( graphic != null ) graphicsLayer.Graphics.Add( graphic ); } }