POST
|
The workaround works with a few minor modifications to the arcade script. //Draw the arrow keys = keys + "my_arrow;"; keys = keys + "po:layers_arrow|Color|" + _urgcolor +";"; keys = keys + "po:structure_arrow|Rotation|" + _rotangle + ";"; The Color property was case sensitive, and I had to change to point to the new key for the symbol. The JSON of the style.GetSymbolAsync() now contains layer_arrow, and the color logic is working . We will adapt the dictionary and symbology to expand to the real life sample with more complex (and prettier) symbology, with fingers crossed it works the same, though I have no reason to doubt it will. Is the original "bug" with the placement of primitiveName a candidate for a near future release?
... View more
11-08-2023
05:44 AM
|
0
|
0
|
641
|
POST
|
Thank you so much @PreetiMaske for your response. I will have my Pro guy try it out tomorrow, as I will not be able to test it myself until Thursday. I'm very eager about the outcome 😁
... View more
11-07-2023
12:28 PM
|
0
|
0
|
662
|
POST
|
Thank you for getting back to me. The geocode services we are searching against are custom proxies, which might be tailored to provide multiple results, however, since the maxresult parameter is never passed to the service, it is tricky to tell it how many results to return. Rewriting it to return multiple results might be possible, however it is unknown what format to return to be able to support multiple results that the Maps SDK is able to process successfully. I.e. "What's here" functionality with multiple results per geocodeService. Can you think of other ways to get multiple results from a geocode service based on a location only, and still follow specifications?
... View more
11-02-2023
02:08 PM
|
0
|
0
|
312
|
POST
|
@dotMorten is this something you have experience with?
... View more
11-02-2023
01:45 PM
|
0
|
2
|
316
|
POST
|
The style is available in this message. Had to zip because the forum didn't quite agree matching file extension vs format.
... View more
11-01-2023
03:09 PM
|
0
|
6
|
756
|
POST
|
Hi, This post covered some of this, but unfortunately it appears the links are broken. https://community.esri.com/t5/arcgis-maps-sdks-native-blog/blogpost-navigating-the-mapview-from-a-viewmodel/ba-p/886181 I don't have the opportunity to search or access my version of this code, but look for MapViewController in some of Morten's git repositories. While not a full answer, at least it is something to point you in the right direction. I would implement the GeoViewTapped through custom WeakEventManager implementations to avoid memory leaks.
... View more
11-01-2023
02:27 PM
|
1
|
1
|
685
|
POST
|
LocatorTask.ReverseGeocodeAsync has a method that takes a parameter that has ReverseGeocodeParameters.MaxResult that the documentation says the WorldGeocodeService can return up to 20 results per request. The return value of this method is an IReadOnlyList of GeoCodeResult. This leads me to believe that I can request more than one hit within a radius. However, looking at the request through Fiddler, the maxResult is not passed in the request parameters. The documentation for the Rest API for reverseGeocode doesn't indicate that the result can ever be a list of addresses, or that MaxResult is an available parameter. Is there a mismatch between the implemented SDK API and the REST API, or is it more future proof? We have many configured Geocode services (doing direct query against featurelayers is rather cumbersome as everything is ideally supposed to be configured in the portal. We want to query "What's near this location?", and we need multiple results per service as the MaxResult property says. Are there good workarounds for this, or alternative geocode API? findAddressCandidates (LocatorTask.Geocode, I presume) with location might be an option, but I've not seen samples on how to send just a position to get multiple addresses, but that could be a combination with SearchArea and some additional parameters to get within a radius?
... View more
11-01-2023
09:38 AM
|
0
|
3
|
412
|
POST
|
Using the latest version of the Map SDK for ..NET, I am attempting to use a DictionaryRenderer as described in this post: https://developers.arcgis.com/net/styles-and-data-visualization/display-symbols-with-a-dictionary-renderer/#symbolize-a-feature-layer-or-graphics-overlay. I need to merge multiple symbols into one, with rotation and changed color based on feature/graphics attributes. I am using this on a GraphicsOverlay. A basic example from ArcGIS pro Using the same Dictionary Style in ArcGIS Map SDK for .NET. They all use the default color of the symbol defined in ArcGIS Pro. Rotation and hide/show different symbols based on graphics attributes work, however, the color does not want to change based on attribute value, with the important part //Draw the arrow
keys = keys + "arrowBasic;";
keys = keys + "po:layers_arrow|FillColor|" + _urgcolor +";";
keys = keys + "po:structure_arrow|Rotation|" + _rotangle + ";"; The arcade script is as follows var keys;
var _urgcolor;
var _standstillcolor;
//calculate ROTATION ANGLE for right-pointing arrow
var _rotangle = (450-$feature.Bearing)%360;
//calculate COLOR for urgency
function urg_color_calc (rsn,utc) {
if(rsn == "Ute av drift"){
return "#03376F" //blue-black
}
if(rsn == "Ledig"){
return "#D330D1" //lilac
}
if(utc == "A"){
return "#E75E5B" //red
}
if(utc == "H"){
return "#FFD75E" //yellow
}
if(utc == "V"){
return "#7DD455" //green
}
if(isEmpty(utc)){
return "#b3b3b3" //grey
}
return "#0000ff"; //super blue as fallback
}
_urgcolor = urg_color_calc($feature.ResourceStatusName, $feature.urgencytypecode);
//Draw the arrow
keys = keys + "arrowBasic;";
keys = keys + "po:layers_arrow|FillColor|" + _urgcolor +";";
keys = keys + "po:structure_arrow|Rotation|" + _rotangle + ";";
// Motion - show the dot if Resource is standing still
_standstillcolor = "#808b96";
if($feature.isMoving <1){
keys = keys + "pentagon3;";
}
// See if text should be displayed.
var showLabels = $config.text != 'OFF';
// Create the concatenated string of keys (separated with ";"). Add the label key if text is on.
if (showLabels) {
keys = keys + "labelres";
}
return keys; In the style there is a symbol with the primitiveName 'layers_arrow' of which I would like to change the color. using FillColor or Color has no effect in ArcGIS Map SDK for .NET, but it does work in ArcGIS Pro. Using the following code to get the JSON of the symbol Symbol restaurantSymbol = style.GetSymbolAsync(attributes).Result; var json = restaurantSymbol.ToJson(); {
"symbolLayers": [
{
"anchorPoint": {
"x": 0,
"y": 0
},
"billboardMode3D": "FaceNearPlane",
"colorLocked": false,
"depth3D": 0.0,
"dominantSizeAxis3D": "Y",
"enable": true,
"frame": {
"xmax": 17,
"xmin": 0,
"ymax": 17,
"ymin": 0
},
"markerGraphics": [
{
"geometry": {
"rings": [
[
[
17,
10.01
],
[
13.75,
0
],
[
3.25,
0
],
[
0,
10.01
],
[
8.49,
16.19
],
[
17,
10.01
]
]
]
},
"symbol": {
"angleAlignment": "Map",
"symbolLayers": [
{
"capStyle": "Round",
"color": [
0,
0,
0,
255
],
"colorLocked": false,
"enable": true,
"joinStyle": "Round",
"lineStyle3D": "Strip",
"miterLimit": 10.0,
"type": "CIMSolidStroke",
"width": 1.0
},
{
"color": [
230,
0,
0,
255
],
"colorLocked": false,
"enable": true,
"type": "CIMSolidFill"
}
],
"type": "CIMPolygonSymbol"
},
"type": "CIMMarkerGraphic"
}
],
"primitiveName": "structure_pentagon3",
"respectFrame": true,
"scaleSymbolsProportionally": true,
"size": 10.0,
"type": "CIMVectorMarker",
"verticalOrientation3D": false
},
{
"anchorPoint": {
"x": 0,
"y": 0
},
"billboardMode3D": "FaceNearPlane",
"colorLocked": false,
"depth3D": 0.0,
"dominantSizeAxis3D": "Y",
"enable": true,
"frame": {
"xmax": 0,
"xmin": -14,
"ymax": 4.5,
"ymin": -4.47
},
"markerGraphics": [
{
"geometry": {
"x": 0,
"y": 0
},
"symbol": {
"haloSize": 0,
"scaleX": 1,
"symbolLayers": [
{
"anchorPoint": {
"x": 0.5,
"y": 0
},
"billboardMode3D": "FaceNearPlane",
"clippingPath": {
"clippingType": "Intersect",
"path": {
"rings": [
[
[
0.0,
0.0
],
[
17.0,
0.0
],
[
17.0,
17.0
],
[
0.0,
17.0
],
[
0.0,
0.0
]
]
]
},
"type": "CIMClippingPath"
},
"colorLocked": false,
"depth3D": 0.0,
"dominantSizeAxis3D": "Y",
"enable": true,
"frame": {
"xmax": 17,
"xmin": 0,
"ymax": 17,
"ymin": 0
},
"markerGraphics": [
{
"geometry": {
"rings": [
[
[
17,
9.33
],
[
11.52,
14.77
],
[
11.52,
12.58
],
[
0,
12.58
],
[
0,
6.07
],
[
11.52,
6.07
],
[
11.52,
3.88
],
[
17,
9.33
]
]
]
},
"symbol": {
"angleAlignment": "Map",
"symbolLayers": [
{
"capStyle": "Round",
"color": [
51,
51,
51,
255
],
"colorLocked": false,
"enable": true,
"joinStyle": "Round",
"lineStyle3D": "Strip",
"miterLimit": 10.0,
"type": "CIMSolidStroke",
"width": 0.0
},
{
"color": [
230,
152,
0,
255
],
"colorLocked": false,
"enable": true,
"type": "CIMSolidFill"
}
],
"type": "CIMPolygonSymbol"
},
"type": "CIMMarkerGraphic"
}
],
"offsetY": -0.6666666666666666,
"respectFrame": true,
"scaleSymbolsProportionally": true,
"size": 14.0,
"type": "CIMVectorMarker",
"verticalOrientation3D": false
}
],
"type": "CIMPointSymbol"
},
"type": "CIMMarkerGraphic"
}
],
"primitiveName": "structure_arrow",
"respectFrame": true,
"rotation": 327.0,
"scaleSymbolsProportionally": true,
"size": 14.0,
"type": "CIMVectorMarker",
"verticalOrientation3D": false
}
],
"type": "CIMPointSymbol"
} In the JSON above, I can find primitive names "structure_arrow" which I change the rotation for, and "structure_pentagon3" which is displayed or hidden. Nowhere in the JSON of the symbol can I find anything with the primitiveName 'layers_arrow", which is the name set in ArcGIS Pro for the symbol. The relevant section from DB Browser for SQLite. Interestingly, the name layer arrow is visible in the binary display of the arrowBasic content
... View more
11-01-2023
06:51 AM
|
0
|
10
|
915
|
POST
|
This appears to be a bug with clone of Map.Clone() and GroupLayer.Clone(). The map contains two ArcGisMapImageLayer that holds two sublayers. Both sublayers are visible, while the imagelayer is not. One imagelayer is within a GroupLayer that is visible, and the other layer is on the root of the map. If I use Map.Clone(), I'm not able to change the visibility of the imagelayer within a grouplayer until i toggle the visibility of the grouplayer, and then change the visibility of the imagelayer I addressed it with the following snippet: private Esri.ArcGISRuntime.Mapping.Map CloneMap(Esri.ArcGISRuntime.Mapping.Map sourceMap)
{
var targetMap = new Esri.ArcGISRuntime.Mapping.Map(sourceMap.SpatialReference)
{
InitialViewpoint = sourceMap.InitialViewpoint,
MaxScale = sourceMap.MaxScale,
MinScale = sourceMap.MinScale,
Basemap = new Basemap()
};
foreach (var layer in sourceMap.OperationalLayers)
{
targetMap.OperationalLayers.Add(layer.CloneLayer());
}
if (sourceMap.Basemap != null)
{
foreach (var layer in sourceMap.Basemap.BaseLayers)
{
targetMap.Basemap.BaseLayers.Add(layer.CloneLayer());
}
foreach (var layer in sourceMap.Basemap.ReferenceLayers)
{
targetMap.Basemap.ReferenceLayers.Add(layer.CloneLayer());
}
}
return targetMap;
} And the CloneLayer Extension method /// <summary>
/// Helper class for cloning of layers. There is an issue with clone of <see cref="GroupLayer"/> where the children are <see cref="ArcGISMapImageLayer"/>
/// with visibility as hidden in the original map.
/// </summary>
public static class MapCloneExtensions
{
public static Layer CloneLayer(this Esri.ArcGISRuntime.Mapping.Layer layer)
{
if(layer is GroupLayer groupLayer)
{
return CloneInternal(groupLayer);
}
return layer.Clone();
}
/// <summary>
/// Clone a group layer, and it's children
/// </summary>
/// <param name="sourceGroupLayer"></param>
/// <returns></returns>
private static Layer CloneInternal(GroupLayer sourceGroupLayer)
{
// GroupLayer.Clone() does not work with visibility, so we need to do it manually
var groupLayer = new GroupLayer
{
Id = sourceGroupLayer.Id,
Name = sourceGroupLayer.Name,
IsVisible = sourceGroupLayer.IsVisible,
Opacity = sourceGroupLayer.Opacity,
MaxScale = sourceGroupLayer.MaxScale,
MinScale = sourceGroupLayer.MinScale,
};
foreach(var layer in sourceGroupLayer.Layers)
{
groupLayer.Layers.Add(CloneLayer(layer));
}
return groupLayer;
}
}
... View more
12-07-2022
06:29 AM
|
0
|
0
|
268
|
POST
|
Hi, This post is a supplement to https://community.esri.com/t5/arcgis-pro-questions/attributte-driven-symbology-configured-in-arcgis/td-p/1233656 for the same issue, but from the ArcGIS for .NET Runtime. See reference post about what has been done for the web map. Background We configure symbology for GraphicOverlays in a WebMap in Portal for increased flexibility and being able to use the same symbology across multiple Web Aps and desktop clients. Symbology should be combined of multiple symbols: - Drop shape (direction indicator) that can change color and rotation based on attribute - Static image/font symbol based on attribute that does NOT rotate or change color Implementation The WPF application reads the web map with FeatureLayer and ArcGisMapImageLayer holding information about renderer, labeling, popup information, scale visibility, etc. Traditional symbology with UniqueValueRenderer works just fine, however, the issue arise when the symbol is composed in MultiLayer symbol (I assume). When doing GraphicOverlay.Renderer = Renderer.FromJson(imageLayer.Render.ToJson()), the symbols are mostly correct, but the expressions for rotation and symbol color are not applied. It does not appear that the renderer .ToJson() or that of the service definition does not contain any of the visual expressions defined in ArcGIS Pro. Rendering layer data directly in the map as ArcGisMapImageLayer works just fine with rotation, but not when a copy of the renderer is used on GraphicOverlay. Can I assume it works in ArcGisMapImageLayer because the features are rendered on the server? Is there a way to make this work?
... View more
11-30-2022
01:09 PM
|
0
|
0
|
270
|
POST
|
Hi, We configure multiple webmaps in portal, and we want to merge them into a new webmap that is the union of the individual maps. Customer have different teams managing the content of the different maps, which is why we are not working with a single large webmap. We've had multiple issues related to merging the maps into one. We've tried different solutions to merge: ToJson() for each map, and perform a JSON merge to create the JSON for a new Map.FromJson() For some reason we didn't get PopupDefinitions and some other properties using this technique, even when having performed map.LoadAsync() or LoadAsync for individual layers Iterate referenceLayers, OperationalLayers and BaseLayers and perform a Clone Most things work, but we frequently get error message similar to ArcGisMapImageLayer within a GroupLayer fail to reflect IsVisible, so the user is not able to show/hide that layer. Moving them outside of a group works, but that's not particularly functional for the structure presented to the user. Is it possible that Clone clones some references to the original CoreArcGISMapImageLayer referencing the original Map that is no longer alive? I've tried implementing my own Clone method to do similar things to the runtime Clone, but in some situations I need to Load the source layer, which gives me the No access to this resource (or something to that effect). Any suggestion for the best way to merge multiple maps into one?
... View more
11-30-2022
06:10 AM
|
0
|
1
|
324
|
POST
|
Hi, When building a project with the ArcGISRuntime, localization files are copied to build output. I was hoping for an option to add a property to my project file to only include language for only those languages I want, rather than all of them being copied to the output folder. Is that something that sounds reasonable to add to an upcoming version?
... View more
10-08-2020
04:39 AM
|
0
|
2
|
1132
|
POST
|
Thanks for the reply. I can send the sample to Mike when I finish eating, if that is ok? I don't have your contact details, and the forum does't seem to allow me to attach files. And it is possibly easier to continue communication over email, in case we get further off topic of this thread
... View more
10-09-2019
11:56 AM
|
0
|
1
|
155
|
Title | Kudos | Posted |
---|---|---|
1 | 11-01-2023 02:27 PM | |
1 | 02-26-2019 03:36 PM | |
1 | 08-17-2017 02:09 AM | |
1 | 12-14-2018 11:57 AM | |
1 | 12-14-2018 08:21 AM |
Online Status |
Offline
|
Date Last Visited |
11-13-2023
11:33 PM
|