|
POST
|
Hi Susan You could use the LayerFactory's CopyLayer method. var lyrToCopy = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
await QueuedTask.Run(
() => {
if (LayerFactory.Instance.CanCopyLayer(lyrToCopy))
LayerFactory.Instance.CopyLayer(lyrToCopy, MapView.Active.Map);
}); Thanks Uma
... View more
09-05-2019
10:01 AM
|
2
|
2
|
2825
|
|
POST
|
Hi Sai, Than, It is not possible to display just a subset of the coordinate systems in the Coordinate system picker control. Thanks Uma
... View more
09-05-2019
08:24 AM
|
1
|
2
|
2886
|
|
POST
|
Hi Dragging from Contents pane is not yet supported using the public API. It will be available with 2.5 that is scheduled to be released in Jan 2020. In the meantime, the code below will work but it uses some internal namespaces. Extension methods: using ArcGIS.Desktop.Framework.DragDrop;
using ArcGIS.Desktop.Internal.Mapping.TOC;//note the “Internal”
using ArcGIS.Desktop.Mapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DragAndDrop.Helpers
{
public static class DragDropExtensions
{
public static bool HasTOCContent(this DropInfo dropInfo)
{
return dropInfo?.Data is TOCDragPayload; //This class is in an internal namespace
}
public static List<MapMember> GetTOCContent(this DropInfo dropInfo)
{
if (!HasTOCContent(dropInfo))
return new List<MapMember>();
var tocPayload = dropInfo.Data as TOCDragPayload;
//get the content
return tocPayload.ViewModels.Select(vm => vm.Model).OfType<MapMember>()?.ToList() ?? new List<MapMember>();
}
public static List<T> GetTOCContentOfType<T>(this DropInfo dropInfo) where T: MapMember
{
return GetTOCContent(dropInfo).OfType<T>()?.ToList() ?? new List<T>();
}
public static string GetMapUri(this DropInfo dropInfo)
{
return HasTOCContent(dropInfo) ? ((TOCDragPayload)dropInfo.Data).SourceMapURI : string.Empty;
}
}
}
Usage: public override async void OnDrop(DropInfo dropInfo)
{
if (dropInfo.HasTOCContent())//extension method
{
var mm = dropInfo.GetTOCContent();//extension method - returns all MapMembers being dropped
//get just feature layers, for example
var layers = dropInfo.GetTOCContentOfType<FeatureLayer>(); //extension method
//which, honestly, is the same as doing this...so take your pick...
var layers2 = mm.OfType<FeatureLayer>()?.ToList() ?? new List<FeatureLayer>();
//and then ditto for StandaloneTable, ElevationSurface, LabelClass, etc.
//last, get the source map to which the map members belong
var mapuri = dropInfo.GetMapUri();
//99 times out of a 100 this will be the active view map....
//but, if not, get the actual map (or scene) this way
var map = FrameworkApplication.Panes.OfType<IMapPane>()?.Select(mp => mp.MapView.Map)
.Where(m => m.URI == mapuri).First();
}
Thanks Uma
... View more
09-04-2019
10:47 AM
|
0
|
0
|
4864
|
|
POST
|
Hi Richard, Of course! Here is how I made this work: I first picked the map scale at which I want my symbol to draw at the desired size. In the screenshot below, I picked the map scale of 1:1,650,255. In my code, I then used this this scale as the "Map Reference scale". The map will now use this scale and as you zoom in and out, the symbol size will be resized. Screenshot below: Here is the code I used: protected override async void OnClick()
{
var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(f => f.ShapeType == esriGeometryType.esriGeometryPoint).FirstOrDefault();
await QueuedTask.Run(() => {
var symbol = CreateSymbol();
var renderer = lyr.GetRenderer() as CIMSimpleRenderer;
renderer.Symbol = symbol.MakeSymbolReference();
lyr.SetRenderer(renderer);
MapView.Active.Map.SetReferenceScale(1650255);
});
}
private CIMPointSymbol CreateSymbol()
{
CIMCharacterMarker marker = SymbolFactory.Instance.ConstructMarker(
57,
"ESRI Business",
"Regular",
15,
ColorFactory.Instance.BlackRGB) as CIMCharacterMarker;
var symbol = SymbolFactory.Instance.ConstructPointSymbol(marker);
symbol.UseRealWorldSymbolSizes = true;
symbol.SetSize(23.75);
return symbol;
}
}
... View more
09-04-2019
08:51 AM
|
2
|
3
|
3594
|
|
POST
|
Hi Richard, UseRealWorldSymbolSizes property allows you to use Map Units to size the symbol instead of Pixels. To allow your symbols to scale based on zoom level of the map, use Map reference scales. Thanks Uma
... View more
08-29-2019
11:04 AM
|
0
|
5
|
3594
|
|
POST
|
Hi Here is a snippet to add a WMS service to Pro: Add a WMS service Thanks Uma
... View more
08-26-2019
11:35 AM
|
0
|
0
|
1115
|
|
POST
|
Hi Than At this time Configurations cannot be used to "extend" or "modify" other add-ins. Thanks Uma
... View more
08-21-2019
03:24 PM
|
0
|
3
|
1708
|
|
POST
|
Hi Frank You can use the LayerAddedEvent in the ArcGIS.Desktop.Mapping assembly. The arcgis-pro-sdk-community-samples repo has a couple of samples that uses this event also. 1. TextSymbols sample 2. FeatureSelection sample Thanks Uma
... View more
08-20-2019
11:19 AM
|
2
|
0
|
3203
|
|
POST
|
Hi Alex, I investigated this and I am afraid this is not possible to accomplish at this time. Thanks Uma
... View more
08-13-2019
10:18 AM
|
0
|
1
|
2769
|
|
POST
|
Hi Frank, The loadOnClick attribute only determines when the button should be created by the framework. Thanks Uma
... View more
08-13-2019
05:55 AM
|
0
|
0
|
3005
|
|
POST
|
Hi Frank, In your add-in's config.daml, set the "autoLoad" attribute to true and the button element's loadOnClick attribute to false to accomplish this. ..
<modules>
<insertModule id="QueryBuilderControl_Module" className="Module1" autoLoad="true" caption="Module1">
.... <controls>
<!-- add your controls here -->
<button id="QueryBuilderControl_DefinitionQueryDockPane_ShowButton" loadOnClick="false" caption="Show DefinitionQueryDockPane" ...>
<tooltip heading="Show Dockpane">Show Dockpane<disabledText /></tooltip>
</button>
</controls> Thanks Uma
... View more
08-12-2019
07:07 AM
|
1
|
0
|
3005
|
|
POST
|
Hi Than The ability to add folder connections to the "Favorites" is slated to be available with 2.5 release. But in the meantime, you can definitely re-use the esri_geodatabase_addFolderConnectionToFavoritesButton button in your customization. Thanks Uma
... View more
08-09-2019
08:39 AM
|
0
|
1
|
3618
|
|
POST
|
Hi, There is no way to remove the Customize QAT button at this point. We will look into adding this for the future. Thanks Uma
... View more
08-09-2019
08:15 AM
|
0
|
3
|
2769
|
|
POST
|
Thanks David. I now see the problem with the font. ttf fonts (example: Google Fonts ) seems to work. I will post on this thread with updates. Thanks Uma
... View more
08-09-2019
06:37 AM
|
1
|
0
|
15023
|
|
POST
|
Hi Can you please provide me with more info so I can reproduce this issue? 1. What font are you installing? 2. In ArcGIS Pro, how do you use this font? (Via the Labeling, Layouts, Symbology pane, etc). I am trying it with some of the fonts from Google, and I am able to access it from Pro in the above mentioned dockpanes after I restart the application. If you could give me a little more information, I can inform the Fonts team to report the issue. Thanks Uma
... View more
08-09-2019
06:16 AM
|
0
|
2
|
15023
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-14-2026 09:54 AM | |
| 1 | 01-21-2026 10:48 AM | |
| 1 | 09-18-2025 03:09 PM | |
| 1 | 11-04-2025 08:25 AM | |
| 1 | 09-23-2025 09:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
Thursday
|