POST
|
I am using symbology classes defined by a custom Arcade expression. My problem is that if there's no feature that satisfies some of the defined classes those symbols will not show in the Classes tab and therefore I can't format the symbol for future features that will fall in that class. This is an excerpt of my Arcade expression: if (Left($feature.KEY, 2) == '01') {return "Oak";} else if (Left($feature.KEY, 2) == '02') {return "Palm tree";} else if (Left($feature.KEY, 2) == '03') {return "Cherry tree";} else if (Left($feature.KEY, 2) == '04' || Left($feature.KEY, 2) == '05') {return "Pine";} else if (Left($feature.KEY, 2) == '07') {return "Ash";} else if (Left($feature.KEY, 2) == '08' || Left($feature.KEY, 2) == '09') {return "Beech";} else if (Left($feature.KEY, 2) == '10') {return "Cedar";} Right now we have no catalogued Ash nor Cedar, so there's no feature with KEY values starting with 07 or 10, but we will eventually in the future and need to format a symbol for those symbol classes. As you see below, those classes do not show in the Classes tab and the 'Add unlisted value' option doesn't list those symbols either. I thought of adding some dummy features with the missing KEY values to be able to format their symbols but I don't have the privileges to add features to the catalogue feature class, so I don't know if that would work anyway. Any idea of what to do?
... View more
02-12-2020
01:42 AM
|
1
|
11
|
1660
|
POST
|
This article (June 2018) says that feature layers participating in view layers with joins can't have their schema altered. Is this information still valid? We've been experiencing this with a hosted feature layer which may need to have changes to some field domains (from the Data tab in the item details page). This means we'll have to delete and recreate the view and the web map each time users ask for a change in a domain. And some extra steps to make apps use the new web map. The weird thing is that in a test feature layer we were able to change field names and domains in AGOL after creating a view with it using the Join Features tool. I've been unable of reproducing this again but it makes me think there's an exception to this limitation. Am I right?
... View more
10-30-2019
06:40 AM
|
3
|
12
|
2939
|
POST
|
I may be wrong but my guess is that changing the data source for each layer separately will be slower. Also, the only way to detect if a layer is a query layer is to look for the string '%' in its datasetName as mentioned here. I haven't tested it though.
... View more
07-28-2016
05:34 AM
|
0
|
0
|
364
|
POST
|
I have a bunch of MXD and I need to change the SDE connection in them using Python. These MXD include sde feature layers, sde tables and query layers. For sde feature layers and tables replaceWorkspaces work as expected but it does not for query layers. I tried with findAndReplaceWorkspacePaths and it works for query layers but NOT for sde feature layers. So I guess I should combine both methods to get all the layers' connections changed, but this means changing the data source twice for every MXD. Isn't there a single method to do this all at once? I need all the process to be as fast as possible.
... View more
07-28-2016
02:29 AM
|
0
|
2
|
1313
|
POST
|
I have my own scripts to upload and register SOEs (based on this toolkit) and to change properties and add capabilities to services both editing the sddraft (as shown here) and editing services once they are already published (based on this with some extra code to edit capabilities). Everything works except that I cannot enable on mapservices the new capabilities I added when registering custom SOEs. The standard capability definitions are automatically added to sddraft files, therefore it's pretty easy to edit the sddraft to enable them. But what if I want to add some custom capabilities to the service? This does not seem the way to go. Using common sense I thought that editing the published mapservice using the ArcGIS Server Administrator API would be the way to do it but, just like with sddraft files, in the JSON definition of the service, under 'extensions', there's no 'TypeName' with the name of any of my new extensions. If I enable my custom capabilities on a mapservice from the Manager and use my script again, the JSON definition of the service now includes all my extensions and (as expected) they are enabled. I disable all of them again and run my script for the second time and they are still there and disabled (as expected). So custom capability definitions are not added by default to the JSON definition of services. Ok, so what should I do? For example, my PrintUtils extension looks like this (see below) in the JSON definition of one service (once I enabled it from the Manager). Should I add this in the JSON definition of each service? Do custom extension always have those same tags? I want to use my script to enable ANY custom extension any admin user may have registered with the server. ... "extensions": [ { "typeName": "PrintUtils", "enabled": "true", "maxUploadedFileSize": 0, "allowedUploadFileTypes": "", "capabilities": "", "properties": { "supportsSOAP": "false", "supportsREST": "true" } }, { *some other extension* } ], ... }
... View more
07-13-2016
02:51 AM
|
0
|
0
|
1074
|
POST
|
I'm also running into this, but I have no printer configured in my server. What to do then?
... View more
02-04-2014
01:05 AM
|
0
|
0
|
1326
|
POST
|
As the ArcGIs JS API doesn't support the catalan language I have created a resource bundle file for it (ca_ES). This is my app's structure: [HTML]C:/myApp/ index.html js/ app.js arcgis.js basic.js nls/ resources.js <-- resource bundle file ca_ES/ resources.js <-- resource bundle file (root)[/HTML] My nls/resources.js file is this: define({
root: {
toolbars: {
draw:{
addPoint: "Click to add a point <br/>Click <b>ESC</b> to dismiss"
}
}
},
"ca_ES": 1
}); And my nls/ca_ES/resources.js file is this: define({
toolbars: {
draw:{
addPoint: "Click per afegir un punt <br/>Premi <b>ESC</b> per descartar"
}
}
}); In my index.html file I have this: <script type="text/javascript">
dojoConfig= {parseOnLoad: true, locale: ca_ES, async: false, packages: [{name: "resources", location: "../../js/nls"}]
};
dojo.ready(function() {
esri.bundle = dojo.i18n.getLocalization("js", "resources", this.lang);
}
</script> In the future I'll do this with AMD but right now I'm working with pre-AMD code, so I don't know whether it's not working because of an AMD/lecagy mistake. Any idea of what is wrong or missing?
... View more
01-29-2014
01:47 AM
|
0
|
0
|
600
|
POST
|
I think the problem here are the default print templates. The legend is placed in the bottom of the page leaving very small room for the legend info. If a layer has too many symbols it will simply not be displayed in the legend. To check this, load just one or two layers in your app rendered with a simple renderer. You should see the layers info in the bottom left side of the page. The solution is simple. Edit the default print templates and place the legend elment somewhere else leaving more space for the layer info. And also check that "Shrink contents to fit frame" option to make the layer info fit the legend element (you'll find it in the Fitting strategy section inside the legend properties, here). Hope this helps.
... View more
01-28-2014
09:53 PM
|
1
|
0
|
1145
|
POST
|
As I use 2 attribute inspectors (one is read only). Every time I query a feature in the map a new attribute inspector widget is created (esri_dijit_AttributeInspector_0, esri_dijit_AttributeInspector_1, esri_dijit_AttributeInspector_2,....) and therefore I can't change its Delete button label, because its id is different every time too (dijit_form_Button_0, dijit_form_Button_8, dijit_form_Button_16,...). I've tried destroying the attr. inspector widget with the destroy() method so every time it's recreated it has the same id, i.e. esri_dijit_AttributeInspector_0, (and also the buttons in it) but to no avail. I've also tried with this, but it doesn't work: dijit.registry.byId("esri_dijit_AttributeInspector_0").destroy();
dijit.registry.remove("esri_dijit_AttributeInspector_0"); I don't know if this code behavior should be avoided. Do I only have an attribute inspector widget each time, only that with different label, or am I keeping each one created? ?_? I'd like to find it out but meanwhile what I'm doing is hide the widget's 'Detele' button and create my own 'Dismiss' button. Any code improvement is welcome. 😉 Here's my code: var layerInfos = [{
'featureLayer': featLayer,
'isEditable': true,
'showAttachments':false,
'showDeleteButton':false,
'disableAttributeUpdate':false,
'disableGeometryUpdate': true
}];
attInspector = new esri.dijit.AttributeInspector({
layerInfos: layerInfos
}, dojo.create("div"));
//selectedTemplate is the selected template picked by the user
selectedTemplate.featureLayer.applyEdits([newGraphic], null, null, function() {
var screenPoint = map.toScreen(getInfoWindowPositionPoint(newGraphic));
map.infoWindow.setTitle("Incident about " + featLayer.name);
map.infoWindow.setContent(attInspector.domNode);
map.infoWindow.resize(260, 265);
map.infoWindow.show(screenPoint, map.getInfoWindowAnchor(screenPoint));
templatePicker.clearSelection();
});
var DismissButton = new dijit.form.Button({ label: "Dismiss", "class": "deleteButton"});
var DoneButton = new dijit.form.Button({ label: "Done", "class": "closeButton"});
dojo.place(DismissButton.domNode,attInspector.deleteBtn.domNode, "before")
dojo.place(DoneButton.domNode, DismissButton.domNode, "after");
dojo.connect(attInspector, "onAttributeChange", function(feature, fieldName, newFieldValue) {
feature.attributes[fieldName] = newFieldValue;
feature.getLayer().applyEdits(null, [feature], null);
});
DoneButton.on("click", function(){
map.infoWindow.hide();
});
DismissButton.on("click", function(){
featLayer.applyEdits(null, null, [newGraphic]);
map.infoWindow.hide();
});
... View more
01-28-2014
02:25 AM
|
0
|
0
|
554
|
POST
|
My application is similar to this other sample where your suggestion won't work as a new button is created each time I click on the map to add a new feature. 😞
... View more
01-27-2014
01:47 AM
|
0
|
0
|
554
|
POST
|
I'm trying to capture the onkeyup event for the ESC key after a template is selected in the template picker, so that if a user decides he doesn't want to draw a feature when he has already selected a template just by pressing the ESC key the template will unselect with a drawToolbar. deactivate. My code is similar to this sample. Im using this code: var key_event_handle = dojo.isIE ? dojo.query('body')[0] : window;
dojo.connect(key_event_handle, "onkeyup", function(key) {
if (key.keyCode == dojo.keys.ESCAPE) { drawToolbar.deactivate();} //ESC = 27
}); The onkeyup event is only captured after I've drawn a first point. Once I've done that if will work every time. What am I doing wrong?
... View more
01-23-2014
02:51 AM
|
0
|
0
|
606
|
POST
|
The source of the problem is the locate I'm using (ca_ES). The ArcGIs JS API doesn't support the catalan language. When commenting out the locale setting in dojoConfig it works. Acording to the documentation I should create a new resource bundle file for my language. Is there any sample file to start with? I'm checking the online documentation. Hope I find something. BTW, checking that jsfiddle helped me realize what was the problem. Thanks!
... View more
01-23-2014
02:35 AM
|
0
|
0
|
294
|
Title | Kudos | Posted |
---|---|---|
1 | 02-12-2020 01:42 AM | |
3 | 10-30-2019 06:40 AM | |
1 | 01-28-2014 09:53 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|