POST
|
Hi Empty/blank maps cannot be packaged but you can add a new group layer to the dataframe and navigate to View > DataFrame Properties to specify the coordinate system before sharing as a Map Package by going to File > Share As > Map Package. Cheers, Kerrie
... View more
03-28-2013
04:36 AM
|
0
|
2
|
377
|
POST
|
Hi, This has been discussed in the following forum post: http://forums.arcgis.com/threads/43361-Being-notified-when-a-selection-was-just-made?highlight=editor The recommended approach is to attach a method to the OnEditCompleted() event in the ESRI.ArcGIS.Client.Editor class. You can check that the user finishes selecting the features and then get the SelectedGraphics collection. Cheers, Kerrie
... View more
03-20-2013
10:13 AM
|
0
|
0
|
175
|
POST
|
Hi, You could use try using Button Command and CommandParameter properties. Once the selection has been removed you can not select again until you click the SelectTool button. This is also demonstrated in the Selecting a FeatureLayer sample. http://resources.arcgis.com/en/help/runtime-wpf/samples/index.html#/Selecting_a_FeatureLayer/02q200000066000000/ Below is a code snippet of the ToolBar Buttons with the CommandParameter and Command set in .xaml
<ToolBarTray Margin="0,0,0,267" DataContext="{StaticResource MyEditor}">
<ToolBar>
<Button Content="SelectTool" Foreground="Black" CommandParameter="Add" Command="{Binding Select}" />
<Button Content="UnSelectTool" Foreground="Black" CommandParameter="Remove" Command="{Binding Select}" />
</ToolBar>
</ToolBarTray>
Cheers, Kerrie
... View more
03-19-2013
10:58 AM
|
0
|
0
|
317
|
POST
|
Hi, In the code example provided the map is also defined as accelerated. If you remove UseAcceleratedDisplay="True" or change to UseAcceleratedDisplay="False" as shown in the code below the element layer should be added successfully. <esri:Map UseAcceleratedDisplay="False" x:Name="MyMap"> <esri:AcceleratedDisplayLayers > <esri:ArcGISTiledMapServiceLayer ID="World Topo Map" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/> </esri:AcceleratedDisplayLayers> <esri:ElementLayer ID="Elements"></esri:ElementLayer> <esri:GraphicsLayer ID="Graphics"></esri:GraphicsLayer> </esri:Map> Cheers, Kerrie
... View more
01-25-2013
01:00 AM
|
0
|
0
|
473
|
POST
|
Hi, What should I use as a WKID value in the sample you provided? No, this was just an example of using the Map.Extent property. You will need to specify your own extent and WKID depending on the spatial reference of your data. Cheers, Kerrie
... View more
11-15-2012
07:02 AM
|
0
|
0
|
576
|
POST
|
Hi, Unfortunately in version 1.0 of the ArcGIS Runtime SDK for WPF this is a bug. It has been fixed for the next release. As you found, map interaction is required for the map refresh to be triggered. Kerrie
... View more
11-13-2012
05:07 AM
|
0
|
0
|
174
|
POST
|
Hi, The local feature service is starting without issues. Do you have the spatial reference set on the Map? If not, you could try setting the spatial reference and extent of the Map using similar to the .XAML code below: <esri:Map x:Name="MyMap" > <esri:Map.Extent> <esri:Envelope XMin="661140" YMin="-1420246" XMax="3015668" YMax="1594451" > <esri:Envelope.SpatialReference> <esri:SpatialReference WKID="enter WKID"/> </esri:Envelope.SpatialReference> </esri:Envelope> </esri:Map.Extent> You could also try adding an online ArcGISTiledMapServiceLayer and see if this helps you find the layer. <esri:ArcGISTiledMapServiceLayer ID="MyLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" /> What version of the ArcGIS Runtime SDK for WPF are you using? Cheers, Kerrie
... View more
11-12-2012
08:13 AM
|
0
|
0
|
576
|
POST
|
Hi Kerrie, can you be more specific about the above? Hi, Both code examples you have posted should work. It is worth checking the Error property to confirm that the local feature service is starting correctly. Insert a breakpoint after the local feature service is started. Once the breakpoint is hit - check the Error property to confirm there was no problem encountered starting the service. Then get the UrlFeatureService property and paste it into a browser (while the app is still in debug mode and the local server is still running). This will display the HTML view of the service and will tell you what layers are available. Cheers, Kerrie
... View more
11-12-2012
05:05 AM
|
0
|
0
|
576
|
POST
|
Hi, Geometry operations such as Union, Buffer, Intersect can be dynamically performed on graphics. Once the operation is complete the results can be rendered on the map in a graphics layer. To perform these operations on local data, the LocalGeometryService should be used in conjunction with the use of a GeometryService Task. Please see the conceptual documentation on LocalGeometryService for more information and code examples: http://resources.arcgis.com/en/help/runtime-wpf/concepts/index.html#/How_to_use_the_Geometry_task/017000000039000000/ Samples using the LocalGeometry Class can be found in the Sample Application under Geometry> Geometry Operations Cheers Kerrie
... View more
11-12-2012
02:34 AM
|
0
|
0
|
694
|
POST
|
Hi, The code you gave to add the ArcGISLocalFeatureLayer should work without any issues. I suspect there is an issue with the .mpk or network. Can you see the expected layers and the access UrlFeatureService if you debug the featureservice? Cheers, Kerrie
... View more
11-12-2012
01:39 AM
|
0
|
0
|
576
|
POST
|
Hi, On a Windows 64bit machine is possible to receive this error when the application Platform Target of the deployed application is not specified as x64. Try changing the Platform Target to x64 and rebuild the application using similar steps to those below to see if this resolves the issue. > Open Visual Studio and navigate to the application properties page > Click the Build tab and change the Platform Target value to x64 in the drop down. > Rebuild the application and place in the deployment Alternatively, if your target machine is Windows 32bit please verify that the application Platform Target is x86 and that you have included the Windows 32bit deployment in your deployment. Cheers, Kerrie
... View more
07-09-2012
01:55 AM
|
0
|
0
|
265
|
POST
|
Hi, Please can you clarify the following in more detail. Do you require the green rectangle element specified in your control template to have the geometry of your polygon graphic? In this scenario, if the geometry is different for each polygon where would you like the yellow lines to be positioned? If each polygon geometry always is a rectangle would you require the yellow lines to emerge from the bottom corners of each rectangle? Cheers Kerrie
... View more
07-05-2012
04:48 AM
|
0
|
0
|
433
|
POST
|
Hi, The ArcGIS Runtime SDK 1.0 for WPF release supports the latest version of the standard MIL-STD-2525C using the MessageProcessor class. For further documentation please refer to the following concept help: http://resources.arcgis.com/en/help/runtime-wpf/concepts/index.html#/Displaying_military_graphics_using_message_processing/0170000000m0000000/ For examples using this functionality open the sample application and search on the phrase Military. Cheers Kerrie
... View more
07-03-2012
03:54 AM
|
0
|
0
|
422
|
POST
|
Hi, Instead of using Editor.EditVertices you could use EditGeometry Class so that you can call StopEdit() in code behind. A sample using the EditGeometry Class can be found in the Sample Application under Editing > Edit Tools > Edit Tools Geometry and the documentation can be found below: http://resourcesbeta.arcgis.com/en/help/runtime-wpf/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.EditGeometry.html An editable TextBox can be added to an ElementLayer. A sample showing how to add an ElementLayer in .xaml can be found under Mapping > Dynamic Map Layers > Element Layer The code below shows how an ElementLayer with an editable TextBox can be created in code behind when the Map.MouseClick event is fired. <esri:Map x:Name="MyMap" MouseClick="MyMap_MouseClick"> <esri:ArcGISTiledMapServiceLayer ID="PhysicalTiledLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/> <esri:ElementLayer ID="MyElementLayer"/> </esri:Map> private void MyMap_MouseClick(object sender, Map.MouseEventArgs e) { ESRI.ArcGIS.Client.Geometry.MapPoint clickPoint = e.MapPoint; ElementLayer elementLayer = MyMap.Layers["MyElementLayer"] as ElementLayer; TextBox textBox = new TextBox(); textBox.Text = "Editable text"; textBox.SetValue(ElementLayer.EnvelopeProperty, new Envelope(clickPoint.X, clickPoint.Y, clickPoint.X, clickPoint.Y)); elementLayer.Children.Add(textBox); MyMap.Layers.Add(elementLayer); } Cheers, Kerrie
... View more
05-30-2012
03:44 AM
|
0
|
0
|
313
|
POST
|
Hi Robert Yes, It is possible create a new feature in a LocalfeatureLayer with selected geometry. One way to do this is to get the geometry you want from a map control mouse click event and create a new graphic with this geometry set. The new graphic can then be saved as an edit to the LocalFeatureLayer. In the scenario where you cannot enter null fields into a database it is possible to get prototype attributes from the current features in the LocalFeatureLayer and set default values where appropriate. There is example code below: The following code will start the LocalFeatureService asynchronously with a path to the Map Package and the ArcGISLocalFeatureLayer will use this service. ## Default constructor ##
public partial class MainWindow : Window
{
ArcGISLocalFeatureLayer arcGISLocalFeatureLayer;
ESRI.ArcGIS.Client.Geometry.MapPoint _clickPoint;
public MainWindow()
{
InitializeComponent();
LocalFeatureService.GetServiceAsync("Path to .mpk", (localFeatureService) =>
{
arcGISLocalFeatureLayer = new ArcGISLocalFeatureLayer()
{
Service = localFeatureService,
Editable = true,
LayerId = 0,
DisableClientCaching = true,
AutoSave = false,
Mode = ESRI.ArcGIS.Client.FeatureLayer.QueryMode.OnDemand,
OutFields = new OutFields() { "*" },
};
The following code contains the Initialized, InitializationFailed and UpdateCompleted event handlers. Normally, if you add a LocalFeatureLayer to the map, the initialized event fires automatically once the map has initialized the layer, and then an updatecompleted event fires as the LocalFeaturelayer makes an Update call immediately after initialization in snapshot or ondemand modes. Once UpdateCompleted has fired, the feature layer graphics collection will be populated with features. In this example the Mapcontrol is made enabled when the updatecompleted event fires. At each stage it is possible to count how many features there are in the LocalFeatureLayer.
arcGISLocalFeatureLayer.Initialized += (s, e) =>
{
MessageBox.Show(arcGISLocalFeatureLayer.Graphics.Count.ToString());
};
arcGISLocalFeatureLayer.InitializationFailed += (s, e) =>
{
MessageBox.Show(arcGISLocalFeatureLayer.InitializationFailure.Message);
};
arcGISLocalFeatureLayer.UpdateCompleted += (s, e) =>
{
_mapControl.IsEnabled = true;
MessageBox.Show(arcGISLocalFeatureLayer.Graphics.Count.ToString());
};
The following code adds the LocalFeatureLayer to the map control. You don't need to add the LocalFeatureLayer to your map control to perform edits, you just need to make sure it is initialized and updated. Normally the map is responsible for the layer initialization and initial update method call so if you don�??t add the feature layer to the map you�??ll need to call Initialize() explicitly, and respond to the Initialized event in which you would call Update().
_mapControl.Layers.Insert(1,arcGISLocalFeatureLayer);
## Mapcontrol MouseClick event## In the following code the _mapControl_MouseClick method is a handler for the Map's MouseClick event. The user clicks on the map to specify a point geometry which is then used to create a new graphic, which is added to the LocalFeatureLayer and saved.
private void _mapControl_MouseClick(object sender, Map.MouseEventArgs e)
{
_clickPoint = e.MapPoint;
var graphic = new ESRI.ArcGIS.Client.Graphic()
{
Geometry = _clickPoint,
};
The following code gets the prototype attributes from the features in the LocalFeatureLayer and sets default values as appropriate. This prevents issues where fields in the database cannot be null.
if (arcGISLocalFeatureLayer.LayerInfo == null) return;
//use LayerInfo.Fields
foreach (var field in arcGISLocalFeatureLayer.LayerInfo.Fields)
graphic.Attributes[field.Name] = null;
//use PrototypeAttributes
FeatureTemplate featureTemplate = null;
if (arcGISLocalFeatureLayer.LayerInfo.Templates != null && arcGISLocalFeatureLayer.LayerInfo.Templates.Count > 0)
featureTemplate = arcGISLocalFeatureLayer.LayerInfo.Templates.FirstOrDefault().Value;
else if (arcGISLocalFeatureLayer.LayerInfo.FeatureTypes != null && arcGISLocalFeatureLayer.LayerInfo.FeatureTypes.Count > 0)
{
var featureType = arcGISLocalFeatureLayer.LayerInfo.FeatureTypes.FirstOrDefault();
if (featureType.Value != null && featureType.Value.Templates != null)
featureTemplate = featureType.Value.Templates.FirstOrDefault().Value;
}
if (featureTemplate != null && featureTemplate.PrototypeAttributes != null)
{
foreach (var item in featureTemplate.PrototypeAttributes)
graphic.Attributes[item.Key] = item.Value;
}
The following code adds the new graphic to your LocalFeatureLayer. The graphic contains all the default attributes.
arcGISLocalFeatureLayer.Graphics.Add(graphic);
The following code includes the BeginSaveEdits, EndSaveEdits and SaveEditsFailed events where you can check the graphics count has increased on EndSaveEdits and catch any failures saving the edits.
arcGISLocalFeatureLayer.BeginSaveEdits += (s1, beginEditEventArgs) =>
{
};
arcGISLocalFeatureLayer.EndSaveEdits += (s2, endEditEventArgs) =>
{
MessageBox.Show(arcGISLocalFeatureLayer.Graphics.Count.ToString());
};
arcGISLocalFeatureLayer.SaveEditsFailed += (s3, taskFailedEventArgs) =>
{
string message = taskFailedEventArgs.Error.Message;
ServiceException serviceEx = taskFailedEventArgs.Error as ServiceException;
if (serviceEx != null && serviceEx.Details != null && serviceEx.Details.Count > 0)
message += serviceEx.Details[0];
};
The following code saves the edits to the LocalFeatureLayer. If the LocalFeatureLayer was setup with AutoSave = true then the edit will be automatically be saved back to the Geodatabase via the [local]service. It�??s only necessary to call SaveEdits explicitly if AutoSave is false.
arcGISLocalFeatureLayer.SaveEdits();
} } }
Cheers Kerrie
... View more
01-24-2012
08:22 AM
|
0
|
0
|
212
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|