POST
|
There is the Lock Labels option which freezes the label at their location and size...
... View more
yesterday
|
0
|
0
|
34
|
POST
|
You jumped in prematurely. You needed to go down one more level to this REST endpoint: https://services6.arcgis.com/Qptn479QktK11k72/ArcGIS/rest/services/Draft_Local_Plan_Allocations_22042020/FeatureServer/2/query Once there, enter: 1=1 for the where clause * for the out fields and lastly change the format to JSON. Click "Query (Get)" and it should return the layer as JSON which then you copy/paste into a text file and then import in Pro using the JSON to Features tool
... View more
Tuesday
|
1
|
0
|
67
|
POST
|
ESRI had announced a pending change to user types awhile back (link here) and I feel like with this AGOL update, it's finally rearing its head and biting people..
... View more
2 weeks ago
|
1
|
0
|
439
|
POST
|
Trying to figure out what I'm missing because the SDK documentation isn't quite explaining it. I'm trying to consolidate commands in my add-in to reduce the window pane dancing so I have an "edit" group where I've incorporated many of the standard edit tools. In the DAML it's set up like such: <group id="Editing_Tools" caption="Editing Tools" appearsOnAddInTab="true" keytip="ET">
<button refID="esri_mapping_selectToolPalette" size="large"/>
<button refID="esri_mapping_clearSelectionButton" size="large"/>
<button refID="esri_editing_ShowAttributes" size="large"/>
<buttonPalette refID="Editing_Tool_Commands" size="large"/>
<button refID="esri_editing_SaveEditsBtn" size="large"/>
<button refID="esri_editing_DiscardEditsBtn" size="large"/>
<button refID="esri_geoprocessing_toolsButton" size="large"/>
</group> In the middle, you can see I'm using a buttonPalette to group together can save some screen real estate. The buttonPalette has been set up like this: <palettes>
<buttonPalette id="Editing_Tool_Commands" caption="Edit Operations" dropDown="true" menuStyle="true" showItemCaption="false" keytip="BP">
<button refID="esri_editing_EditVerticesMove"/>
<button refID="esri_editing_EditVerticesRotate"/>
<button refID="esri_editing_EditVerticesScale"/>
<button refID="esri_editing_EditVerticesModifyFeature" separator="true"/>
<button refID="esri_editing_ReplaceGeometry"/>
<button refID="esri_editing_ExtendTrimFeatures"/>
<button refID="esri_editing_LineIntersection"/>
<button refID="esri_editing_SplitCommand" separator="true"/>
<button refID="esri_editing_ClipCommand"/>
<button refID="esri_editing_ExplodeFeatures"/>
<button refID="esri_editing_MergeFeatures" separator="true"/>
<button refID="esri_editing_BufferFeatures"/>
<button refID="esri_editing_CopyParallel"/>
</buttonPalette>
</palettes> I've specified the separator="true" option on a few entries so that the dropdown would show a divider between groups of edit tools. Unfortunately, when I get into Pro, the menu looks like this: None of the separators show up, so I'm wondering what I have set up incorrectly. The SDK discusses the concept of split buttons but it's unclear if those work with buttonPalettes. I get the impression from VS that it is not part of buttonPalettes. It *seems* like it is supported if you look at some of the default tools like the Explore Tool so I'm just confused how it actually gets implemented. Thanks! Steve
... View more
2 weeks ago
|
0
|
2
|
110
|
POST
|
Hi, I just came to post an update but just saw your post. I solved the issue but a different way. Again, the documentation leaves a lot to be desired which adds to confusion about all of this. The solution I stumbled across may fall in line with what you were suggesting but the curClassBreak variable was the source of the issue. Essentially, I changed how that variable is initialized within the loop. That code section is now: for (int i = 0; i < numberofClasses; i++)
{
var curClassBreak = new CIMRasterClassBreak();
if (i == 0)
{
curClassBreak.Label = "<= " + curValue.ToString();
} else if (i == (numberofClasses -1))
{
curClassBreak.Label = ">= " + curValue.ToString();
} else
{
var preVal = curValue - theIntervalSize;
curClassBreak.Label = preVal.ToString() + " - " + curValue.ToString();
}
curClassBreak.UpperBound = curValue;
curClassBreak.Color = null;
theClassBreaks[i] = curClassBreak;
curValue = curValue + theIntervalSize;
curClassBreak = null;
} I kept thinking of CIMRasterClassBreak as a collection of class break values rather than as a single, specific class break instance that's part of a greater collection. My understanding wasn't helped by the fact that when I examined the class break variable during debugging I saw a number of other properties & methods that aren't documented in the SDK (I'm guessing they're inherited since it's an array). Anyways, it now technically works as intended. The length of time it takes to accomplish this is horrible compared to the same operation using my Arcmap Add-in but I think this is tied to my lack of understanding of await/async which seems to be much greater than VB.NET or VBA from the good old days.
... View more
2 weeks ago
|
0
|
0
|
80
|
POST
|
Having some issues using CIMRasterClassBreak that are really frustrating and I can't seem to solve it. For background, I'm trying to migrate an add-in functionality from Arcmap where a user selects a raster from those loaded into the TOC, and based on a starting elevation, number of classes, and interval between the classes, it reclasses the raster for display. This is helpful for lidar where you're trying to see subtle variations in topography. Anyways, the ChangeColorizerForRasterLayer community sample largely pointed me in the right direction in terms of what part of the SDK I needed to focus on and I'm pretty much there, except for the actual task of modifying the class breaks. Here is the core code of my process: public static async Task SetToClassifyColorizer(BasicRasterLayer basicRasterLayer, Int32 numClasses, Double startElev, Double theIntervalSize)
{
// Defines values for parameters in colorizer definition.
string fieldName = "Value";
ClassificationMethod classificationMethod = ClassificationMethod.DefinedInterval;
int numberofClasses = numClasses;
string colorRampStyle = "ArcGIS Colors";
string colorRampName = "Temperature";
await QueuedTask.Run(async () =>
{
// Gets a color ramp from a style.
IList<ColorRampStyleItem> rampList = GetColorRampsFromStyleAsync(Project.Current, colorRampStyle, colorRampName);
CIMColorRamp colorRamp = rampList[0].ColorRamp;
// Creates a new Classify Colorizer Definition using defined parameters.
ClassifyColorizerDefinition classifyColorizerDef = new ClassifyColorizerDefinition(fieldName, numberofClasses, classificationMethod, colorRamp);
classifyColorizerDef.IntervalSize = theIntervalSize;
// Creates a new Classify colorizer using the colorizer definition created above.
CIMRasterClassifyColorizer newColorizer = await basicRasterLayer.CreateColorizerAsync(classifyColorizerDef) as CIMRasterClassifyColorizer;
var templateClassBreak = newColorizer.ClassBreaks[0];
var theClassBreaks = new ArcGIS.Core.CIM.CIMRasterClassBreak[numberofClasses];
var curValue = startElev;
//Manually create a replacement set of class breaks. These needs a color symbol but that will be done in a separate step so just
//asign it null for the time being
for (int i = 0; i < numberofClasses; i++)
{
var curClassBreak = newColorizer.ClassBreaks[0];
if (i == 0)
{
curClassBreak.Label = "<= " + curValue.ToString();
} else if (i == (numberofClasses -1))
{
curClassBreak.Label = ">= " + curValue.ToString();
} else
{
var preVal = curValue - theIntervalSize;
curClassBreak.Label = preVal.ToString() + " - " + curValue.ToString();
}
curClassBreak.UpperBound = curValue;
curClassBreak.Color = null;
theClassBreaks[i] = curClassBreak;
curValue = curValue + theIntervalSize;
curClassBreak = null;
}
//Now make the color ramp for the classes
var colors = ColorFactory.Instance.GenerateColorsFromColorRamp(newColorizer.ColorRamp, numberofClasses);
var c = 0;
foreach (var cbreak in theClassBreaks)
{
//assign the generated colors to each class break in turn
cbreak.Color = colors[c++];
}
newColorizer.ClassBreaks = theClassBreaks;
// Sets the newly created colorizer on the layer.
basicRasterLayer.SetColorizer(newColorizer);
});
} The loop of manually creating class breaks is where things go sideways. The code above creates a new class break with the expected number of classes but, as the loop iterates, it adds whatever the "current" value is but it also updates all previous values in the class break collection with the current value's settings. So, at the end of the loop, all values in the class break object are the same. I'm at a loss to figure out what I'm doing wrong here. Help? Steve
... View more
3 weeks ago
|
0
|
2
|
163
|
POST
|
In answer to my own question, my Googling finally brought forth a solution that worked for referencing the control. Here's how I have implemented it: private void cboLayerList_Loaded(object sender, RoutedEventArgs e)
{
var layerlist = MapView.Active.Map.GetLayersAsFlattenedList().OfType<BasicRasterLayer>();
var theCombobox = (System.Windows.Controls.ComboBox)this.FindName("cboLayerList");
theCombobox.Items.Clear();
foreach (var layer in layerlist) {
theCombobox.Items.Add(layer.Name);
}
}
... View more
3 weeks ago
|
0
|
0
|
88
|
POST
|
Now diving into the Pro SDK after so much time in the VBA & even VB.NET add-in sphere and I'm struggling with how to accomplish a specific task. I'm sure these are growing pains with C# but the Pro SDK isn't really doing me any favors about this either. I have a ProWindow which prompts the user to provide input parameters for tweaking the color ramp of a raster in the TOC. What I would like to do is populate a combo box with a list of the rasters in the TOC. I have the code to retrieve a list of rasters in the map: var layerlist = MapView.Active.Map.GetLayersAsFlattenedList().OfType<BasicRasterLayer>(); but what I cannot figure out is how to insert this list of layers into the combo box. I've figured out how to find the event associated with the control but the process of how to populate it's data source is lost on me: private void cboLayerList_Loaded(object sender, RoutedEventArgs e)
{
var layerlist = MapView.Active.Map.GetLayersAsFlattenedList().OfType<BasicRasterLayer>();
} My control's name (cboLayerList) doesn't appear in the Intellisense suggestions so I'm at a loss as to how to hook into the control to populate the list of layers. There is a community sample about a combo box showing layers but I can't make the connection between that sample and how I'm trying to populate a combo box in my ProWindow. What am I missing (besides an understanding of C#)? Steve
... View more
3 weeks ago
|
0
|
1
|
160
|
POST
|
I'm afraid I don't know. I'm not on the admin side of things so my knowledge about that side of the equation is pretty limited. All I know is that I worked through all the layers in our map and noted which layers cause the print service to choke. Through that exercise, I noticed that these were specific layers published as services but still being housed in SDE (rather than coped features into Portal) and then I looked at those managed permissions and that was the only difference between working and non-working layers.
... View more
a month ago
|
0
|
0
|
103
|
POST
|
I don't know if this is your issue but it's something to look at and eliminate as an option.. Open up the Web Developer tools in your browser and switch it to the Network activity tab. Attempt to print and then examine what the response for the request is. That could help you narrow down if it's a specific layer in your map that's creating the issue. This was a problem for me in a Portal EB app I had (thread about it is here) and eventually we discovered that the group managed service account was not enabled in the Manage->Privileges within SDE for some layers. Once we corrected this, EB print would work as expected. Steve
... View more
a month ago
|
0
|
0
|
242
|
POST
|
Rather than using <P> to create each line item, you could try using a basic HTML table to have each item on one line: <table style="">
<tr><td style=""></td></tr>
</table> This is just the bare syntax so you'll need to modify your code to fit this accordingly. You can apply style attributes to the table and/or table data. This is a specific example from one of my Arcade popups: content = content + '<table width=\"100%\" style=\"background:#99FF99;\"><tr><td valign=\'top\' colspan=\'4\' style=\"font-weight:bold;padding-left:3px;padding-right:3px\">ASIAN / PACIFIC ISLAND LANGUAGE SPEAKING POPULATION:</td></tr>';
content = content + '<tr><td style=\"font-weight:bold;font-style:italic;\">Country:</td><td style=\"font-weight:bold;font-style:italic;\">Number of Persons:</td><td style=\"font-weight:bold;font-style:italic;\">Percent of Foreign-born population</td><td style=\"font-weight:bold;font-style:italic;\">Percent of Total Population:</td></tr>';
if (Count(asianPacPopSort) > 0) {
for(var index in asianPacPopSort){
content = content + '<tr><td>' + asianPacPopSort[index][0] + '</td><td>' + asianPacPopSort[index][3] + '</td><td>' + Round(asianPacPopSort[index][1],2) + '%</td><td>' + Round(asianPacPopSort[index][2],2) + '%</td></tr>';
}
} else {
content = content + '<tr><td colspan=\'4\'>(None reported for this language grouping)</td></tr>';
}
content = content + '</table>'; In my code above, I don't know how many rows the table will have so there's a loop involved. If you know how any rows there will be, you can hardcode it and it will be easier. Hopefully this approach makes sense.
... View more
05-31-2024
12:00 PM
|
0
|
0
|
366
|
POST
|
To partially answer my own question, you can implement a SortedDictionary on the results of the mapTool click to at least create a sorted list based on your Table of Contents. Dictionary<MapMember, List<long>> features = new Dictionary<MapMember, List<long>>();
features = mapView.GetFeatures(geometry).ToDictionary();
Dictionary<int, string> theHitList = new Dictionary<int, string>();
var counter = 0;
foreach (var feature in features)
{
theHitList.Add(counter, feature.Key.Name);
counter++;
}
var theLayerName = getTopLayer(theHitList, features.First().Key.Map); The getTopLayer function with the SortedDictionary is in this function: private static string getTopLayer(Dictionary<int,string> clickList, Map theMap)
{
var layers = MapView.Active.Map.GetLayersAsFlattenedList(); // MapView.Active.Map.Layers.Where(layer => layer is FeatureLayer);
SortedDictionary<int, string> sortedLayerList = new SortedDictionary<int, string>();
foreach (var layer in clickList)
{
var curLayerName = layer.Value;
for (int i = 0; i < layers.Count; i++)
{
if (layers[i].Name == curLayerName)
{
sortedLayerList.Add(i, layers[i].Name);
break;
}
}
}
return sortedLayerList.First().Value;
} I'm still learning C# so I'm sure there are more elegant and efficient ways to do this. In my use case, I'm labelling so I was really only concerned with the topmost layer that was clicked on using the mapTool. Nonetheless, the sortedDictionary is the mechanism to sort the information. all you do is just walk through the layers in the TOC, and add the clicked features' layer and TOC position number. So far, this has worked in my testing so I'm happy enough with this approach. Steve
... View more
05-30-2024
12:01 PM
|
0
|
0
|
120
|
BLOG
|
But results generated from the Near Me widget (or any of the analysis widgets TBH) still can't be printed/exported to PDF? The long wait continues..
... View more
05-29-2024
11:04 AM
|
2
|
0
|
2666
|
BLOG
|
Thanks, Nathan. That's actually what I want but we only just made the jump to 11.1 so I'll have to wait until our org jumps to 11.3. This has been a huge functional deficiency in webmaps for working with roadlog/milepost so I was hoping to see how it worked.
... View more
05-29-2024
10:59 AM
|
0
|
0
|
228
|
Title | Kudos | Posted |
---|---|---|
1 | Tuesday | |
1 | 2 weeks ago | |
2 | 05-29-2024 11:04 AM | |
1 | 02-29-2024 11:27 AM | |
1 | 11-22-2023 02:45 PM |