|
POST
|
Hi - Is there some trick to getting the Attribute Table widget to honor field visibility settings in v 1.3? It appears my visibility values are set correctly, but then after signing out and signing back into the WAB, feature layer system attributes like OBJECTID, GlobalID, etc re-appear in the attribute table even though I have set their visibility to false. Thanks- David
... View more
02-29-2016
11:46 AM
|
1
|
4
|
3361
|
|
POST
|
Hi - does anyone know if Mobile 10.2.1 compatable with ArcGIS Server 10.4? Thanks David
... View more
02-22-2016
10:53 AM
|
0
|
6
|
8547
|
|
POST
|
That is really slick Tom, way to go. Hope to see you at Dev again here shortly- David
... View more
02-18-2016
02:16 PM
|
0
|
1
|
3145
|
|
POST
|
Yeah Ken I saw your earlier sample with slider node, got us thinking about child nodes in the legend and adding as the innerHtml content at 3.14, hence what we were able to come up with. But yes 3.15 much easier for sure Thanks for that- David
... View more
12-08-2015
11:08 AM
|
0
|
0
|
2081
|
|
POST
|
Update: With the 3.15 update, the above code is no longer needed, thank you ESRI . Now simply: mapMain.on("layers-add-result", function(results) {
var layerInfo = array.map(results.layers, function (layer) {
return {layer:layer.layer, title:layer.layer.id};
});
var layerList = new LayerList({
map: mapMain,
showLegend: true,
layers : layerInfo
}, "layerListDiv");
layerList.startup();
}); set the showLegend constructor option to true and you have your legend... David
... View more
12-02-2015
12:36 PM
|
0
|
4
|
2081
|
|
POST
|
Hi Akshay - see my post on how you can get at legend content to place as the innerHTML option for the layer list. It is tricky, especially the indexing differences between map layers and list layers. Hopefully the new release will make the work we did in the post below easier LayerList and setting Legend graphics Thanks David
... View more
11-25-2015
09:24 AM
|
0
|
0
|
1976
|
|
POST
|
Hi All - In working with the LayerList widget the past month or so we kept trying to figure out a way to get the symbology from the feature layer and Legend into the innerHTML of the option of the LayerList widget so that we can display the feature layers' graphic under each list node. So we went back to the map's on 'layers-add-result' event setting up the function to return each layer and each layers defined id as the title: mapMain.on("layers-add-result", function(results) {
layerInfo = array.map(results.layers, function (layer, index) { //dojo array
return {layer:layer.layer, title:layer.layer.id};
});
legend = new Legend({
map : mapMain,
layerInfos: layerInfo,
arrangement : Legend.ALIGN_LEFT
}, "legendDiv");
legend.startup();
for (i = 0; i < layerInfo.length; i++){ // cant use i=0, when a label layer is present,don't know why yet.
console.log(legend.layerInfos);
layerInfo.content = domConstruct.create("div", {
innerHTML: legend.domNode.childNodes[(layerInfo.length -1) -i].childNodes[1].innerHTML
});
}
layerList = new LayerList({
map: mapMain,
layers : layerInfo
}, "layerListDiv");
layerList.startup();
});
mapMain.on("zoom-end", function(results) {
legend.refresh();
for (i = 0; i < layerInfo.length; i++){
layerInfo.content = domConstruct.create("div", {
innerHTML: legend.domNode.childNodes[(layerInfo.length -1) -i].childNodes[1].innerHTML
});
layerList.refresh();
}
});
document.getElementById("legendDiv").style.display = "none"; Basically we (Michael Stranovsky) and myself discovered by setting a console log on the legend layerInfos, we could see that legend has a content property and that by stepping into the content property we could get at the innerHTML dom element that contains the graphic and at what index level. So the for loop says that for each layer, go into the content, construct a div and then set the innerHTML of each layer at child node index: [(layerInfo.length - 1) -i] Because the legend layer ordering is the reverse of the map layer ordering we add the additional (-i). At any rate, the innterHTML completes by stepping down one more childNodes element [1] to get at the graphic (childNodes element at [0] is the layer title text). Add the layerList Widgets, pass in the layerInfo value from the loop into the layerInfos option, and start the layerList. To keep from displaying the legend div, simply set it's display to none. If there are layers with zoom dependency, no childNodes element will be created in the legend because they don't exist yet. So add a on 'zoom-end' event with a legend refresh, loop through the layers childNodes elements again and refresh the layer list and when the node is created it will be added. Known issue(s): With a label layer present in the map, the loop counter must be started at 1. Don't know why yet. I also haven't tested this configuration using tiled or dynamic layers. I welcome any comments or insights . . . Thanks David
... View more
11-23-2015
01:32 PM
|
0
|
5
|
6282
|
|
POST
|
Hi Yue, no this hasn't been resolved for me yet, but I have had to step away from the WAB to reconfigure some of my javascript api apps. I'm looking to get back to this as soon as I can and will let you what I find Thanks- David
... View more
11-23-2015
11:52 AM
|
0
|
0
|
546
|
|
POST
|
Hi All - This is related to an earlier post of mine about migrating a search return from the geocoder widget's 'select' event to the new search widget's 'select-result' event. Basically, the post and code Search Widget Results - Not Cleared from infoWindow still applies, although in this earlier post the goal is to use an address to query one layer (say parcels), then use that result as an intersection to return info from a second layer (say floodzones). Well, what if you just want to return the first layer? In that case, just pass the select-result's event return feature geometry into the Query geometry, execute it and show your info window: function showLocation(evt) {
mapMain.graphics.clear();
if (evt.source.name == "Search by Address" || evt.source.name == "Search by Street") {
qPoint = evt.result.feature.geometry;
var queryParcels = new Query;
queryParcels.geometry = qPoint; //evt.result.feature.geometry;
var parQuery = lyrParcels.selectFeatures(queryParcels,FeatureLayer.SELECTION_NEW);
mapMain.infoWindow.setFeatures([parQuery]);
mapMain.infoWindow.show(qPoint);
if (qPoint != undefined) {
mapMain.centerAndZoom(qPoint, 10);
}
} else {
mapMain.infoWindow.show();
}
} But what about formatting your return when those results are pulling from subtyped or domained fields? In the above snippet, not an issue because we've stepped outside of the Search dijit and so the infoWindow setFeatures is going to utilize the feature layer's previously defined popupTemplate. But, if we are to utilize the full capability of the Search dijit, we want to be able to return a result not only by an address (or maybe an x,y) but also by each source layers' attributes themselves. In that case, you can't run another Query as the Search is already doing that. But because the Search doesn't utilize the popupTemplate, subtype and domain code descriptions become a formatting issue again with an infoWindow. So what Michael Stranovsky (primarily Michael) and myself did was to take a terrific little snippet that Jeff Pace set up a long time ago to loop through nested arrays to get at those descriptions and pass them into a formatter that you set on any field in your infoTemplate that has subtypes or domains: var subTypeVal;
getSubtypeDomain = function (fieldVal, fieldName){
var sourceLayer = s.activeSource;
//console.log(sourceLayer);
if (sourceLayer.featureLayer.typeIdField!=null) {
//console.log("Have Subtypes");
if (fieldName==sourceLayer.featureLayer.typeIdField) {
array.forEach(sourceLayer.featureLayer.types, lang.hitch(this, function (lsf) {
if (fieldVal==lsf.id){
fieldVal=lsf.name;
subTypeVal=lsf.id;
}
}));
} else {
array.forEach(sourceLayer.featureLayer.types, lang.hitch(this, function (lsf) {
if (lsf.id==subTypeVal){
array.forEach(lsf.domains[fieldName].codedValues, lang.hitch(this, function (domain) {
if (fieldVal==domain.code){
fieldVal=domain.name;
}
}));
}
}));
}
} else {
//console.log("No Subtypes");
subTypeVal=null;
array.forEach(sourceLayer.featureLayer.fields, lang.hitch(this, function (ldf) {
if (ldf.name==fieldName){
if (ldf.domain){
array.forEach(ldf.domain.codedValues, lang.hitch(this, function(domain){
if (fieldVal==domain.code){
fieldVal=domain.name;
}
}));
}
}
}));
}
return fieldVal;
}; Basically what were doing is setting up 2 parameter formatter that is checking for subtypes first. If a subtype field is found (typeIdField property) is found, (!=null) and while the subtypeField is set equivalent to the fieldName parameter, then go into each of the subtypes (while keeping fieldName and fieldVal in scope) and set up a call back for the fieldVal param to hitch the fieldVal param to a second call back function with parameter lsf (layerSubtypeField). While in this call back function if the id property of the fieldVal param is still equivalent to the lsf.id value, then set the fieldVal param equal to the subtype name and the subTypeVal var equal to the id or subtype code. We now have each subtype description for the subtype field. However, we still have to account for the different domains assigned to each subtype for each field. This is common in the full water-wastewater data model for example. So, nested ELSE says for each subtype, call back the source layer and (while the id value for the lsf param is still assigned to the subTypeVal var), then for each subtype and field, find the domain's coded values and hitch the values to another call back function (domain parameter) that will match the domain codes to the fieldVal parameter , while finally setting the domain description (domain.name) to the fieldVal parameter. Now, what to do or how to account for a Search widget source with no subtypes? In that case, complete the top level if with an ELSE that first resets subTypeVal to null (otherwise the loop is stuck) steps through each field and sets the domained field equivalent to the fieldName parameter, then for each field sets the codedValues for each domain equivalent to the fieldVal so we can then finally set the fieldVal equal to the domains description. Close everything and return fieldVal for the function. Lastly, just set the function as a formatter in the infoTemplate: infoTemplate: new InfoTemplate("${ProgramArea:getSubtypeDomain} Project", "<b>Name: </b>${ProjectName}</br><b>CIP#:</b> ${ProjectID}<br><b>Status: </b>${LifeCycleStatus:getetSubtypeDomain}" +
"<br><b>Acreage:</b> ${Shape_Area:convertSqFt}" +
"<br><a target='_blank' href='https://somerulstring/${ProjectName}.jpg'><b>Project Detail</b></a>"), I welcome any and all comments and corrections to my attempt to describe this code. But I will say that until such time as the Search can utilize the popupTempalate, I don't know of any other way to return subtype and coded value domain description in an infoTemplate. Cheers- David
... View more
11-23-2015
11:48 AM
|
2
|
0
|
3151
|
|
DOC
|
Good catch TAPAS. I was placing the showAttribution option after my lods array with no effect. Once I moved the option immediately below the extent option no issues: "mapOptions": { "extent": { "xmin": -9220178.659464002, "ymin": 3110495.6629237854, "xmax": -9103994.376470689, "ymax": 3177072.314560084, "spatialReference": { "wkid": 102100 } }, "showAttribution": false, "lods": [{ "level": 0, "scale": 18489297.737236, "resolution": 4891.96981024998 }, {
... View more
11-23-2015
07:41 AM
|
0
|
0
|
9848
|
|
DOC
|
thought so thanks for the confirm, I'll check my end
... View more
11-20-2015
01:51 PM
|
0
|
0
|
9848
|
|
DOC
|
Does the logo: false pair have to be included in the config for the showAttribution: false pair to behave? Because I'm still getting the map attribution display. Not an issue in my api Thanks David
... View more
11-20-2015
01:10 PM
|
0
|
0
|
9848
|
|
POST
|
Alistair- Sounds to me like you had changes to your directory structure between since your 10.2.2 install. I'd go back and look for any privilege or location changes to any directories, particularly to your config-store and/or directories folders. Without more info its hard to say. David
... View more
11-09-2015
08:39 AM
|
0
|
0
|
640
|
|
POST
|
Hi Rebecca - I have ye to be able successfully update cache storage format to combined bundle type at any release. For us though it's not really that big a deal as I just go ahead and delete the old cache and create new.... David
... View more
11-06-2015
09:40 AM
|
0
|
0
|
2607
|
|
DOC
|
Stand alone table searches would be really powerful -David
... View more
10-16-2015
02:06 PM
|
2
|
0
|
8733
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-01-2026 05:41 AM | |
| 1 | 06-26-2026 12:39 PM | |
| 6 | 06-25-2026 07:23 AM | |
| 1 | 06-17-2026 06:04 AM | |
| 1 | 06-08-2026 08:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|