|
POST
|
I used to use FeaturePoint.PutCoords(pPoint.X, pPoint.Y) to change the coordinates of a point with ArcObjects. Does anyone know the ArcPro method for doing the same thing?? Thanks,
... View more
09-05-2017
12:31 PM
|
0
|
1
|
805
|
|
POST
|
Thanks Uma. That is working now. Do you know if there is a similar method that will move the feature to a specific coordinate?? Or is there a built-in method for calculating the offset between two coordinates??
... View more
09-05-2017
11:26 AM
|
0
|
7
|
2552
|
|
POST
|
Hi, i'm having some trouble trying to figure out how to move a bunch of selected features from a specific point layer in the map. This is what I have so far: //****Get all of the selected ObjectIDs from the VLS layer. var abLayer = MapView.Active.Map.FindLayers("GISWRKS1.WORKS.AsBuilts").First() as BasicFeatureLayer; var selection = abLayer.GetSelection(); IReadOnlyList<long> selectedOIDs = selection.GetObjectIDs(); //save the selected OBJECTIDs to a list. var insp = new ArcGIS.Desktop.Editing.Attributes.Inspector(); //create the Inspector var moveFeature = new EditOperation(); moveFeature.Name = "Move AsBuilts"; //Loop through each selected OBJECTID foreach (var oid in selectedOIDs) { insp.Load(abLayer, oid); moveFeature.Move(..............); //**** This is where I get stuck....I don't know what to do } I think my approach is all wrong, but I'm not sure what to do. I'm not exactly sure how to interpret this: ArcGIS Pro 2.0 API Reference Guide Thanks
... View more
08-22-2017
12:49 PM
|
1
|
13
|
3646
|
|
POST
|
Hi, For anyone interested, this seems to work. If you know of another way, please post it below. IEnumerable<Layer> layerCheck = MapView.Active.Map.GetLayersAsFlattenedList().Where(l => l.Name.IndexOf("GISWRKS1.WORKS.VLS_Points", StringComparison.CurrentCultureIgnoreCase) >= 0); int count = layerCheck.OrderBy(l => l).Count(); if (count < 1) { ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("Please add the VLS Layer to the map.", "Missing Layer"); return; }
... View more
08-21-2017
12:30 PM
|
1
|
0
|
2218
|
|
POST
|
Hi, What is the best way to determine if a layer exists or not? I have some code that runs on a specific layer, but I don't want Arc to crash if the layer doesn't exist when the user presses the button. Can anyone suggest a check to go through before the code below runs that will check for the layers existence? I would think evaluating MapView.Active.Map.FindLayers("GISWRKS1.WORKS.VLS_Points") to a boolean would work, but I can't seem to get it to. var vlsLayer = MapView.Active.Map.FindLayers("GISWRKS1.WORKS.VLS_Points").First() as BasicFeatureLayer; var selection = vlsLayer.GetSelection(); IReadOnlyList<long> selectedOIDs = selection.GetObjectIDs(); //save the selected OBJECTIDs to a list. Thanks!
... View more
08-21-2017
11:02 AM
|
0
|
2
|
2894
|
|
POST
|
Hi Uma, Thanks so much!! After reading through the articles, I now understand how things are working and was able to get it fixed.
... View more
08-21-2017
07:34 AM
|
0
|
0
|
1021
|
|
POST
|
So I'm trying to get a MapTool and a Button (compiled in different projects) onto the same Ribbon (not the generic 'Add-In' ribbon. I have read through the post here, but still need some guidance. I seem to be able to create either tool on it's own ribbon, but to have both appear on the same one is more challenging. Here is my Config.daml code for each one. First One: <ArcGIS defaultAssembly="StreetView_ArcPro.dll" defaultNamespace="StreetView_ArcPro" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd"> <AddInInfo id="{5c21165c-68de-45d3-ab9d-ee7174380d4f}" version="1.0" desktopVersion="2.0.8933"> <Name>StreetView_ArcPro</Name> <Description>StreetView_ArcPro description</Description> <Image>Images\AddinDesktop32.png</Image> <Author>bulla_b</Author> <Company>Region of Durham</Company> <Date>31/7/2017 9:43:01 AM, 2017</Date> <Subject>Framework</Subject> <!-- Note subject can be one or more of these topics: Content, Framework, Editing, Geodatabase, Geometry, Geoprocessing, Layouts, Map Authoring, Map Exploration --> </AddInInfo> <modules> <insertModule id="StreetView_ArcPro_Module" className="Module1" autoLoad="false" caption="Module1"> <!-- uncomment to have the control hosted on a separate tab--> <tabs> <tab id="StreetView_ArcPro_Tab1" caption="Google Street View" keytip="T1"> <group refID="Google_Streetview_Group" /> </tab> </tabs> <groups> <!-- comment this out if you have no controls on the Addin tab to avoid an empty group--> <group id="Google_Streetview_Group" caption="Google Street View" keytip="G1"> <!-- host controls within groups --> <button refID="StreetView_ArcPro_Dockpane_ShowButton" size="large" /> <tool refID="StreetView_ArcPro_StreetView_Tool" size="large" /> </group> </groups> <controls> <!-- add your controls here --> <tool id="StreetView_ArcPro_StreetView_Tool" caption="Google Street View" className="StreetView_Tool" loadOnClick="true" smallImage="Images\Google-Earth-icon 16.png" largeImage="Images\Google-Earth-icon 32.png" condition="esri_mapping_mapPane" keytip="B1"> <tooltip heading="Google Street View Tool">Click on map to show Google Street View location in side panel.<disabledText /></tooltip> </tool> <button id="StreetView_ArcPro_Dockpane_ShowButton" caption="Open Street View Pane" className="Dockpane_ShowButton" loadOnClick="true" smallImage="Images\open_in_new_window.png" largeImage="Images\open_in_new_window.png" keytip="B2"> <tooltip heading="Show Side Panel">Click to open/activate Google Street View side panel.<disabledText /></tooltip> </button> </controls> <dockPanes> <dockPane id="StreetView_ArcPro_Dockpane" caption="Google Street View" className="DockpaneViewModel" dock="group" dockWith="esri_core_contentsDockPane"> <content className="DockpaneView" /> </dockPane> </dockPanes> </insertModule> </modules> </ArcGIS> and the Second One: <ArcGIS defaultAssembly="CardIndex_ArcPro.dll" defaultNamespace="CardIndex_ArcPro" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd"> <AddInInfo id="{30619449-054e-498f-9d2f-4bdb06959d30}" version="1.0" desktopVersion="2.0.8933"> <Name>CardIndex_ArcPro</Name> <Description>CardIndex_ArcPro description</Description> <Image>Images\AddinDesktop32.png</Image> <Author>bulla_b</Author> <Company>Region of Durham</Company> <Date>17/8/2017 1:24:34 PM, 2017</Date> <Subject>Framework</Subject> <!-- Note subject can be one or more of these topics: Content, Framework, Editing, Geodatabase, Geometry, Geoprocessing, Layouts, Map Authoring, Map Exploration --> </AddInInfo> <modules> <insertModule id="CardIndex_ArcPro_Module" className="Module1" autoLoad="false" caption="Module1"> <!-- uncomment to have the control hosted on a separate tab--> <tabs> <!--<tab id="CardIndex_ArcPro_Tab1" caption="New Tab"> <group refID="CardIndex_ArcPro_Group1"/> </tab>--> </tabs> <groups> <!-- comment this out if you have no controls on the Addin tab to avoid an empty group *** CardIndex_ArcPro_Group1--> <group id="CardIndex_ArcPro_Group1" caption="Map Tools" appearsOnAddInTab="true"> <!-- host controls within groups --> <button refID="CardIndex_ArcPro_CardIndex_Button" size="large" /> </group> </groups> <controls> <!-- add your controls here --> <button id="CardIndex_ArcPro_CardIndex_Button" caption="Card Index" className="CardIndex_Button" loadOnClick="true" smallImage="Images\ace-logo2.png" largeImage="Images\ace-logo2.png"> <tooltip heading="Card Index Tool:">Opens scanned drawing for selected WaterMain and Sewer Pipes.<disabledText /></tooltip> </button> </controls> </insertModule> </modules> </ArcGIS> I don't really care if the first one goes on the second one, or the second one goes on the first one. If someone could please explain the logic behind this is supposed to work, and some code hints/fixes I would appreciate it. Thanks!
... View more
08-18-2017
11:46 AM
|
0
|
2
|
1339
|
|
POST
|
Hmmmm.....and it seems like the WebBrowser control is not capable of handling Google Streetview. I can get it to Navigate to other pages, but a link to Google Streetview causes nothing but problems. Oh well....at least I know how a DockPane works now!!
... View more
08-08-2017
07:26 AM
|
0
|
0
|
2830
|
|
POST
|
Thanks for the help. I'm a bit confused by your explanation of DockpaneView and DockpaneViewModel, but I'm trying to work with what you have posted. Things are definitely closer to working. I had some troubles getting your code to work, but once I added the _this = this; in the DockpaneView:UserControl I was good. I no longer get errors, but the WebControl is not refreshing with the new URL based on the Lat/Long of the mouse click.
... View more
08-08-2017
06:35 AM
|
0
|
0
|
2830
|
|
POST
|
Hi Wolfgang, Yes, I have the DockPane added already, and I can see the initial URL ("http://maps.google.ca") appear in the WebBrowser control. My problem is that I cannot get the control to update with a new URL once I click on the map. I'm not sure if am referencing the DockPane properly in order to update the control that is on it. I am trying this now, but still with no luck. DockPane paneIT = FrameworkApplication.DockPaneManager.Find("StreetView_ArcPro_Dockpane"); DockpaneView pane = paneIT; pane.SetMapLocation(lng, lat); It's basically a guessing game for me at this point.
... View more
08-04-2017
12:37 PM
|
0
|
2
|
2830
|
|
POST
|
Following the BingStreetside sample on GitHub, I have created a MapTool and a DockPane. On the DockPaneI have a WebBroswer control that I want to update when I click on the map with the MapTool. I am having troubles referencing the DockPanel from the MapTools click event. Here is a snippet of the Dockpane.xaml for the WebBrowser: <Grid Margin="0"> <WebBrowser x:Name="streetViewControl" Margin="0" /> </Grid> Here is the code I am using in Dockpane.xaml.cs: namespace StreetView_ArcPro { /// <summary> /// Interaction logic for DockpaneView.xaml /// </summary> public partial class DockpaneView : UserControl //public partial { public DockpaneView() { InitializeComponent(); streetViewControl.Navigated += StreetViewControl_Navigated; streetViewControl.Navigate("http://maps.google.ca"); } public void SetMapLocation(double lng, double lat) { streetViewControl.Navigate(@"http://maps.google.ca/maps?q=" + lat + "," + lng + "&num1&s11=" + lat + "," + lng + "&sspn=16.71875,56.536561&ie=UTF8&ll=" + lat + "," + lng + "&spn=0.020401,0.028753&z=15&layer=c&cbll=" + lat + "," + lng + "&panoid=&cbp=12,161.92,,0,5"); } private void StreetViewControl_Navigated(object sender, NavigationEventArgs e) { MessageBox.Show("Navigated"); } } } And here is the code for the MapTool. See comments for where I am running into problems: namespace StreetView_ArcPro { public class StreetView_Tool : MapTool { public StreetView_Tool() { IsSketchTool = true; SketchType = SketchGeometryType.Point; SketchOutputMode = SketchOutputMode.Map; } protected override Task OnToolActivateAsync(bool active) { return base.OnToolActivateAsync(active); } protected override Task<bool> OnSketchCompleteAsync(Geometry geometry) { double lat; double lng; var coord = GeometryEngine.Instance.Project(geometry, SpatialReferences.WGS84) as MapPoint; if (coord != null) { lng = coord.X; lat = coord.Y; //**********This is where I want to call the SetMapLocation on the DockPane, but I have no idea how to do it*********** //**********This next two line do not give me errors, but it just doesn't work.******* var sample = new DockpaneView(); sample.SetMapLocation(lng, lat); } var ret = QueuedTask.Run(() => { return true; } ); return ret; //return base.OnSketchCompleteAsync(geometry); } } } Any assistance is appreciated. Thanks!
... View more
08-04-2017
12:10 PM
|
0
|
5
|
3636
|
|
POST
|
So I guess I am answering my own question, but by scouring through more of the SDK samples on GitHub, I came up with this: protected override Task<bool> OnSketchCompleteAsync(Geometry geometry) { double lat; double lng; var coord = GeometryEngine.Instance.Project(geometry, SpatialReferences.WGS84) as MapPoint; if (coord != null) { lng = coord.X; lat = coord.Y; <more code here..................................> Previously I was using the HandleMouseDown event, but this event gives me the Geometry of the click, which is exactly what I was looking for. Then I just have to Project it. Much simpler than my first attempt. Hopefully this helps someone else.
... View more
08-02-2017
10:16 AM
|
0
|
1
|
1012
|
|
POST
|
Hi Wolfgang, Thanks for clarifying. I'm in the process of converting ArcObjects Add-Ins to ArcPro. We have about 20 Add-Ins that will need to be converted, so at least I'm clear on what to do moving forward. Thanks!
... View more
08-02-2017
10:05 AM
|
0
|
0
|
2076
|
|
POST
|
To my knowledge (and my limited experience with the 1 Add-In I created for ArcPro), you will need to recompile all of your ArcPro add-ins each time a new version of ArcPro is released. Hopefully this is just part of the 'growing pains' of the application and will be resolved going forward. My guess is that the API is constantly changing and that is why it is required?? I don't remember needing to that with custom .NET coding in ArcObjects.
... View more
08-02-2017
06:40 AM
|
0
|
2
|
2076
|
|
POST
|
Hi, I'm converting some code from ArcObjects to ArcPro. The following bit of code is working. It converts a point clicked on by the user, to decimal degrees, but I'm sure there is a smoother way to do this. var mousePoint = MapView.Active.ClientToMap(e.ClientPoint); ToGeoCoordinateParameter ddParam = new ToGeoCoordinateParameter(GeoCoordinateType.DD); string geoString = mousePoint.ToGeoCoordinateString(ddParam); ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(geoString); string[] mapPoint = geoString.Split(' '); mapPoint[0] = mapPoint[0].Remove(mapPoint[0].Length - 1); //the N mapPoint[1] = "-" + mapPoint[1].Remove(mapPoint[1].Length - 1); //the W; use the '-' to change it from Easting What would the proper way be to take mousePoint and convert/transform it to DD. Thanks,
... View more
07-31-2017
12:39 PM
|
0
|
2
|
1278
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 08-18-2023 08:57 AM | |
| 1 | 04-19-2018 05:53 AM | |
| 1 | 04-13-2018 10:07 AM | |
| 1 | 04-13-2018 10:04 AM | |
| 1 | 04-13-2018 05:56 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-20-2025
03:53 PM
|