|
POST
|
An Update: Turns out we don't need these dojo\query for css classes in the trigger-action event layerList.on("trigger-action", function(event) {
console.log(event);
var id = event.action.id;
if (id === "show-environmental"){
changeLegend(0);
//query("#collapseLegend").toggleClass("collapse in"); and we can also set the layer list and legend in the same container: layerList = new LayerList({ //LayerList
container: "collapseLegend",
legend = new Legend({
container: "collapseLegend", in our calcite-bootstrap maps project you can then bring in the panel: <div id="panelLegend" class="panel collapse">
<div id="headingLegend" class="panel-heading" role="tab">
<div class="panel-title">
<a class="panel-toggle collapsed" role="button" data-toggle="collapse" href="#collapseLegend" aria-expanded="false" aria-controls="collapseLegend">
<span class="glyphicon glyphicon-list" aria-hidden="true"></span>
<span class="panel-label visible-mobile-only">Legend</span>
</a>
<a class="panel-close visible-mobile-only" role="button" data-toggle="collapse" data-target="#panelLegend">
<span class="esri-icon esri-icon-close" aria-hidden="true"></span>
</a>
</div>
</div>
<div id="collapseLegend" class="panel-collapse collapse esri-layer-list esri-legend esri-widget" role="tabpanel" aria-labelledby="headingLegend"></div>
</div>
... View more
02-06-2017
11:34 AM
|
0
|
0
|
1769
|
|
POST
|
Ok I see now. I'm sure you already know that you can see the widget's view js from it's git arcgis-js-api/LayerList.js at 4master · Esri/arcgis-js-api · GitHub although I'm not sure if that helps you. We were able to at least get the legend element for each layer in the list to display from a trigger action by working with the legend. Not sure if that helps you either. It's here: https://community.esri.com/thread/189122-jsapi-4x-layerlist-and-legend-together?sr=inbox if you haven't seen it already
... View more
01-31-2017
02:05 PM
|
0
|
0
|
2186
|
|
POST
|
Hi Jason, ok I now see your issue and how you are having to account for that offset. I am using the calcite map bootstrap 4.x template for all of our api apps and so am not adding any margin or padding. Of course, the real fix for this lies with ESRI and upgrading the popup's widget code to handle selection graphics and paging . . .
... View more
01-31-2017
01:46 PM
|
1
|
0
|
3458
|
|
POST
|
Jason, if you check this post you can see a couple examples of how we're returning a selction grahic and poup results from our feature layes using the hitTest method: https://community.esri.com/thread/183372-jsapi-40-popup-set-highlight-graphic-on-feature-layer-click
... View more
01-31-2017
12:26 PM
|
0
|
2
|
3458
|
|
POST
|
I assume by visuals you mean style and css. I'd start by looking at the styling guide for 4.x and if the approaches listed there are too coarse then you can begin to go into the main.css for changes that you want to override in your own css.
... View more
01-31-2017
12:16 PM
|
0
|
2
|
2186
|
|
POST
|
Sure sure, I'm with you. Customers you know . . . but thanks. If I find anything I'll post
... View more
01-30-2017
01:30 PM
|
1
|
0
|
1710
|
|
POST
|
Hi Robert, now that the AddData widget at 2.3 allows adding from file, have you had a chance or the curiosity to see if the number of records in a zipped shapefile can be increased? Currently the limit is set to 1000, which sounds familiar, but I haven't been able to detect if that can be changed- Thanks David
... View more
01-30-2017
01:06 PM
|
0
|
2
|
1710
|
|
DOC
|
Hi James - there is a way to batch prepare a pick or user list. In the expression portion of the eSeach config.json you can supply a pipe seperated list of code and value pairs: "userlist": "10th St|10TH ST,10th Way|10TH WAY,11th Pl|11TH PL,11th St|11TH ST,12th St|12TH ST,13th St|13TH ST" Once you have the list configured the dojo combo box that Robert uses will begin to show suggestions as soon as you begin typing. David
... View more
01-27-2017
10:04 AM
|
2
|
0
|
9384
|
|
POST
|
Hi - here we go again apparently. Does anyone else have dynamic image services in their web maps? I've added my dynamic services to my primary web map and in Chrome 55.x the webmap won't fully load because of a deffered error: init.js:103 Uncaught Error: This deferred has already been resolved
at d (init.js:103)
at b.Deferred.resolve.callback (init.js:105)
at ArcGISImageServiceLayer.js:76
at ia (init.js:28)
at init.js:28
at ja (init.js:28)
at ga (init.js:28)
at s (init.js:30)
at HTMLScriptElement.<anonymous> (init.js:35)
d @ init.js:103
resolve.callback @ init.js:105
(anonymous) @ ArcGISImageServiceLayer.js:76
ia @ init.js:28
(anonymous) @ init.js:28
ja @ init.js:28
ga @ init.js:28
s @ init.js:30
(anonymous) @ init.js:35 when I look at line 4 or 13: at ArcGISImageServiceLayer.js:76 and go to line 76 I can see an "unsupported browser version" value in the callback: a[b],d=k<d?k:d,f=k>f?k:f;return{minValue:d,maxValue:f}},_loadRasterFormatModules:function(){D=new n;10>a("ie")?D.reject("unsupported browser version"):m(["./rasterFormats/JpgPlus","./rasterFormats/Png","./rasterFormats/Raw","./rasterFormats/TiffDecoder","./rasterFormats/Zlib"],function(a,c,d,f){p=a;E=c;v=d;y=f;F=!0;D.resolve(!0)})}});var A=null,r=null,I=function(a){"U1"===a||"U2"===a||"U4"===a||"U8"===a?(a="U8",r=Math.pow(2,8)-1,A=Uint8Array):"U16"===a?(r=r||Math.pow(2,16)-1,A=Uint16Array):"U32"===
Any Ideas? I've constantly had problems adding my image services to my webmaps in AGOL as is. Usually afer adding my service to our sarco.maps.arcgis.com I would then add the image servcie to my webmap from my org. I had to stop doing that some months ago becasue the webmap's add layer from org began constantly telling me 'unavailable' in the layers-to-add dropdown. Whenever that happened I would either lose any changes I made to the webmap if I didn't save, or if I did save then I would be saving without that particular image service in my webmap. Quite vexing as you can imagine. So I began to add my image services directly from my REST, but that is now causing webmap load problems. Thanks David
... View more
01-26-2017
11:17 AM
|
0
|
0
|
967
|
|
POST
|
Hi - In working with attachment relates with our secured referenced feature service in my webmap, it appears that there is a size limit of about 5 mb. PDF attachments above this limit will not display in Chrome's 55.x PDF extension after clicking the attachment link in the webmap popup. The same behavior extends to the WAB 2.2. Has anyone experienced this or can anyone tell me where or how to change this setting? Thanks, David
... View more
01-25-2017
02:11 PM
|
0
|
0
|
914
|
|
POST
|
Hi Russell - can you verify that you are using Web Tier authentication, this doesn't affect GIS Tier / token authentication
... View more
01-25-2017
01:28 PM
|
0
|
0
|
1313
|
|
POST
|
Yeah there you go. Much cleaner. This will help others too for sure
... View more
01-25-2017
08:30 AM
|
0
|
0
|
2299
|
|
POST
|
Hi - so we found a way to enable the legend to work with the layer list at 4.2 using the 'trigger-action' info from the layer list sample code. First, we set up a defineActions function to store the returns in an array of the layerLists' items: function defineActions(event) {
//console.log(event);
// The event object contains properties of the layer in the LayerList widget.
var item = event.item;
//console.log(item);
if (item.title === "Environmental Project"){
return [
[{
title: "Show Legend",
className: "esri-icon-layer-list",
id: "show-environmental"
}]
];
} else if (item.title === "Facilities Project"){
return [
[{
title: "Show Legend",
className: "esri-icon-layer-list",
id: "show-facilities"
}]
];
} else if (item.title === "Mobility Project"){
return [
[{
title: "Show Legend",
className: "esri-icon-layer-list",
id: "show-transportation"
}]
];
}
} Then set up a function that, upon view load, (1) sets up the layerList with it's createActionsFunction and a layerInfo nested array that contains the layerInfos as would be defined in the legend and an initial layerInfoIndex, (2) sets up the legend with the layerInfo var, (3) sets up a index function that will set (via a modulus) the layer info index each time it's called as part of (4), the layerList.on trigger-action event: app.mapView.then(function(result) {
layerList = new LayerList({ //LayerList
container: "collapseList",
view: app.mapView,
createActionsFunction: defineActions
});
var layerInfo = [
{layerInfos: [{
layer: lyrEnvBnds,
title: "Environmental Project"
}]},
{layerInfos: [{
layer: lyrFacBnds,
title: "Facilities Project"
}]}
],
layerInfoIndex = 0; //initial
legend = new Legend({
container: "collapseLegend",
view: app.activeView,
layerInfos: [{
layer: layerInfo[layerInfoIndex].layerInfos.layer,
title: layerInfo[layerInfoIndex].layerInfos.title
}]
});
function changeLegend(layerInfoIndex) {
console.log(layerInfoIndex);
legend.set(layerInfo[layerInfoIndex % layerInfo.length]); // % Modulus
console.log(layerInfo);
}
layerList.on("trigger-action", function(event) {
console.log(event);
var id = event.action.id;
if (id === "show-environmental"){
changeLegend(0);
query("#collapseLegend").toggleClass("collapse in");
} else if (id === "show-facilities"){
changeLegend(1);
query("#collapseLegend").toggleClass("collapse in");
}
});
}); There's alot going on here and I likely haven't decribed things fully or even fully accurate. We are working in Calcite maps and as such taking advantage of the css classes for 'collapse in' for the dojo query's toggleClass method. But it seems to work well in that each trigger-action fires the changeLegend funtion, getting the correct legend layer to display below the layerList widget: Great job mstranovsky for setting the initial index; for handling the super-tricky layerInfo and layerInfos arrays; and for the modulus method for the changeLegend function. Hopefully this is just a workaround until the legend is properly incorporated into the layerList widget and please feel free to add your comments Cheers- David
... View more
01-23-2017
10:54 AM
|
3
|
1
|
4305
|
|
POST
|
Hi Chuck, if you go here: jsapi 4.0 popup: set highlight graphic on feature layer click? you can see how we are using hitTest and then setting the graphic's geometry to the click response, in our case polygons. 'app' is just a var from the Calcite Maps and Bootstrap | ArcGIS API for JavaScript 4.2 calcite maps project that we started with instead of trying to port all of our 3.x css over. Yes we are rendering our feaure layers and adding to the map usint addMany, but what you are doing is essentially the same thing. At this point though I have to ask why are you trying to create a feature layer from these graphics? You don't need a feauture layer if all you want to do is show a popup since you've already defined the graphics' attributes.
... View more
01-23-2017
10:02 AM
|
2
|
2
|
5933
|
|
POST
|
Hi Rene - but this really doesn't address the issues surrounding the paging issues of the popup at 4.x now. While we have managed to solve getting a graphic return from our feature layers using hitTest, we continue to confounded by the inability of the popup to page fetures - except when a user performs a click on the basemap and two or more features intersect the popups otb tolerance graphic. This tolerance graphic seems to be a bit of a black box - we can't get at it but it's obvious that there is some paging functionality present. Yes, we could return a query from each feature layer, but thaht's like going back to old 3.x identify method using a map service. Thanks, David
... View more
01-23-2017
09:24 AM
|
3
|
0
|
7229
|
| 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 |
Tuesday
|