|
BLOG
|
Also, https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#ui-controls
... View more
01-30-2017
05:18 PM
|
0
|
0
|
636
|
|
POST
|
Adding an individual callout is only possible in Layout (eg. see here: http://pro.arcgis.com/en/pro-app/help/layouts/add-and-modify-graphics-and-text.htm). Otherwise, for a map, labeling is applied to a layer as a whole. Different labelling classes can be defined as part of a given layer labeling definition (eg based on an attribute or similar) but I don't think that is what you are after.
... View more
01-23-2017
04:12 PM
|
0
|
0
|
803
|
|
POST
|
Hi Andreas, might I suggest starting here: Create MapPoint https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geometry#construct-a-mappoint Projection: https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geometry#project-from-wgs84-to-webmercator Zoom, Pan, etc. https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-MapExploration#zoom-to-an-extent and so, one example might be..... QueuedTask.Run(() => { //Create a point var pt = MapPointBuilder.CreateMapPoint(x,y,SpatialReferenceBuilder.CreateSpatialReference(4326)); //Buffer it - for purpose of zoom var poly = GeometryEngine.Buffer(pt, buffer_size); //do we need to project the buffer polygon? if (!MapView.Active.Map.SpatialReference.IsEqual(poly.SpatialReference)) { //project the polygon poly = GeometryEngine.Project(poly, MapView.Active.Map.SpatialReference); } //Zoom - add in a delay for animation effect MapView.Active.ZoomTo(poly,new TimeSpan(0, 0, 0, 3)); });
... View more
01-23-2017
02:22 PM
|
1
|
0
|
2290
|
|
POST
|
Hi Andreas, can you be more specific please? You want to....zoom, pan to the location, select something at a location, show a dot (or similar) on a map "at" the location or...?
... View more
01-23-2017
12:05 PM
|
0
|
1
|
2290
|
|
POST
|
If you need to know the location of an external file it is best to have users install the file to a well-known location (well-known to your Add-in). DotNet has a special enumeration for a series of "special folders" the System.Environment.SpecialFolder Enumeration that can be resolved on any machine. Users copy your file to a particular "special" location (eg My Documents) within which your Add-in always looks for the file. If you desire something more sophisticated, then an installer is required. An installer copies the file to a folder location of the user's choice and records the location in a registry key which your Add-in accesses. The installer would also install your Add-in. This is a very common pattern for file deployment and discovery. Visual Studio has a project template for creating installers called "Setup and Deployment". You'll find it under "Other Project Types".
... View more
01-03-2017
11:13 AM
|
0
|
0
|
1052
|
|
POST
|
Assuming that you want to deploy your file with the Addin archive (and not separately) you can find details here: ProGuide-content-and-image-resources#document-content. In brief, you set the "Copy to Output Directory" property on the text file to "Copy Always" and read the file from the assembly cache. There is code in the ProGuide showing you what to do. However, in your case, that is probably overkill. Given your content is text I would add the "myaddin.txt" as a Resource to your solution: Add a resource file to your VS project (usually called Resource1.resx by default) Open it in the Visual Studio Designer (double click on it in the solution explorer) Under the "Add Resource" menu select "Add New Text File" and name it "myaddin" (see image) (or use the 'add existing file...' - your choice) The new text file will open in Visual Studio, copy and paste your content into the text file Save and build the project Now, in your code you can access the file content directly off the resource class like so: var file_content = Resource1.myaddin;
... View more
12-30-2016
12:37 PM
|
0
|
2
|
1052
|
|
POST
|
The screenshot shows "corsshair". The DAML shows "crosshair"... Generally speaking, if the content type is set to 'AddinContent' the images will be copied to a folder called "Images" within the archive (.esriAddinX) (given a containing folder called "Images" in the solution) which is, in turn, usually deployed to your C:\Users\username\Documents\ArcGIS\AddIns\ArcGISPro\{Addin-id} folder . They are not copied to the assembly cache. More information on Add-in resources can be found here: ProGuide-content-and-image-resources
... View more
12-29-2016
11:23 PM
|
0
|
1
|
1374
|
|
POST
|
Can you post a complete code snippet and we will attempt to reproduce. Also....this is 1.3? Thanks
... View more
12-21-2016
09:53 AM
|
0
|
1
|
793
|
|
POST
|
Gotcha, Ok so: 1. When the obsolete object will be purged from the next version, the code won't work anymore The obsolete class will still work at 1.4 (we have to keep it working or else it would break the API). It will be deprecated at the next major release which is a "2.0", not a 1.5, 1.6, 1.x, etc. which would be considered minor releases 2. All documentation I have found are only for the obsolete object (PortalManager) and nothing for the new recommended object (ArcGisPortalManager,) Alpha snapshots do not have doc so, yes, you are definitely on the bleeding edge on a snapshot. I have copy/pasted a few things below. The samples will be switched to use ArcGISPortalManager, ArcGISPortal with EsriHttpClient and not deprecated class(es) at 1.4. Documentation is released with the final version. 3. (This may get fixed in next releases, but) some of ArcGisPortalManager methods do not work on any thread... Definitely sounds like a bug in the alpha3. ArcGISPortalManager.Current and ArcGISPortal instances can be used on any thread at 1.4 final. Also, upgrade your snapshot to alpha4 if that is available. >>>>>>>>>>>>>>>>>> ArcGISPortalManager: Get the Current Active Portal var active_portal = ArcGISPortalManager.Current.GetActivePortal();
string uri = active_portal.PortalUri.ToString(); ArcGISPortal: Get the Current Signed-on User
var user = active_portal.GetSignOnUsername(); ArcGISPortalManager: Get a list of all your Portals var portals = ArcGISPortalManager.Current.GetPortals();
//Make a list of all the Uris
var portalUris = portals.Select(p => p.PortalUri.ToString()).ToList(); ArcGISPortalManager: Add a portal to the list of portals var portalUri = new Uri("http://myportal.esri.com/portal/", UriKind.Absolute);
ArcGISPortalManager.Current.AddPortal(portalUri); ArcGISPortalManager: Get a portal and Sign In, Set it Active //Find the portal to sign in with using its Uri...
var portal = ArcGISPortalManager.Current.GetPortal(new Uri(uri, UriKind.Absolute));
if (!portal.IsSignedOn()) {
//Calling "SignIn" will trigger the OAuth popup if your credentials are
//not cached (eg from a previous sign in in the session)
if (portal.SignIn().success) {
//Set this portal as my active portal
ArcGISPortalManager.Current.SetActivePortal(portal);
}
} ArcGISPortalManager:Listen for the Portal Events ArcGIS.Desktop.Core.Events.ActivePortalChangedEvent.Subscribe((args) => {
var active_uri = args.ActivePortal?.PortalUri.ToString();
//etc
});
ArcGIS.Desktop.Core.Events.ArcGISPortalAddedEvent.Subscribe((args) => {
var added_portal = args.Portal;
//etc
});
ArcGIS.Desktop.Core.Events.ArcGISPortalRemovedEvent.Subscribe((args) => {
var old_uri = args.RemovedPortalUri;
//etc
});
... View more
12-12-2016
01:03 PM
|
2
|
0
|
1279
|
|
POST
|
Your code, as such, looks ok. The alpha 3 snapshot likely has bugs. You should have access to the alpha 4 snapshot otherwise please re-try on 1.4 final (available dec, jan).
... View more
12-12-2016
11:35 AM
|
0
|
2
|
1279
|
|
POST
|
Benoit, this is not possible until 1.4. Then you can derive from ArcGIS.Desktop.Framework.Controls.ProWindow which will give you what you need.
... View more
11-28-2016
12:16 PM
|
1
|
0
|
655
|
|
POST
|
I cannot reproduce your error. I opened a new project with the World Topo base map. Can you change your code as follow please: (this will allow you to catch the exception): protected async override void OnClick() { try { await QueuedTask.Run.... Also, is there a base map currently drawn in your project or a blank map display? Is the map 2D or 3D?
... View more
10-31-2016
03:38 PM
|
1
|
1
|
2574
|
|
POST
|
Sounds like a timing issue. That is, running on the VM is changing the sequence of execution in the Add-in. From the exception you are making an Async call that you are not awaiting. That async call is failing when you are running on the VM (but I have no idea why). If you use the debugger and look at the inner exceptions property it may give you the actual exception that faulted the task. That said, if you do "await" the async call you can bracket it with a standard "try { } catch" block to trap the exception. I will need to see your code to assist further.
... View more
10-31-2016
08:54 AM
|
0
|
3
|
2574
|
|
POST
|
Hi Horia, so see if this helps: Basically, when trying to reverse engineer what is in the CIM - especially the symbology - it is useful to look at the XML in the debugger. So to see how the fill is handled in a polygon symbol, for example, we can use the factory to make a symbol and then disect its parts like so: CIMStroke outline = SymbolFactory.ConstructStroke(CIMColor.CreateRGBColor(0, 0, 0, trans), 2.0, SimpleLineStyle.Solid); CIMPolygonSymbol fillWithOutline = SymbolFactory.ConstructPolygonSymbol(ColorFactory.RedRGB, SimpleFillStyle.Cross, outline); var xml = fillWithOutline.ToXml(); Then we can set our breakpoint right after the line: "var xml = ....." (or right after). Now we can inspect the symbol: The basic structure is like so: An outline and two hatch fills in this case and we can inspect the hatch fills to see how they are made also. Okay, so now we will use this knowledge in our code to allow us to customize some of the symbol properties. I am using the same "Renderer From Scratch" sample as previously in the other post - https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/CIMExamples - modifying "CreateCIMRendererFromScratch.cs": First a method to make a custom hatch fill: internal static CIMFill ConstructHatchFillEx(CIMStroke stroke, double angle, double separation, double transparency) { return new CIMHatchFill() { Enable = true, Rotation = angle, Separation = separation, LineSymbol = new CIMLineSymbol() { SymbolLayers = new CIMSymbolLayer[1] { stroke } } } ; } Second, a method to make a custom polygon symbol: internal static CIMSymbol ConstructPolygonSymbolEx(IEnumerable<CIMFill> hatchPattern, CIMStroke outline = null) { List<CIMSymbolLayer> symbolLayers = new List<CIMSymbolLayer>(); if (outline != null) symbolLayers.Add(outline); foreach (var fill in hatchPattern) symbolLayers.Add(fill); return new CIMPolygonSymbol() { SymbolLayers = symbolLayers.ToArray() }; } Now, some code that uses it: var trans = 50.0;//semi transparent CIMStroke outline = SymbolFactory.ConstructStroke(CIMColor.CreateRGBColor(0, 0, 0, trans), 2.0, SimpleLineStyle.Solid); //Some different strokes to play with var dash = SymbolFactory.ConstructStroke(CIMColor.CreateRGBColor(255, 170, 0, trans), 1.0, SimpleLineStyle.Dash); var solid = SymbolFactory.ConstructStroke(CIMColor.CreateRGBColor(255, 0, 0, trans), 1.0, SimpleLineStyle.Solid); var dashDot = SymbolFactory.ConstructStroke(CIMColor.CreateRGBColor(85, 255, 0, trans), 1.0, SimpleLineStyle.DashDotDot); //Some different hatch fills to play with //Mimic cross hatch CIMFill[] crossHatch = { ConstructHatchFillEx(dash, 0.0, 5.0, trans), ConstructHatchFillEx(dash, 90.0, 5.0, trans) }; //Mimic diagonal cross CIMFill[] diagCross = { ConstructHatchFillEx(solid, 45.0, 5.0, trans), ConstructHatchFillEx(solid, -45.0, 5.0, trans) }; CIMFill[] diagonal = { ConstructHatchFillEx(dashDot, 45.0, 5.0, trans) }; //Now we will use them var alaska = new CIMUniqueValueClass() { Values = alaskaValues.ToArray(), Label = "Alaska", Visible = true, Editable = true, Symbol = new CIMSymbolReference() { Symbol = ConstructPolygonSymbolEx(crossHatch, outline) } }; classes.Add(alaska); etc, etc. Note: I wrote a blog post on GeoNet about the CIMViewer - https://community.esri.com/groups/arcgis-pro-sdk/blog/2016/08/04/arcgis-pro-cim-viewer a sample you can download from here: https://github.com/Esri/arcgis-pro-sdk-cim-viewer There are instructions on the github on compiling it, etc. It is an Add-in. Once installed you can manually set the properties, etc. you want on the layer or map via the UI and then inspect the CIM with the CIMViewer to see which properties, etc. you need to set in your code to automate what was done with the UI.
... View more
09-30-2016
04:47 PM
|
0
|
0
|
1963
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 2 | 12-17-2025 11:33 AM | |
| 1 | 12-17-2025 01:16 PM | |
| 1 | 10-14-2025 05:01 PM |
| Online Status |
Offline
|
| Date Last Visited |
Saturday
|