|
POST
|
You needn't look far to know you're not alone in believing things in the API should be a certain way although they're not...perhaps here is a good example (and I have a workaround for that one too). You also needn't look far to find things that truly are bugs that don't get fixed nonetheless...even when documented down to the line of code and presented with a solution (here and here perhaps). In my 20 years of working with ESRI products, I've come to find that, at the end of the day, it's not a win if the API works as expected...it's a win if the final product works as expected.
... View more
07-24-2023
10:24 AM
|
0
|
0
|
1731
|
|
POST
|
If this behavior is by design, then it likely won't be classified as a bug, which might explain why you didn't get any traction last time. Fortunately, working around this is easy. Below is the code from the script tag in your codepen, with lines 28 - 34 added in order to provide the behavior you're looking for. require([
"esri/Map",
"esri/views/MapView",
], function(
Map,
MapView,
Expand
) {
const map = new Map({
basemap: 'topo'
});
// center the view over 48 states
const view = new MapView({
container: "viewDiv",
map: map,
center: [-100, 35],
zoom: 19,
constraints: {
snapToZoom: false
}
});
view.ui.add("scaleDiv", "top-left");
const scaleDiv = document.getElementById("scaleDiv");
view.watch('stationary', () => {
document.getElementById("scaleDiv").innerHTML = `Current scale: ${view.scale}<br> Max scale: ${view.constraints.effectiveMaxScale} <br> Min scale: ${view.constraints.effectiveMinScale}`;
});
view.on("mouse-wheel", function(evt) {
var viewScale = view.scale;
window.setTimeout(function() {
if ((viewScale == view.scale) && (viewScale != view.constraints.effectiveMinScale) && (viewScale != view.constraints.effectiveMaxScale))
view.scale = ((evt.deltaY > 0) ? view.constraints.effectiveMinScale : view.constraints.effectiveMaxScale);
}, 10);
});
}); Note that the mouse-wheel event occurs before the setting of the view's scale value. As a result, when the mouse-wheel event fires, the view's scale property is still set to the value it had before the mouse wheel was moved. The window.setTimeout call is used to work around that sequence.
... View more
07-20-2023
10:55 AM
|
1
|
2
|
1756
|
|
POST
|
The 4.x API uses native Promises instead of dojo's Deferred objects. To delay execution until multiple promises have resolved, you can use either Promise.all or Promise.allSettled, depending on which you find more suitable.
... View more
07-20-2023
10:02 AM
|
1
|
0
|
1165
|
|
POST
|
Thank you @BjornSvensson for the changes to the labeling documentation in 4.27; they speak well to the topics discussed further above. Only one issue I've noticed: in the "Non-MapImageLayer fonts" section of the Labeling page, it indicates the only font not supported in woff2 format is Palatino Linotype Regular, but I've noticed the first 4 fonts starting with "Arial" aren't supported either: Arial Bold Arial Bold Italic Arial Italic Arial Regular Will these Arial fonts be added to the repository, or should they be added to the list of exceptions in the documentation?
... View more
07-19-2023
05:19 PM
|
0
|
0
|
2948
|
|
POST
|
The error appears to be driven by your implementation of "gfxLayer". Can you provide more code as it relates to that object (i.e. its construction, setting of properties, etc)? I encountered this same error message yesterday, although it's unlikely we had the same problem. The error message occurs when an Array is expected, but a value of null is received. In my case, I was trying to use a UniqueValueRenderer created from JSON with the uniqueValueGroups specified. The JSON structure for uniqueValueGroups differs from the autocast structure, and is still undocumented, but I fumbled my way through it.
... View more
07-19-2023
03:55 PM
|
0
|
0
|
4586
|
|
POST
|
The PopupViewModel is attempting to highlight the feature on the map, but since the layer isn't added to the map, the process fails. If you set the highlightEnabled property on the Popup to false, you'll likely notice the error doesn't happen. However, the Popup will then not highlight features on any layer. I don't know if this meets the technical definition for a bug, but it could perhaps be handled more gracefully. After all, in looking at the documentation for the Search widget's resultGraphic property, it seems the intent is to still enable highlighting for all results.
... View more
07-19-2023
01:36 PM
|
0
|
0
|
6584
|
|
POST
|
Are you using the customParameters object to specify your CQL_FILTER value? My understanding is that you should be able to update this value without having to create a whole new layer object.
... View more
07-17-2023
10:30 AM
|
0
|
0
|
2003
|
|
POST
|
I haven't attempted a workaround, so can't say for certain, but what you've suggested sounds like a good starting point.
... View more
07-17-2023
10:18 AM
|
0
|
0
|
3714
|
|
POST
|
It seems likely this is the same underlying issue described in this thread. If that's the case, there may be a fix in the next release.
... View more
07-14-2023
04:46 PM
|
0
|
0
|
3737
|
|
POST
|
The problem occurs in the Calcite Panel component rendered on the popup, and the scrollbar appears as a result of the "content-wrapper" class, which is defined this way: .content-wrapper{overflow:auto} I've found that adding a bottom padding of 3px to the class definition prevents the scrollbar from appearing unnecessarily. However, since the panel is rendered within a shadow DOM, altering its style is not a simple matter of just overriding the class definition within a style tag. If you're using a local copy of the API, and loading modules via AMD, you can make the following change in esri/chunks/Panel.js: Search for: .content-wrapper{overflow:auto} Replace with: .content-wrapper{overflow:auto;padding-bottom:3px} If that's not an option, a much uglier hack is to alter the style definition at runtime. Just add the following near where your application starts up: require(["esri/chunks/panel"], (panel) => {
Object.defineProperty(panel.Panel, "style", {get:function(){return "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown)}:host([hidden]){display:none}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;overflow:hidden;--calcite-min-header-height:calc(var(--calcite-icon-size) * 3);--calcite-panel-footer-padding:0.5rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-ui-text-2);color:var(--calcite-ui-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}.container{margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;background-color:var(--calcite-ui-background);padding:0px;transition:max-block-size var(--calcite-animation-timing), inline-size var(--calcite-animation-timing)}.container[hidden]{display:none}.header{border-block-end:1px solid;z-index:var(--calcite-app-z-index-header);inline-size:100%;align-items:stretch;justify-content:flex-start;background-color:var(--calcite-ui-foreground-1);border-block-end-color:var(--calcite-ui-border-3);flex:0 0 auto}.action-bar-container{border-block-end:1px solid;z-index:var(--calcite-app-z-index-header);inline-size:100%;border-block-end-color:var(--calcite-ui-border-3)}.action-bar-container ::slotted(calcite-action-bar){inline-size:100%}.header-content{display:flex;flex-direction:column;overflow:hidden;padding-inline:0.75rem;padding-block:0.875rem;margin-inline-end:auto}.header-content .heading,.header-content .description{display:block;overflow-wrap:break-word;padding:0px}.header-content .heading{margin-inline:0px;margin-block:0px 0.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-medium)}.header-content .heading:only-child{margin-block-end:0px}.header-content .description{font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-2)}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3);border-inline-end-width:1px}.header-actions{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch}.header-actions--end{margin-inline-start:auto}.content-wrapper{overflow:auto;padding-bottom:3px}.content-height{block-size:100%}.content-container{display:flex;flex:1 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;background-color:var(--calcite-ui-background)}.footer{border-block-start:1px solid;display:flex;inline-size:100%;justify-content:space-evenly;background-color:var(--calcite-ui-foreground-1);border-block-start-color:var(--calcite-ui-border-3);flex:0 0 auto;padding:var(--calcite-panel-footer-padding)}.fab-container{position:sticky;inset-block-end:0px;z-index:var(--calcite-app-z-index-sticky);margin-block:0px;margin-inline:auto;display:block;padding:0.5rem;inset-inline:0;inline-size:-moz-fit-content;inline-size:fit-content}[hidden]{display:none}";}});
}); (The only effective change is the inclusion of the text ";padding-bottom:3px").
... View more
07-07-2023
04:08 PM
|
0
|
0
|
2262
|
|
BLOG
|
@TomNicoski - add this somewhere below the tag in which you import the css theme file: <style type="text/css">
.esri-view .esri-view-surface:focus::after {
outline: none;
}
</style>
... View more
06-30-2023
01:51 PM
|
2
|
0
|
1029
|
|
POST
|
The error you're receiving typically occurs for something like an infinite loop or infinite recursion. If the problem is occurring somewhere within the code you've provided, the most likely place for it to happen would be in whatever processing "myMethodToGetToken" is doing. Perhaps you could set up some breakpoints in that part of the workflow and ensure the code is doing what you intend.
... View more
06-28-2023
10:51 AM
|
0
|
3
|
2901
|
|
POST
|
The technical answer to the question in your second post is no. In 3.x of the API, a FeatureLayer would immediately begin retrieving its service info as soon as you instantiate it, but in 4.x, it doesn't do so until after it's added to a View. Therefore, since no features would have been retrieved between those two lines, there'd be nothing for you to update. Fortunately, there are still multiple ways you could accomplish what you're trying to do, and one way in particular stands out above the rest because (1) your code shows you already have the external JSON data with county-to-rate information loaded before adding the layer to the map, and (2) your layer already has a predefined empty field waiting to hold the appropriate value (render_Data). Your problem therefore is that you need to update that field after the application receives the FeatureLayer's data, but before the FeatureLayer processes it and renders it on the map. The SDK provides the means to do exactly that with the RequestInterceptor. To use a RequestInterceptor, you create one and add it to the "interceptors" property of the esri.config.request object. The "urls" value of your interceptor would be "https://gis.mo.gov/arcgis01/rest/services/DMH/DMH_county_simple/MapServer/0/query", and then you would define an "after" callback that loops through the returned features, and updates their render_Data values accordingly.
... View more
06-28-2023
10:35 AM
|
1
|
1
|
1289
|
|
POST
|
Have you considered the GroupLayer type? It might be a viable solution for what you're trying to accomplish.
... View more
06-27-2023
12:31 PM
|
1
|
1
|
1228
|
|
POST
|
Unfortunately, I don't think I'll be able to offer much else here. I remember a project a co-worker was working on had an issue resembling this one, and our solution at the time was to do what I described above. It seemed like some other components on the page had their own version of a "require" function which was causing the conflict, but that's about all I recall.
... View more
06-23-2023
02:24 PM
|
0
|
2
|
5671
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-19-2024 10:37 AM | |
| 1 | 03-31-2026 02:34 PM | |
| 1 | 12-09-2025 09:35 AM | |
| 2 | 12-09-2025 09:06 AM | |
| 1 | 11-26-2025 12:29 PM |