|
POST
|
Hello,
Here is a sample of the expression that can be used to map field values between two features or rows with the EditOperation.TransferAttributes function.
return { "ADDRESS" : $sourceFeature['ADDRESS'], "IMAGE" : $sourceFeature['IMAGE'], "PRECINCT" : $sourceFeature['PRECINCT'], "WEBSITE" : $sourceFeature['WEBSITE'], "ZIP" : $sourceFeature['ZIP'] }
Here's an example of a simple button that will transfer attributes from a source feature (oid 1) in the Police Stations layer to a destination feature (oid 2) in the same layer
protected override void OnClick()
{
var layer = MapView.Active.Map.GetLayersAsFlattenedList().FirstOrDefault(l => l.Name == "Police Stations");
if (layer == null)
return;
string expression = "return {\r\n " +
"\"ADDRESS\" : $sourceFeature['ADDRESS'],\r\n " +
"\"IMAGE\" : $sourceFeature['IMAGE'],\r\n + " +
"\"PRECINCT\" : $sourceFeature['PRECINCT'],\r\n " +
"\"WEBSITE\" : $sourceFeature['WEBSITE'],\r\n " +
"\"ZIP\" : $sourceFeature['ZIP']\r\n " +
"}";
QueuedTask.Run(() =>
{
var op = new EditOperation();
op.Name = "Transfer atts";
op.TransferAttributes(layer, 1, layer, 2, expression);
var success = op.Execute();
});
}
I'll make sure the documentation for the function is updated. Let me know if you have any additional questions.
Narelle
... View more
11-10-2024
05:51 PM
|
0
|
0
|
741
|
|
POST
|
Hi Joe,
I think the property you're looking for is part of the CIM definition of the template object. Each EditingTemplate / EditingRowTemplate has a definition which is a CIMRowTemplate. CIMRowTemplate inherits from CIMBasicRowTemplate. There is a RequiredFields property on the CIMBasicRowTemplate object (https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic74601.html). This is different from the property used for setting default values (which is CIMBasicRowTemplate.DefaultValues).
Narelle
... View more
10-16-2024
09:05 PM
|
0
|
1
|
1278
|
|
POST
|
Hi Dominic,
Unfortunately we do not have the Smooth function available in the Geometry or Editing APIs as you've pointed out. I've added an issue to have it added to the Geometry API on the GeometryEngine object for the next release. This will be the 3.5 release as we are in the final stages of 3.4 right now which is due to be released shortly.
Narelle
... View more
09-29-2024
06:22 PM
|
0
|
1
|
1724
|
|
POST
|
Hello, An issue has been created and assigned to the development team. It s currently in the near-term queue, but I do not have any other timeline information on this.
... View more
08-27-2024
04:04 PM
|
0
|
0
|
1090
|
|
POST
|
Hello, Thank you for reporting this. Internally we also recently identified this same issue with the RowHandle object and how it is used within the EditOperation object. The Create and Delete operations with regards to relationships is one of these scenarios where some gaps in functionality exist. As you mention if the RowHandle is defined using a MapMember and objectID pair then the EditOperation Delete relationship method will work correctly. Unfortunately it will not work if the rowHandle is defined using a Row (or with a Table/FeatureClass and objectID pair). These bugs have been fixed and will be available in the 3.4 release of the software. Sorry for any inconvenience. Narelle
... View more
08-08-2024
09:44 PM
|
1
|
0
|
730
|
|
POST
|
Hello, Thanks for bring this bug to our attention. This will be fixed for the Pro 3.4 release.
... View more
07-18-2024
04:46 PM
|
1
|
0
|
860
|
|
POST
|
Hi Grzegorz, This bug was found and logged too late to be resolved in the 3.3 release. It is currently targeted to be fixed for ArcGIS Pro 3.4. Narelle
... View more
07-02-2024
10:24 PM
|
0
|
0
|
1431
|
|
POST
|
Sometimes there is other data that is in the geopackage file (for example raster data) that is not returned by the Database.GetTableNames method. In this instance you could use the the ItemFactory and Item classes to obtain the content. Here's an example snippet. var otherUris = new List<Uri>();
var tableUris = new List<Uri>();
var item = ItemFactory.Instance.Create(gpkgPath, ItemFactory.ItemType.PathItem);
var children = item.GetItems();
foreach (var child in children)
{
var childPath = child.Path;
if (child.TypeID == "sqlite_table")
tableUris.Add(new Uri(childPath));
else
otherUris.Add(new Uri(childPath));
}
// now use LayerFactory and StandloneTableFactory to
// create layers / tables
... View more
06-26-2024
06:11 PM
|
0
|
0
|
1891
|
|
POST
|
Re the Delete GP Tool no longer removing map layers with deleted data source. There was a change at 3.3 with the behavior of data sources being deleted and renamed. The default behavior is now NOT to remove layers when this occurs I believe this change was made for performance reasons. However, you can alter this default behavior to revert back to the previous behavior. There is a new setting in the backstage options under the Map And Scene tab. See the Layer Data Sources expander where you can set the value for both deleting and renaming of data sources independently. Narelle
... View more
06-04-2024
07:18 PM
|
1
|
1
|
3273
|
|
POST
|
Hello, Thanks for finding and highlighting this problem with the missing data on the Geometry tab with plug in datasources. I am able to duplicate the same behavior. Unfortunately there is no work-around to be able to display the coordinate data. I have logged an issue for this to be fixed in the next software release. regards Narelle
... View more
05-27-2024
09:22 PM
|
4
|
2
|
1638
|
|
POST
|
You cannot add controls to the mapControl itself. but you can add other controls to the window that is hosting the mapControl. In your example (the MapControl sample); this means you can add a button to the OverviewWindow xaml file. If you are not familiar with WPF you may need to do some research about the various WPF controls that can help you control the layout. Here's an article that gives some introduction to the Grid control - https://wpf-tutorial.com/panels/grid/. and how you can use column, rows and alignments to position child elements . Narelle
... View more
05-07-2024
06:26 PM
|
0
|
0
|
1645
|
|
POST
|
Hello, You need to wait until the MapControl on the overview window has finished drawing before you can add anything to it's overlay. Move your code into an event handler for the DrawComplete. Your OnClick method should look like the following protected override void OnClick()
{
if (_isOpen)
return;
_overview = new OverviewWindow();
var cam = MapView.Active.Camera;
//cam.Heading = 90;
_overview.ViewContent = MapControlContentFactory.Create(MapView.Active.Map, cam, MapView.Active.ViewingMode);
_overview.Closed += (s, e) =>
{
_isOpen = false;
lock (_lock)
{
_overview = null;
}
};
_overview.MyMapControl.DrawComplete += (s, e) =>
{
if (MapView.Active == null)
return;
var extent = MapView.Active.Extent;
var height = extent.Height;
var width = extent.Width;
var centerPt = extent.Center;
QueuedTask.Run(() =>
{
_overview.MyMapControl.AddOverlay(centerPt,
SymbolFactory.Instance.ConstructPointSymbol(
ColorFactory.Instance.RedRGB, 30.0, SimpleMarkerStyle.Star).MakeSymbolReference());
});
};
_overview.Show();
_isOpen = true;
} Narelle
... View more
04-28-2024
08:49 PM
|
0
|
0
|
1714
|
|
POST
|
Hi Ed, I can duplicate your problem with the AutoZoomOnEmpty property when you specify a lyrx file uri to the LayerCreationParams. The assumption with this AutoZoomOnEmpty property is that there is only a single data source (and consequently only a single layer) being added to the map. Because you are specifying a lyrx file it is possible that there is more than one data source and layer being added . The code and AutoZoomOnEmpty property works as expected if the LayerCreationParams uri points to a single data source (such as a feature class or table in a geodatabase). Having said that, if you know that your lyrx file contains a single layer then the following is a possible workaround if you still wish to use a lyrx file. var layerdoc = new LayerDocument(path_to_lyrx_file);
var cimLayerDoc = layerdoc.GetCIMLayerDocument();
var layerDefs = cimLayerDoc.LayerDefinitions;
var layerDef = layerDefs[0];
var dataConnection = (layerDef as CIMFeatureLayer).FeatureTable.DataConnection;
LayerCreationParams lyrParams = new(dataConnection);
lyrParams.AutoZoomOnEmptyMap = false;
LayerFactory.Instance.CreateLayer<Layer>(lyrParams, map); I'll add an issue into our backlog to examine updating the code to take a lyrx file uri into account. Narelle
... View more
03-27-2024
09:08 PM
|
0
|
1
|
3788
|
|
POST
|
Hi, Unfortunately we do not currently have any functionality to show custom help topics for MapTools. I will add an issue to our backlog to include this functionality. Regards Narelle
... View more
03-20-2024
04:31 PM
|
4
|
2
|
1373
|
|
POST
|
Hi Dave, One way of having a sketch tool allow multiple clicks without using the Line sketch is to use the Multipoint geometry type. You can then override the OnSketchModifiedAsync callback to force the sketch to finish after your required number of clicks (in this case 2). Here's a small snippet that sounds like what you're looking for. internal class LeaderLineTool : MapTool
{
public LeaderLineTool()
{
IsSketchTool = true;
SketchType = SketchGeometryType.Multipoint;
SketchOutputMode = SketchOutputMode.Map;
}
protected override Task OnToolActivateAsync(bool active)
{
return base.OnToolActivateAsync(active);
}
protected override async Task<bool> OnSketchModifiedAsync()
{
var sketchGeom = await GetCurrentSketchAsync();
if (sketchGeom is Multipoint multiPoint)
{
var ptCount = multiPoint.Points.Count;
// force the sketch to finish if there are more than 2 points
if (ptCount >= 2)
FinishSketchAsync();
}
return true;
}
protected override Task<bool> OnSketchCompleteAsync(Geometry geometry)
{
if (geometry is Multipoint multiPoint)
{
// check the point count
// user could have finished the sketch with less than the
// required 2 points
var ptCount = multiPoint.Points.Count;
if (ptCount < 2)
{
return Task.FromResult(true);
}
var firstPoint = multiPoint.Points[0];
var secondPoint = multiPoint.Points[1];
// first point for leader line location
// second point for callout location
}
return base.OnSketchCompleteAsync(geometry);
}
} Narelle
... View more
02-21-2024
04:10 PM
|
0
|
0
|
1272
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 07-27-2025 06:04 PM | |
| 1 | 03-24-2025 06:53 PM | |
| 1 | 08-08-2024 09:44 PM | |
| 1 | 07-18-2024 04:46 PM | |
| 1 | 06-04-2024 07:18 PM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|