|
POST
|
Thanks again Robert. Now I am trying to get the response from the web api that I use for querying a remote database. In a C# windows form, I have no problems doing this, but in this widget I am not totally sure where to put my code. I'm currently just hardcoding some sample data to see if I can get some results, but after the myWidget.showContractNumber, the code stops working. What should be happening is just 3 consecutive message boxes with the name showing. Any advice on where I am going wrong?? define([
'dojo/_base/declare',
'jimu/BaseFeatureAction',
'jimu/WidgetManager'
],
function (declare, BaseFeatureAction, WidgetManager)
{
var clazz = declare(BaseFeatureAction,
{
iconFormat: 'png',
isFeatureSupported: function (featureSet)
{
return featureSet.features.length > 0 && featureSet.features[0].geometry.type !== 'point';
},
onExecute: function (featureSet)
{
WidgetManager.getInstance().triggerWidgetOpen(this.widgetId)
.then(function (myWidget)
{
var vertexCount = 0;
var contractNumber = "TEST";
featureSet.features.forEach(function (f)
{
f.geometry.rings.forEach(function (r)
{
vertexCount += r.length;
});
contractNumber = f.attributes.CONTRACTNO;
});
myWidget.showVertexCount(vertexCount);
myWidget.showContractNumber(contractNumber);
//Get the real JSON through the web api here
$(document).ready(function () {
var jsonData = [{
"itemsPerPage": 25,
"list": [{
"id": "1018",
"name": "abc"
}, {
"id": "1019",
"name": "acd"
}, {
"id": "1025",
"name": "kjk"
}]
}];
//Read the value and assign to textbox
$.each(jsonData, function (i, item) {
//loop through each result
$(item.list).each(function (key, value) {
//get the name here
alert(value.name);
});
});
});
});
},
});
return clazz;
});
... View more
04-01-2019
07:27 AM
|
0
|
4
|
4749
|
|
POST
|
Great....thanks again! Things are slowly coming together. Now I am trying to access the CONTRACTNO of the selected feature when the user clicks on the ... to open up the widget. I'm just building on the .js file for the DEMO widget, but what I have does not seem seem to be working. Any hints?? CONTRACTNO is the name of the attribute in the webservice for the layer. define([
'dojo/_base/declare',
'jimu/BaseFeatureAction',
'jimu/WidgetManager'
], function (declare, BaseFeatureAction, WidgetManager) {
var clazz = declare(BaseFeatureAction, {
iconFormat: 'png',
isFeatureSupported: function (featureSet) {
return featureSet.features.length > 0 && featureSet.features[0].geometry.type !== 'point';
},
onExecute: function (featureSet) {
WidgetManager.getInstance().triggerWidgetOpen(this.widgetId)
.then(function (myWidget) {
var vertexCount = 0;
featureSet.features.forEach(function (f) {
f.geometry.rings.forEach(function (r) {
vertexCount += r.length;
});
});
myWidget.showVertexCount(vertexCount);
//Trying to access the CONTRACTNO attribute of the currently selected feature
var contractNumber = "TEST";
var feature = this.mapManager.map.infoWindow.getSelectedFeature();
var contractNumber = feature.attributes.CONTRACTNO;
myWidget.showContractNumber(contractNumber);
});
}
});
return clazz;
... View more
03-25-2019
08:45 AM
|
0
|
6
|
4749
|
|
POST
|
Great...thanks Robert. I have worked through that tutorial, and I think I at least half know what I am doing now. Is there a way to 'Activate' a widget by clicking on text in the features 'Pop-Up' window?? What I'm thinking is that the user would scroll to the Contract Boundary they are interested in, and then click on some text to then open up the widget. See below as an example. Or do I need to go about this differently??
... View more
03-22-2019
12:43 PM
|
0
|
8
|
4749
|
|
POST
|
Hi, I'm a total beginner with WAB, but what I want to do is take a tool I have developed for ArcGIS Desktop and bring that into a web app. How the tool works is: 1. User selects a construction contract boundary from a polygon layer 2. User clicks on the 'Document Manager' tool (in ArcGIS) 3. A windows form opens up, connects to a web API which returns some JSON with the details on the contract boundary, based on the CONTRACT_NUMBER of the polygon. 4. Information is displayed on the form. See the screenshot below for an example. All of the data here is returned via JSON. How would I replicate this sort of behaviour with a Widget? Where do I even start? I realize in webapps there are no 'forms', but I guess some sort of panel to display the info would work?? I am not a web programmer at all, so just looking to get some ideas. Thanks!
... View more
03-19-2019
06:47 AM
|
0
|
10
|
5727
|
|
POST
|
Hi, I'm pretty sure this can be done, but I'm just not sure how to do it in ArcGIS Pro. What I want is that whenever I add a layer to a Map, it automatically get sourced to the editing version. I thought I had seen a setting somewhere to set this behaviour, but now that I want to do it I have no idea where to find it. Currently all new added layers get sourced to the "Default" version instead of my own editing version. See below: I know I can just right-click and 'Change Version' on the Default, but I'm sure there is another way to do this.
... View more
02-19-2019
08:11 AM
|
0
|
4
|
1325
|
|
POST
|
Yes, I did notice that message box of some of my other attempts, but on the first try (when I did the Reconcile/Post) it did not show up. Now that I understand how it works, I should be good to go. Thanks
... View more
01-25-2019
12:20 PM
|
0
|
0
|
1917
|
|
POST
|
OK. I figured this out. Turns out once you do the upgrade the 'Auto Apply' button at the bottom of the attribute window gets unchecked. You will need to re-check it (or hit the 'Apply' button after editing), before the 'Save' button will be enabled.
... View more
01-25-2019
11:29 AM
|
1
|
1
|
1917
|
|
POST
|
Hi, I just upgraded to 2.3 and now I cannot edit. Here was my workflow: 1. Create the feature 2. Fill in the attributes 3. I then did a reconcile/post 4. Went back a few minutes later to see that the feature was there, but none of the attributes were saved. 5. I am now trying to update just the attributes, and I cannot. The created feature seems to still be in my 'version', but when editing attributes I do not get the option to click on the 'Save' button on the edit tab. See screenshot below, with edits shown in red, and the grayed out Save button.
... View more
01-25-2019
08:54 AM
|
0
|
5
|
2171
|
|
POST
|
Ah, you're a genius! With the multiple 'Maps' in my project, some had it turned on and others didn't. Thanks!
... View more
01-11-2019
08:00 AM
|
0
|
1
|
2693
|
|
POST
|
Here are my settings for the Callout: And when I go to the Positions settings there is nothing there for Stack: It has worked before though. I remember seeing Callouts stacked in a previous project. This one is using a Map Series. Would that make any difference??
... View more
01-11-2019
06:57 AM
|
0
|
3
|
2693
|
|
POST
|
Interesting....I don't seem to have that option. I'm running ArcPro 2.2.4. Is there a setting I'm missing somewhere to enable this??
... View more
01-11-2019
05:54 AM
|
0
|
6
|
2693
|
|
POST
|
Hi, I have a callout on my page that is too wide. Is there a way to control how wide it gets, and then spread the text over multiple lines?? This is labelling, not annotation.
... View more
01-10-2019
12:48 PM
|
0
|
8
|
2850
|
|
POST
|
Hi, Is there a way to only show attribute tables for the currently active Map tab? It becomes very confusing when you have multiple Maps in a project, and you are looking at attribute tables, but not really sure which one is connected to which tab. See below....When I am on "Map", I only need to see the attribute tables that I have opened for that Map, but all the other attribute tables are showing. Is there setting somewhere I can set to modify what shows??
... View more
01-10-2019
07:28 AM
|
0
|
5
|
2330
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-29-2026 07:40 AM | |
| 1 | 10-17-2023 07:40 AM | |
| 1 | 04-14-2026 08:54 AM | |
| 2 | 08-18-2023 08:57 AM | |
| 1 | 04-13-2018 10:07 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-29-2026
09:43 AM
|