|
POST
|
Kirk, this is a bug. Your code looks fine. We'll address it for the next release. Thanks for pointing it out.
... View more
02-23-2017
12:32 PM
|
0
|
0
|
1048
|
|
POST
|
Use LayerFactory.CreateLayer directly with the layer file....or....is that not doing what you want? https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-MapAuthoring#create-and-add-a-layer-to-the-active-map
... View more
02-23-2017
09:52 AM
|
0
|
0
|
2428
|
|
POST
|
Actually, I looked closer at your code. In retrospect, it looks like you may be overwriting your change. For MapView.Active.Map.Layers[0]
to have been changed you would have needed to have updated its definition before the
set (on flayer). Either way, the key is you have to get a definition, change it, then
set it back.
... View more
02-22-2017
09:27 AM
|
0
|
2
|
2428
|
|
POST
|
Get and Set definition are a transactional pair. That is, you have to "get" a layer's definition, change it, then "set" it (or commit it) back to the repository. Think of it like a record in a database. It has an id and some other identifier information. It cannot be shared. In your code above I would imagine that the layer in MapView.Active.Map.Layers[0] will have had its name changed to "my layer". Ditto for the code sample above.
... View more
02-22-2017
08:02 AM
|
0
|
3
|
2428
|
|
POST
|
Hi Rich, instead use the maptool AddOverlay (and AddOverlayAsync) methods. Any graphics added to the overlay will be disposed when the tool is deactivated. http://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic9990.html
... View more
02-13-2017
09:36 AM
|
0
|
0
|
1132
|
|
BLOG
|
Also, https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#ui-controls
... View more
01-30-2017
05:18 PM
|
0
|
0
|
793
|
|
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
|
1026
|
|
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
|
2822
|
|
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
|
2822
|
|
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
|
1327
|
|
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
|
1327
|
|
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
|
1668
|
|
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
|
986
|
|
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
|
1578
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Tuesday | |
| 1 | 3 weeks ago | |
| 1 | 01-08-2026 02:03 PM | |
| 1 | 01-08-2026 02:15 PM | |
| 3 | 12-17-2025 11:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|