POST
|
I was afraid it was something silly like that. Thanks Morten!
... View more
08-26-2019
01:22 PM
|
0
|
0
|
711
|
POST
|
I'm trying to create a ClassBreakRenderer and set it on a GraphicsOvelay and cannot get it to work. The renderer works fine on a FeatureLayer, but doesn't work on a GraphicsOverlay that's been created using the same data as the FeatureLayer. I'm not sure what I'm missing here. Is there a sample somewhere that shows how to do this? I pasted the code below, and also attached the repro case, in case someone is up for giving me a hand in getting to the bottom of this. Working with 100.5. Thank you!!! - Mara private async void RenderData()
{
// Create a new map based on the streets base map.
Map newMap = new Map(Basemap.CreateStreets());
// Create an envelope that covers the continental US in the web Mercator spatial reference.
Envelope continentalUSEnvelope = new Envelope(-14193469.5655232, 2509617.28647268, -7228772.04749191, 6737139.97573925, SpatialReferences.WebMercator);
// Zoom the map to the extent of the envelope.
newMap.InitialViewpoint = new Viewpoint(continentalUSEnvelope);
// Assign the map to the MapView.
MyMapView.Map = newMap;
MyMapView.GraphicsOverlays.Add(new GraphicsOverlay());
// CHANGE THIS FLAG TO SWITCH TEST BETWEEN FEATURE LAYER AND GRAPHICS OVERLAY
var useFeatureLayer = true;
if (useFeatureLayer)
{
// set feature layer and renderer and add it to the map
var featureLayer = new FeatureLayer(new Uri("https://services8.arcgis.com/KsXZDThvSinzJ3pq/arcgis/rest/services/test_pipeline/FeatureServer/0"));
featureLayer.Renderer = CreateClassBreaksRenderer();
MyMapView.Map.OperationalLayers.Add(featureLayer);
}
else
{
// set feature table and query it to retrieve all features
var featTable = new ServiceFeatureTable(new Uri("https://services8.arcgis.com/KsXZDThvSinzJ3pq/arcgis/rest/services/test_pipeline/FeatureServer/0"));
var queryParams = new QueryParameters { WhereClause = "1=1" };
var featureResult = await featTable.QueryFeaturesAsync(queryParams, QueryFeatureFields.LoadAll);
// create graphics from the features and add them to the map in a graphics overlay
foreach (var result in featureResult)
{
var pipeSegment = result.Geometry;
var graphic = new Graphic(pipeSegment);
graphic.Attributes.Add("break", result.Attributes["break"]);
MyMapView.GraphicsOverlays[0].Graphics.Add(new Graphic(pipeSegment));
}
// create and set renderer for the graphics overlay
MyMapView.GraphicsOverlays[0].Renderer = CreateClassBreaksRenderer();
}
}
private ClassBreaksRenderer CreateClassBreaksRenderer()
{
// Create symbols
var symbol1 = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Red, 7);
var symbol2 = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Yellow, 7);
var symbol3 = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Green, 7);
// Create class breaks
List<ClassBreak> listClassBreaks = new List<ClassBreak>
{
new ClassBreak("1", "1", 0, 1, symbol1),
new ClassBreak("2", "2", 1, 2, symbol2),
new ClassBreak("3", "3", 2, 3, symbol3),
};
// Create and return the a class break renderer for use with the "break" field
return new ClassBreaksRenderer("break", listClassBreaks);
}
... View more
08-25-2019
08:55 PM
|
0
|
3
|
771
|
POST
|
Thanks for that Jon Morris Unfortunately that doesn't help. Below is the output I get. It waits until the post-build is finished before it creates the esriAddIn file. (I even tried waiting for 50 seconds, it just sits there...) ------ Rebuild All started: Project: ArcMapAddin1, Configuration: Release Any CPU ------ ArcMapAddin1 -> C:\Users\codergrl\Documents\Visual Studio 2010\Projects\ArcMapAddin1\ArcMapAddin1\bin\Release\ArcMapAddin1.dll attempt 1 attempt 2 attempt 3 attempt 4 attempt 5 attempt 6 attempt 7 attempt 8 attempt 9 attempt 10 done Successfully created Add-in "ArcMapAddin1" -> 'C:\Users\codergrl\Documents\Visual Studio 2010\Projects\ArcMapAddin1\ArcMapAddin1\bin\Release\ArcMapAddin1.esriAddIn'. ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
... View more
11-10-2015
09:27 AM
|
0
|
1
|
550
|
POST
|
I'm trying to set up a post build event in Visual Studio 2010 that copies the .esriAddIn file to a specific folder after it's built. However, it does not work. After some more digging I got to an error saying that the file does not exist. I added an echo and a timer to see if the code even runs, and everything runs fine, but the actual esriAddIn file doesn't get created until after the post-build event finishes running. I'm out of ideas how to make this work. Here's the code I'm using: start xcopy /Y /R "C:\Users\codergrl\Documents\Visual Studio 2010\Projects\ArcMapAddin1\ArcMapAddin1\bin\Release\ArcMapAddin1.esriAddIn" "C:\Users\codergrl\Documents\AddIns" This works fine if I put it in a .bat file, but gives me the "file not found" error if I put it in the post-build event in VS. Any ideas?
... View more
11-10-2015
05:51 AM
|
0
|
3
|
4037
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|