Hello,
Is there any possibility to get the connection to my geodatabase using the .sde file connection generated with arcCatalog ? i looked at the tutorial but there's only how to open a local geodatabase .can any one help me
thanks advanced
Manel,
Here is a property of a class "WorkspaceInfo.ConnectionString" that accepts path to your ".sde" file to connect to a geodatabase. Hope it helps.
Thanks for your answer , but WorkspaceInfo and ConnectionString works on version 10.2.7 and me am trying to work on arcGIS runtime version 100 didn't find wich library can replace WorkspaceInfo ? can any one help me please , thanks adavanced
This is a feature that is coming in Update 1 for LocalMapService. You should be able to create EnterpriseGeodatabaseWorkspace from either connection string or ArcSDE connection file and create a TableSublayerSource with this workspace for ArcGISMapImageSublayer. Dynamic rendering for ArcGISMapImageLayer is also new in Update 1.
Hello @Jennifer Nery
thanks for your answer ,
Is there any tutorial that shows how to use localMapService and EntrepriseGeodatabaseWorkspace from .sde file ? i'am a biginner on .net and arcGis runtime ?
Thanks for your help
I actually need to add a 3D cone on a feature class and i need to display a layers from feature classes as a map so i generated .mpk files to get access to the geodatabase using the local servers but still didn't make it here's my code
private Esri.ArcGISRuntime.Geometry.Geometry createCone3D() { var location = new MapPoint(-4.04, 70, 1000, SpatialReferences.Wgs84); var coneSymbole = new SimpleMarkerSceneSymbol { Style = SimpleMarkerSceneSymbolStyle.Cone, Color = Colors.Yellow, Height = 3000, Width = 1000, Depth = 3000,AnchorPosition = SceneSymbolAnchorPosition.Bottom}; var coneGraphic = new Graphic(location, coneSymbole); var geom = coneGraphic.Geometry; MySceneView.GraphicsOverlays[1].Graphics.Add(coneGraphic); return geom; }
private Esri.ArcGISRuntime.Geometry.Geometry createCone3D() { var location = new MapPoint(-4.04, 70, 1000, SpatialReferences.Wgs84); var coneSymbole = new SimpleMarkerSceneSymbol { Style = SimpleMarkerSceneSymbolStyle.Cone, Color = Colors.Yellow, Height = 3000, Width = 1000, Depth = 3000,
AnchorPosition = SceneSymbolAnchorPosition.Bottom
}; var coneGraphic = new Graphic(location, coneSymbole); var geom = coneGraphic.Geometry; MySceneView.GraphicsOverlays[1].Graphics.Add(coneGraphic); return geom; }
private Esri.ArcGISRuntime.LocalServices.LocalServer _localServer;private async void StartLocalServer() { //get the singleton LocalServer object using the static instance property _localServer = Esri.ArcGISRuntime.LocalServices.LocalServer.Instance;//Handle the statusChanged event to react when the server is started_localServer.StatusChanged += ServerStatusChanged;//Start the local server instance await _localServer.StartAsync();}private async void ServerStatusChanged(object sender , Esri.ArcGISRuntime.LocalServices.StatusChangedEventArgs e) { //Check if the server started successfully if(e.Status == Esri.ArcGISRuntime.LocalServices.LocalServerStatus.Started) { //Create a local feature service from a map package on diskLocalFeatureService featureService = new LocalFeatureService(@C:\Users\mkeddar\Documents\ArcGIS\niveauDepartemental.mpk);//Handle the status changed event to check when it's loadedfeatureService.StatusChanged += async (svc, args) => { //If started successfully , add a layer from the service if (args.Status == LocalServerStatus.Started) { //Get the service URL var featureServiceUrl = (svc as LocalFeatureService).Url.AbsoluteUri; //Create a new service feature table ServiceFeatureTable localServiceTable = new ServiceFeatureTable(new Uri(featureServiceUrl + "/2")); //Create a new feature layer to display the features in the table FeatureLayer featureLyr = new FeatureLayer(localServiceTable);var attribute = new Dictionary<String, object>(); attribute.Add("description", "description");var geomCone = createCone3D(); //create a new feature var newFeature = localServiceTable.CreateFeature(attribute,geomCone); // here i don't know what to guive as parameters so i create a feature //from my geometry geomCone //add the new feature await localServiceTable.AddFeatureAsync(newFeature); //push this update (apply edits) to the feature serviceIReadOnlyList<EditResult> editResults = await localServiceTable.ApplyEditsAsync(); //check the results for errorsforeach(var r in editResults) { if (r.CompletedWithErrors) { Console.WriteLine("Edit ti Object" + "'failed'" + r.Error.Message); } } } };//Start the local feature service await featureService.StartAsync();
private Esri.ArcGISRuntime.LocalServices.LocalServer _localServer;
private async void StartLocalServer() { //get the singleton LocalServer object using the static instance property _localServer = Esri.ArcGISRuntime.LocalServices.LocalServer.Instance;
//Handle the statusChanged event to react when the server is started
_localServer.StatusChanged += ServerStatusChanged;
//Start the local server instance await _localServer.StartAsync();
}
private async void ServerStatusChanged(object sender , Esri.ArcGISRuntime.LocalServices.StatusChangedEventArgs e) { //Check if the server started successfully if(e.Status == Esri.ArcGISRuntime.LocalServices.LocalServerStatus.Started) { //Create a local feature service from a map package on disk
LocalFeatureService featureService = new LocalFeatureService(@C:\Users\mkeddar\Documents\ArcGIS\niveauDepartemental.mpk);
//Handle the status changed event to check when it's loaded
featureService.StatusChanged += async (svc, args) => { //If started successfully , add a layer from the service if (args.Status == LocalServerStatus.Started) { //Get the service URL var featureServiceUrl = (svc as LocalFeatureService).Url.AbsoluteUri; //Create a new service feature table ServiceFeatureTable localServiceTable = new ServiceFeatureTable(new Uri(featureServiceUrl + "/2")); //Create a new feature layer to display the features in the table FeatureLayer featureLyr = new FeatureLayer(localServiceTable);
var attribute = new Dictionary<String, object>(); attribute.Add("description", "description");
var geomCone = createCone3D(); //create a new feature var newFeature = localServiceTable.CreateFeature(attribute,geomCone); // here i don't know what to guive as parameters so i create a feature //from my geometry geomCone //add the new feature await localServiceTable.AddFeatureAsync(newFeature); //push this update (apply edits) to the feature service
IReadOnlyList<EditResult> editResults = await localServiceTable.ApplyEditsAsync(); //check the results for errors
foreach(var r in editResults) { if (r.CompletedWithErrors) { Console.WriteLine("Edit ti Object" + "'failed'" + r.Error.Message); } }
};
//Start the local feature service await featureService.StartAsync();
But this didn't work ! iu have an invalidOperationException
can you help me please ;thanks a lot
I've tried to use (using Esri.ArcGISRuntime.LocalServices.EnterpriseGeodatabaseWorkspace;) but didn't recognize i admit that this is not working yet ? right
Hi Manel,
To reply to your original question, you can follow these steps for installing Local Server and updating your WPF application NuGet reference. Be sure to choose v100.1.0. Either set install path (i.e. LocalServerEnvironment.InstallPath = @C:\Program Files (x86)\ArcGIS SDKs) or enable SDE and other child packages in your AGSDeployment file.
You can use the following code to create EnterpriseGeodatabaseWorkspace. Be sure to replace with correct connection string or full ArcSDE file path.
<SPAN class="keyword token">var</SPAN> service <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">LocalMapService</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">@"c:\Data\Sample.mpk"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> service<SPAN class="punctuation token">.</SPAN><SPAN class="token function">SetDynamicWorkspaces</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">DynamicWorkspace</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="punctuation token">{</SPAN> EnterpriseGeodatabaseWorkspace<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateFromConnectionString</SPAN><SPAN class="punctuation token">(</SPAN>$<SPAN class="string token">"{Guid.NewGuid()}"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"PASSWORD=password;SERVER=servername;INSTANCE=instancename;DBCLIENT=sqlserver;DB_CONNECTION_PROPERTIES=servername;DATABASE=databasename;USER=username;VERSION=dbo.DEFAULT;AUTHENTICATION_MODE=DBMS"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> EnterpriseGeodatabaseWorkspace<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateFromConnectionFile</SPAN><SPAN class="punctuation token">(</SPAN>$<SPAN class="string token">"{Guid.NewGuid()}"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">@"C:\Data\SampleConnection.sde"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">await</SPAN> service<SPAN class="punctuation token">.</SPAN><SPAN class="token function">StartAsync</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> MyMapView<SPAN class="punctuation token">.</SPAN>Map<SPAN class="punctuation token">.</SPAN>OperationalLayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">ArcGISMapImageLayer</SPAN><SPAN class="punctuation token">(</SPAN>service<SPAN class="punctuation token">.</SPAN>Url<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
You can retrieve workspace again using the following code.
<SPAN class="keyword token">var</SPAN> workspace <SPAN class="operator token">=</SPAN> service<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetDynamicWorkspaces</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN>w <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> w <SPAN class="keyword token">is</SPAN> EnterpriseGeodatabaseWorkspace<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> EnterpriseGeodatabaseWorkspace<SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
You can then create sublayer using this workspace. Be sure to replace with correct workspace name and apply the correct symbology (i.e. point features with marker symbols, line features with line symbols, polygon features with fill symbols, etc.).
layer<SPAN class="punctuation token">.</SPAN>Sublayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Clear</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> layer<SPAN class="punctuation token">.</SPAN>Sublayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">ArcGISMapImageSublayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">TableSublayerSource</SPAN><SPAN class="punctuation token">(</SPAN>workspace<SPAN class="punctuation token">.</SPAN>Id<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"YourWorkspaceName"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> Renderer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SimpleRenderer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SimpleFillSymbol</SPAN><SPAN class="punctuation token">(</SPAN>SimpleFillSymbolStyle<SPAN class="punctuation token">.</SPAN>Solid<SPAN class="punctuation token">,</SPAN> Colors<SPAN class="punctuation token">.</SPAN>Blue<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
This should work, can you give this a try?
As for your follow-up question, I am unclear about what you're trying to do with 3D symbol. Maybe try that you're able to load layers from mpk first. InvalidOperationException may be raised when edit is not enabled or table is not ready. To troubleshoot features not rendering, you can subscribe to LayerViewStateChanged of MapView/SceneView and check for layer view status (i.e. is it Active, OutOfScale, Error, NotVisible? Does layer.LoadError have a value?
I think I understand your follow-up question now. If you're trying to replace your FeatureLayer renderer/symbology with scene symbol, this will not work. You can only use 3d symbol in GraphicsOverlay RenderingMode=DynamicMode (which is default mode).
So to add a cone symbol interactively in a SceneView, you can do:
<SPAN class="keyword token">public</SPAN> <SPAN class="token function">MainWindow</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="token function">InitializeComponent</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> MyMapView<SPAN class="punctuation token">.</SPAN>Scene <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Scene</SPAN><SPAN class="punctuation token">(</SPAN>Basemap<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateTopographic</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> MyMapView<SPAN class="punctuation token">.</SPAN>GeoViewTapped <SPAN class="operator token">+</SPAN><SPAN class="operator token">=</SPAN> MyMapView_GeoViewTapped<SPAN class="punctuation token">;</SPAN> MyMapView<SPAN class="punctuation token">.</SPAN>GraphicsOverlays<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">GraphicsOverlay</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> Renderer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SimpleRenderer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> Symbol <SPAN class="operator token">=</SPAN> SimpleMarkerSceneSymbol<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateCone</SPAN><SPAN class="punctuation token">(</SPAN>Colors<SPAN class="punctuation token">.</SPAN>Red<SPAN class="punctuation token">,</SPAN> <SPAN class="number token">10000</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">10000</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">private</SPAN> <SPAN class="keyword token">void</SPAN> <SPAN class="token function">MyMapView_GeoViewTapped</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">object</SPAN> sender<SPAN class="punctuation token">,</SPAN> GeoViewInputEventArgs e<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">var</SPAN> overlay <SPAN class="operator token">=</SPAN> MyMapView<SPAN class="punctuation token">.</SPAN>GraphicsOverlays<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> overlay<SPAN class="punctuation token">.</SPAN>Graphics<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Graphic</SPAN><SPAN class="punctuation token">(</SPAN>e<SPAN class="punctuation token">.</SPAN>Location<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
To add your FeatureLayer from an MPK, you can do:
<SPAN class="keyword token">try</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">var</SPAN> service <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">LocalFeatureService</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">@"c:\data\PointsofInterest.mpk"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">await</SPAN> service<SPAN class="punctuation token">.</SPAN><SPAN class="token function">StartAsync</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> MyMapView<SPAN class="punctuation token">.</SPAN>Scene<SPAN class="punctuation token">.</SPAN>OperationalLayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">FeatureLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Uri</SPAN><SPAN class="punctuation token">(</SPAN>$<SPAN class="string token">"{service.Url}/0"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> MyMapView<SPAN class="punctuation token">.</SPAN>Scene<SPAN class="punctuation token">.</SPAN>OperationalLayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">FeatureLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Uri</SPAN><SPAN class="punctuation token">(</SPAN>$<SPAN class="string token">"{service.Url}/1"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">catch</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="token class-name">Exception</SPAN> ex<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> MessageBox<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Show</SPAN><SPAN class="punctuation token">(</SPAN>ex<SPAN class="punctuation token">.</SPAN>Message<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
To add a feature, you can do:
<SPAN class="keyword token">var</SPAN> layer <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>FeatureLayer<SPAN class="punctuation token">)</SPAN>MyMapView<SPAN class="punctuation token">.</SPAN>Scene<SPAN class="punctuation token">.</SPAN>OperationalLayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN>o <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> o <SPAN class="keyword token">is</SPAN> FeatureLayer<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> table <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">(</SPAN>ArcGISFeatureTable<SPAN class="punctuation token">)</SPAN>layer<SPAN class="punctuation token">.</SPAN>FeatureTable<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> template <SPAN class="operator token">=</SPAN> table<SPAN class="punctuation token">.</SPAN>FeatureTemplates<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">?</SPAN><SPAN class="operator token">?</SPAN> table<SPAN class="punctuation token">.</SPAN>FeatureTypes<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN>t <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> t<SPAN class="punctuation token">.</SPAN>Templates<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Any</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="operator token">?</SPAN><SPAN class="punctuation token">.</SPAN>Templates<SPAN class="operator token">?</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> feature <SPAN class="operator token">=</SPAN> table<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateFeature</SPAN><SPAN class="punctuation token">(</SPAN>template<SPAN class="punctuation token">,</SPAN> e<SPAN class="punctuation token">.</SPAN>Location<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">await</SPAN> table<SPAN class="punctuation token">.</SPAN><SPAN class="token function">AddFeatureAsync</SPAN><SPAN class="punctuation token">(</SPAN>feature<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
To replace the layer's symbology, you can do:
<SPAN class="keyword token">var</SPAN> layer <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>FeatureLayer<SPAN class="punctuation token">)</SPAN>MyMapView<SPAN class="punctuation token">.</SPAN>Scene<SPAN class="punctuation token">.</SPAN>OperationalLayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN>o <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> o <SPAN class="keyword token">is</SPAN> FeatureLayer<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> layer<SPAN class="punctuation token">.</SPAN>Renderer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SimpleRenderer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> Symbol <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SimpleMarkerSymbol</SPAN><SPAN class="punctuation token">(</SPAN>SimpleMarkerSymbolStyle<SPAN class="punctuation token">.</SPAN>Circle<SPAN class="punctuation token">,</SPAN> Colors<SPAN class="punctuation token">.</SPAN>Red<SPAN class="punctuation token">,</SPAN> <SPAN class="number token">10</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Note, however that 3D symbols is not supported in FeatureLayer (this is by current design).
Hello, thanks for your answer ,
I am a trainee in a company, and I was asked to look at the new technologies offered by arcGis runtime version 100.0, basically they want to migrate the architecture of a tool based on arcObject to ArcGis runtime version 100.1, There are 3D computations . Each equipment has a 3D servitude zone in conical or cylindrical or rectangular form and these geometries are registered in a feature classes in an enterprise geodatabase and can be retrieved .That I am looking for if it is possible to save 3D geometries in arcGis run time version 100.1
Hi Jennifer,
I need to know more about the EnterpriseGeodatabaseWorkspace , i actually have sqlServer database that contains about 59 feature classes and feature tables and relations so to access to thses data do i have to create (.mpk) so i will import all my feature classes on the ArcMap so i can use it as a service to create my EntrepriseGeodatabaseWorkspace using my .sde or may be there's a way to use directly .sde without using the service (.mpk) thanks for your answer
cheers
Editing of 3D objects is not supported, besides editing the Z values of points, lines and polygons.
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.