POST
|
Hello, I'm new to Web AppBuilder custom widget programming and I try to modify the advanced identify widget by @RobertScheitlin__GISP as a learning project. I got the DrawBox tool inside my widget to show up in the widget panel and I want to make the DrawBox point draw function active on panelOpen. But when I click on the point draw icon it fails in DrawBox.js on this.drawToolBar.activate(tool); with drawToolBar being null. I'm attaching my current state. What am I doing wrong?
... View more
02-08-2021
03:19 AM
|
0
|
3
|
1559
|
DOC
|
Hello @RobertScheitlin__GISP, first of all thank you for your efforts and this cool widget. I'm using current version of Web App Builder and the latest version of your widget, released a few minutes ago. My app will be called with a webmap id as url parameter, so I don't know all map layers for identify at configuration time. I don't add additional layers "Add identify layer", "only those" is deactivated. Now I expect the widget to read my map layers and offer them as well as "All Layers" option but the drop down remains empty. I have a basemap (WMTS), Feature Layer and an Image Layer (Image Service) in my map. I can click the feature layer and I get an entry in "Results" tab. If I click Image Layer I don't get a result. If I look into browser request tab I see an identify task on my basemap and a query request on my feature layer but no identify on the Image Service. Can you help please?
... View more
01-20-2021
07:32 AM
|
0
|
0
|
11807
|
POST
|
Hello Calvin, thank you very much for your answer and sorry for posting into the wrong community. Maybe I was a little bit confused because in my Jupyter Notebook project I'm using arcpy, arcpy.mp and arcgis API as well. In my workflow I'm: 1. Creating a new mosaic dataset create_mosaic_result = arcpy.management.CreateMosaicDataset(
fgdb_path, md_name, arcpy.SpatialReference(25832), 1, "32_BIT_FLOAT",
NONE", None) 2. I'm referencing a singe TIFF from folder to the mosaic dataset add_raster_to_mosaic_result =
arcpy.management.AddRastersToMosaicDataset(
os.path.join(fgdb_path, md_name), "Raster Dataset", raster_data_folder,
"UPDATE_CELL_SIZES", "UPDATE_BOUNDARY", "NO_OVERVIEWS", None, 1, 1500,
arcpy.SpatialReference(25832), '', "NO_SUBFOLDERS", "ALLOW_DUPLICATES",
"BUILD_PYRAMIDS", "CALCULATE_STATISTICS", "BUILD_THUMBNAILS", '',
"FORCE_SPATIAL_REFERENCE", "ESTIMATE_STATISTICS", None, "NO_PIXEL_CACHE",
"") 3. If I add mosaic dataset to the map, the layer contains Boundary, Footprint and Image while Image ranges from value 0.2 to 10 with stretched greyscale (single band 32 bit float as defined in create statement above) and if I access the layer with arcpy.mp it's symbology is missing both attributes. You say I can change colorizer manually but I need to do it from code. So can I initialize Symbology or just a colorizer like RasterClassifyColorizer and assign it to the layer? ALTERNATIVELY If I have a predefined raster processing template in the mosaic dataset. Can I activate it programmatically to change the layer appearance?
... View more
01-15-2021
12:31 AM
|
0
|
1
|
1838
|
POST
|
Hello, currently I have a problem that I can't explain from docs. 1. When I load a mosaic dataset into my ArCGIS Pro 2.6 map as a layer. 2. I can access the mosaics "Image" layer from python window layer = map.listLayers("Image")[0] 3. Now why does layer.symbology doesn't have a colorizer or renderer property? AttributeError: 'Symbology' object has no attribute 'colorizer' AttributeError: 'Symbology' object has no attribute 'renderer' From docs I would expect that raster layers always have a colorizer and vector layers have a renderer. So I have a raster layer with no symbology at all oO? And how can I set it? In Pro itself I can easily set classified colors on that layer. Any help would be really appreciated. Richard
... View more
01-13-2021
04:50 AM
|
0
|
3
|
1936
|
POST
|
Hello ionara wilson, I've modified your code a little to match it to my data and use case, fixed some style issues but overall the code should be easy to understand. Please see the changes between both versions. Component Template: <div class="flex-esri-map-container">
<div #mapViewNode class="esri-map-container"></div>
</div>
<select name="economicimpactfactorsselect" id="economicimpactfactorsselect" >
<option value="" selected>
</option>
<option *ngFor="let attribute of attributes let i = index;" value={{i}}>{{attribute.name}}</option>
</select> Component Code: import { Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
import { loadModules } from 'esri-loader';
import { Config } from '../../configuration/config';
import { ConfigService } from '../../configuration/config.service';
import { EsriMapService } from './esri-map.service';
@Component({
selector: 'fssb-esri-map',
templateUrl: './esri-map.component.html',
styleUrls: ['./esri-map.component.scss']
})
export class EsriMapComponent implements OnInit {
attributes: any[];
// tslint:disable-next-line:no-input-rename
@ViewChild('mapViewNode', { static: true }) private mapViewEl: ElementRef;
constructor(private esriMapService: EsriMapService) { }
ngOnInit(): void {
// this.initializeMap();
this.esriMapService.loadMap(this.mapViewEl).then(attributes => {
this.attributes = attributes;
});
}
}
Service with Promise: import { ElementRef, Injectable } from '@angular/core';
import { loadModules } from 'esri-loader';
import esri = __esri;
@Injectable({
providedIn: 'root'
})
export class EsriMapService {
mapView;
constructor() { }
loadMap(mapContainer: ElementRef): Promise<any[]> {
const promise = new Promise<any[]>((resolve, reject) => {
loadModules([
'esri/Map',
'esri/views/MapView',
'esri/layers/FeatureLayer'
])
.then(([EsriMap, EsriMapView, FeatureLayer]) => {
const map: esri.Map = new EsriMap({
basemap: 'hybrid'
});
const countyLayer = new FeatureLayer({
url: 'https://ripsstaging.lubw.baden-wuerttemberg.de/arcgis/rest/services/webapps/Hochwasser/MapServer/17',
outFields: ['*'],
id: 'counties'
});
countyLayer.on('layerview-create', (layerViewCreated: LayerViewCreatedResult) => {
const layer: esri.FeatureLayer = layerViewCreated.layerView.layer as esri.FeatureLayer;
const values = [];
for (const field of layer.fields) {
console.log(field.alias);
values.push({name: field.alias});
}
const outArray = values.slice();
console.log(outArray);
resolve(outArray);
});
const mapView: esri.MapView = new EsriMapView({
container: mapContainer.nativeElement,
center: [-99.5, 31.2],
zoom: 6.5,
map
});
mapView.when(() => {
map.add(countyLayer);
}).catch(err => {
console.error(err);
reject(err);
});
}, err => {
console.error(err);
reject(err);
});
});
return promise;
}
}
interface LayerViewCreatedResult {
view: esri.View;
layerView: esri.LayerView;
}
After that I get the feature layer attribute aliases as values into my drop down list: I hope that helps anybody who have a similar task. By the way in Angular I tend to use observable services with private subjects. Best regards Richard
... View more
07-30-2020
03:10 AM
|
0
|
0
|
1727
|
POST
|
Hello, I'm trying to create a progress dialog that shows a progress value from 0 to 100 %. Doing some research I found out that ProgressDialog() with CancelableProgressorSource() is able to serve this. My current setting is as follows: public async void ComponentChangedHandler(Component selectedComponent)
{
using (var progress = new ProgressDialog("Start Work"))
{
var status = new CancelableProgressorSource(progress);
status.Progressor.Max = 100;
progress.Show();
await QueuedTask.Run(() =>
{
uint step = 0;
foreach (var dateRange in dateRanges)
{
DoSomeLongWork();
step += 10;
status.Progressor.Value = step;
}
}, status.Progressor);
progress.Hide();
}
} This way I'm getting a nice progress dialog with my dialog message and a bar animation spinning from left to right and back again. What I want is a progress bar filling up from left to right increasing percent progress by 10 in each iteration step. What am I missing here?
... View more
01-23-2020
06:28 AM
|
1
|
4
|
5775
|
POST
|
Hello Uma, okay no problem. It's good to know that it doesn't depend on my code. When I think about it closer, the behaviour is also clear to me. The MapOverlay seems to be nothing more than that a map overlay so however it is created, it will be placed like that above the map and will not change. A FeatureLayer however is part of the map itself and therefore reacts and changes with the map renderer. For now, I will try a InMemory FeatureLayer with a single Feature in it. The problem is that our feature gets update quite often so it probably takes much resources to edit a data source instead of adding a 'simple' overlay. Thank you once again for checking this!
... View more
09-12-2019
05:00 AM
|
0
|
0
|
2337
|
POST
|
Hello Anandha, if you are just looking for the ArcGIS Pro select tools: then you should be able to get the controls by the following DAML IDs: Name: Circle
ID: esri_mapping_selectByCircleTool
Condition: esri_mapping_mapPane
Name: Lasso
ID: esri_mapping_selectByLassoTool
Condition: esri_mapping_mapPane
Name: Line
ID: esri_mapping_selectByLineTool
Condition: esri_mapping_mapPane
Name: Polygon
ID: esri_mapping_selectByPolygonTool
Condition: esri_mapping_mapPane
Name: Rectangle
ID: esri_mapping_selectByRectangleTool
Condition: esri_mapping_mapPane
Name: Trace
ID: esri_mapping_selectByTraceTool
Condition: esri_mapping_mapViewingMode2DState Taken from: DAML ID Reference ADMapping.daml · Esri/arcgis-pro-sdk Wiki · GitHub Then you should follow this link to use an existing controls logic from your code: ProGuide Reusing Pro Commands · Esri/arcgis-pro-sdk Wiki · GitHub Hope that helps a little bit.
... View more
09-11-2019
01:46 AM
|
2
|
0
|
2032
|
POST
|
Hello Uma, thank you for your code! I'm glad to see that symbols react to reference scale but for some reason it doesn't do in my case: Can you please have a look if you see some problem with my code? I first create a single SymbolReference on add-in start: _gpsPositionSymbol = await CreateGpsPositionSymbolReference().ContinueWith(result => result.Result);
private Task<CIMSymbolReference> CreateGpsPositionSymbolReference()
{
return QueuedTask.Run(() =>
{
CIMCharacterMarker marker = SymbolFactory.Instance.ConstructMarker(
66, "Schiff_real", "Regular", _config.ShipIconSize,
ColorFactory.Instance.BlackRGB) as CIMCharacterMarker;
var symbol = SymbolFactory.Instance.ConstructPointSymbol(marker);
symbol.SetRealWorldUnits(true);
symbol.SetSize(23.75); // Kormoran ship size in real units?
return symbol.MakeSymbolReference();
});
} Also I react on MapView initialized event and set the reference scale once: // Do not wonder I have a custom class that listens to Map and MapView events and
// provides some more specific events
private async void MapViewInitialized(MapViewEventArgs eventArgs)
{
// Do something in main app when map view is loaded
await QueuedTask.Run(() =>
{
MapView.Active.Map.SetReferenceScale(4000);
});
} Later in my code I have a MapOverlay with a single point which is regularly updated per second. I set the symbol rotation to a specific angle: ((CIMPointSymbol)_gpsPositionSymbol.Symbol).SetAngle(targetCourseAngle); Then I create or update my overlay: if (_gpsPositionOverlay == null)
{
_gpsPositionOverlay = MapView.Active.AddOverlay(mapPoint, _gpsPositionSymbol);
}
else
{
MapView.Active.UpdateOverlay(_gpsPositionOverlay, mapPoint, _gpsPositionSymbol);
} My symbol still holds size after each zoom.
... View more
09-10-2019
11:41 PM
|
0
|
2
|
2337
|
POST
|
Hello Uma, I still don't get it. You write exactly what's written in the docs and you're referencing docs but I still don't get the expected result, no matter what I do in code. I'm now setting the reference cale for my Map initially to 1:1: await QueuedTask.Run(() =>
{
MapView.Active.Map.SetReferenceScale(1.0);
}); My symbol remains as in the upper post: CIMCharacterMarker marker = SymbolFactory.Instance.ConstructMarker(
66, "Schiff_real", "Regular", _config.ShipIconSize, ColorFactory.Instance.BlackRGB)
as CIMCharacterMarker;
var symbol = SymbolFactory.Instance.ConstructPointSymbol(marker);
symbol.SetRealWorldUnits(true);
symbol.SetSize(23.75) I would now expect that my symbol is set to 23.75 m (map units) and will have this size ONLY at scale 1:1 but I don't see any difference to my symbol. It still has the same size on each zoom level. Do you please have a simple example for me how I can create symbol from a picture packaged with an add-in as 'content' and how to make it always have the size of let's say 50m (map units). So it will be rendered very small on small scales and bigger on bigger scales? Can you help me again please?
... View more
09-04-2019
05:59 AM
|
0
|
4
|
2337
|
POST
|
Hello, I have a new task and I'm not sure if this is possible with the Pro SDK. My goal is to create a PointSymbol either from a picture or a character marker which represents a real world object of known size and to make the symbol show the object in natural size in scale range from 1:1 to 1:100. In theory, if I look at the API, it should be enouth to set: symbol.UseRealWorldSymbolSizes = true; symbol.SetSize(23.75); If map is set to meters, it should render the symbol with 23.75 m (map units) but when I zoom out, I would now expect the icon to stay at 23.75m and therefore to shrink appropriately. But it still holds its size at any zoom level. This is my complete snippet: CIMCharacterMarker marker = SymbolFactory.Instance.ConstructMarker(
66,
"Schiff_real",
"Regular",
_config.ShipIconSize,
ColorFactory.Instance.BlackRGB) as CIMCharacterMarker;
var symbol = SymbolFactory.Instance.ConstructPointSymbol(marker);
symbol.UseRealWorldSymbolSizes = true;
symbol.SetSize(23.75);
return symbol; Can someone please help me?
... View more
08-26-2019
08:32 AM
|
0
|
6
|
2476
|
POST
|
Hi Gintautas, I've ported now my whole Add-In to 2.4 and after it initially seemed to work fine, the same behaviour occured again after I changed some states and controls in my add-in panel. Then I applied pre-defined Esri styles to the most controls like buttons, text boxes and so on and this have finally fixed my problem. I have really no idea where the framework took these strange style information from like the black font color. But now it works as expected. Thank you again for your help. Because the true cause of the problem is unknown, I give you an upvote for your answer and help.
... View more
08-26-2019
06:40 AM
|
0
|
1
|
1143
|
POST
|
Hello, this time I'm having trouble with applying predefined Esri Styles to my Controls (Expander and TextBlock). It ignores the ArcGIS Pro theme settings and always shows light theme font colors also in dark theme mode, see picture: Is there any cache folder for the add-in that I can delete/remove? I'm still on ArcGIS Pro 2.1. <Expander Header="Kurs zum Ziel" HorizontalAlignment="Stretch"
VerticalAlignment="Top" Grid.Row="3"
Grid.ColumnSpan="5" Margin="0,0,10,0" Height="125"
IsExpanded="{Binding CourseToTargetExpanded}"
Style="{DynamicResource Esri_Expander}" IsEnabled="{Binding HasNavigation}">
<Grid x:Name="courseGrid" Margin="2,2,2,2" >
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="95" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition Width="0.5*" />
<ColumnDefinition Width="0.5*" />
<ColumnDefinition Width="0.5*" />
</Grid.ColumnDefinitions>
<Label x:Name="lblTargetCourse" Content="Soll-Kurs: " Grid.Row="0" Grid.Column="0" />
<TextBlock x:Name="tbxTargetCourse" Text="{Binding TargetCourse}"
Grid.Row="0" Grid.Column="1"
VerticalAlignment="Center" Padding="5,0,0,0"
Style="{DynamicResource Esri_TextBlockDockPaneHeading}" />
<Label x:Name="lblDistance" Content="Abstand: " Grid.Row="0" Grid.Column="2" />
<TextBlock x:Name="tbxDistance" Text="{Binding TargetDistance}"
Grid.Row="0" Grid.Column="3"
VerticalAlignment="Center" Padding="5,0,0,0" Margin="0,5"
Foreground="{DynamicResource Esri_TextStyleDefaultBrush}" />
<Canvas VerticalAlignment="Center" x:Name="liveCourse" Grid.Row="1"
Height="15" Grid.Column="0" Width="{Binding CanvasWidth, Mode=TwoWay}"
Grid.ColumnSpan="4" SizeChanged="GpsModule_LiveCourseCanvas_SizeChanged">
<Rectangle x:Name="liveCourseLeft" Fill="#E50000" Height="15"
Width="150" Canvas.Bottom="25"/>
<Rectangle x:Name="liveCourseRight" Fill="#00CC00" Height="15"
Canvas.Left="150" Canvas.Bottom="25" Width="150"/>
<TextBlock x:Name="liveCourseMarker" Text="^" FontSize="26"
Canvas.Bottom="10" Canvas.Left="{Binding LiveMarkerPosition}"
FontFamily="Arial" Foreground="White"></TextBlock>
</Canvas>
</Grid>
</Expander> Does anyone have an idea?
... View more
08-19-2019
08:37 AM
|
0
|
3
|
1411
|
POST
|
Hello Peter, Hello Lance, thank you both for your helpful comments. It turned out that reopening ArcGIS Pro indeed solved my problem and it may somehow also relate to the __pycache__ subfolders with *.pyc files I have. But because I have the __pycache__ folders in my projects which I would have to delete over and over, I decided that reopening ArcGIS Pro is the more "comfortable" option. Of course it`s still annoying and it would be interresting if there's a way to circumvent this problem and to make ArcGIS Pro always run the latest local version.
... View more
07-17-2019
01:02 AM
|
0
|
1
|
6019
|
POST
|
This question has been resolved. Both ship icon and polyline had correct orientation but had a projection missmatch ... stupid mistake, I'm sorry. Once I transformed polyline to matching projection and then rotated it, both lined up correctly.
... View more
07-12-2019
04:56 AM
|
0
|
0
|
1195
|
Title | Kudos | Posted |
---|---|---|
1 | 01-23-2020 06:28 AM | |
1 | 06-04-2018 11:48 PM | |
1 | 06-04-2018 06:16 AM | |
2 | 10-29-2021 01:41 AM | |
1 | 01-22-2018 07:22 AM |
Online Status |
Offline
|
Date Last Visited |
08-15-2022
08:13 AM
|