|
POST
|
Apologies for borrowing this thread, but this question seems relevant: I cannot find any definitive answer or documentation when it comes to relying on DojoConfig for package loading. I'm in the middle of migrating a large ASP.NET / ArcGIS Javascript application from 4.21 to 4.27. I'm really hoping DojoConfig will be supported throughout the remainder of the 4.x lifecycle to buy me a few years of doing the following. It's mainly for my own folders. let locationPath = location.pathname.replace(/\/[^/]+$/, '');
window.dojoConfig = {
async: true, parseOnLoad: false, packages: [
{ name: "appJavascript", location: locationPath + "/js" },
{ name: "appJavascriptClasses", location: locationPath + "/js/classes" },
{ name: "appHtml", location: locationPath + "/html" },
{ name: "dojo", location: "../../4.21/dojo" },
{ name: "dijit", location: "../../4.21/dijit" }
],
has: {
"esri-native-promise": true
}
} The last two lines for /dojo and /dijit are really just examples of possibilities. I'm actually trying to cleanse my code of any Dojo references and only use plain vanilla Javascript. This must remain in AMD design, not ES modules. If I'm able to rid the code of all Dojo classes, I'd still need to make use of DojoConfig which appears to be necessary for the Require.js part of the SDK. Unless someone knows how to replace DojoConfig with vanilla Javascript...? I could not piece together a solution without loading require.js and using the "data-main" attribute, which I'd rather avoid.
... View more
09-07-2023
07:45 AM
|
0
|
0
|
1933
|
|
POST
|
Same problem with me. I'm using Portal (Enterprise 10.9.1), not AGO, and query results selection doesn't flash. It only Zooms. I've tried adding many back-to-back Flash actions. It never flashes the point. Frustrating. I just need to show the users the selected feature somehow. Does this work for anyone?
... View more
08-09-2023
06:20 AM
|
2
|
0
|
1625
|
|
POST
|
Thanks @DougBrowning for staying with me and offering more explanation and links. After some experimenting I see it's possible to get attributes transferred over. I never would have thought you can do a loop within Field Maps to call it with a URL from the popup. I don't like how you have to click the target GPS layer again when it reloads, but I saw in a separate thread ESRI did it by design for layer templates. I suppose this type of solution is better for what I need and more customizable all around. Certainly not an obvious workaround, and unfortunately a lot of effort that could have been avoided if attributes could simply be copied across various geometry types.
... View more
09-26-2022
02:36 PM
|
1
|
1
|
3151
|
|
POST
|
I really do want to follow you, but again I'm not clear. It's not that I don't understand how to write code, it's that I don't understand how to implement what I think you're suggesting: to generate a custom URL in a field value that'll display within the polygon popup...and the click event for this URL will somehow trigger a function to send all the selected polygon attribute values to the new GPS feature ($feature) through Arcade. That's a giant stretch from what I thought was even possible in an AGO web map + Arcade. Is this something people are already doing with examples, or something you suspect is possible but haven't actually done yourself? Just wanted to be clear. It may seem quick and easy , but that's because you already know how to do it. There are at least two steps in this workflow for which I'm not able to find ESRI documentation, so it's not obvious to me yet.
... View more
09-23-2022
02:51 PM
|
0
|
1
|
3186
|
|
POST
|
Absolutely no pressure to keep going with this conversation, but just to clarify the desired starting point for copying attributes is the user clicks on a parcel boundary (polygon) to indicate which feature they want to use for transferring the many field values we need in the new GPS point. Polygon attributes -> GPS point using "Copy attributes" isn't possible out of the box in Field Maps. I'm not following when you say "you'd have the popup of the point...". The goal is to not be clicking on a parcel centroid point like I have it now. I'd like them to click on parcel boundary polygons and exclude the centroid points layer entirely. They will clutter the map, since I have a separate meter point layer that will be used as well. Our field staff likely prefers to click on polygons instead of finding the appropriate point in the center. The problem is that the point to be collected by GPS isn't always inside the polygon. Regardless of whether there is anything else to add, any input is much appreciated!
... View more
09-21-2022
07:26 AM
|
0
|
3
|
3201
|
|
POST
|
Thanks @DougBrowning and @ZakBaron for offering ideas. Perhaps I missed something, but neither of those seems to offer a workaround for my exact need of selecting a polygon, using the selected polygon to then select the centroid point, and then copy attributes from the centroid point to the GPS feature being collected. URL parameters and relates are more for adding related features. Arcade solutions are for intersecting/containing polygons for wherever you're collecting a GPS feature, not what you clicked to manually select as the intended reference polygon to use for GPS point attributes. I cannot be guaranteed the GPS point will always be inside a polygon. It might be a few feet outside, and then the rule wouldn't apply. The user would have no direct control over which feature was used for copying attributes. I'll keep exploring. I just wish "Copy attributes" would apply across any two geometry types (point to polygon, polygon to line, polygon to point, etc.). I realize you can press down on a field to manually copy a single attribute and the manually paste it into a field in the new point, but I'm designing a solution for 50-100 thousand points over 2 years. I need the field workers to not have to do something tedious like all these steps every time. Using the "Copy attributes" button is by far the fastest and most foolproof method.
... View more
09-18-2022
07:25 PM
|
0
|
5
|
3215
|
|
POST
|
I'm putting together a solution that apparently won't work for "Copy attributes", and I noticed your documentation doesn't seem to exactly match the copy attributes behavior in Field Maps. I'd really like to copy attributes (in identically named fields) from a polygon layer to the target GPS point layer. It's not displaying the "Copy attributes" option when I select a polygon, but it does for a point layer in the same feature service. This is really unfortunate. Based on what I read below, it sounded like you can do anything across layers if you only want attributes copied: "The types you can choose are limited to those of the same geometry type." Under Feature Actions, I have "Copy attributes" selected for the type. I would think the documentation might as well say geometry must match for copy attributes to be enabled at all, or is there possibly some fix to make this work? I wish there was a way in Field Maps to programmatically copy attributes from a point based on the selected containing polygon. I have one parcel centroid point per polygon. Do I have any other options to make polygon to point work? The idea was to allow users to select a polygon feature for copying instead of the centroid point. Depending on the copy settings configured in the Field Maps web app, you can choose from the following options: Copy attributes—Copy the feature's attributes to a new feature. Copy shape—Copy the feature's shape to a new feature. Copy all—Copy the feature's attributes and shape to a new feature. Choose the type of asset or observation to capture. The types you can choose are limited to those of the same geometry type (for example, length or area) as the feature you are copying.
... View more
09-14-2022
02:37 PM
|
0
|
10
|
3746
|
|
POST
|
Hi Noah, True, I don't think the solution is perfect for the reasons you've stated, but here's my final solution below. I had to add a second function on top of the initial wrapped text in order to break really long continuous strings that exceeded the preferred character max. For example, if you included a long hyperlink like "https://community.esri.com/t5/arcgis-api-for-javascript-questions/print-task-not-printing-textsymbol-in-correct/m-p/1102254" function addLineBreaks(textLabel) {
//apply line breaks to wrap text with max width of 50 characters
const wrappedText = textLabel.replace(
/(?![^\n]{1,50}$)([^\n]{1,50})\s/g, '$1\n'
);
return wrappedText.replace(/(.{80})/g, "$1\n");
} My text symbol is defined as follows: var textSymbolGeneric = {
type: "text", // autocasts as new TextSymbol()
color: "white",
haloColor: selectedColor,
haloSize: "1px",
text: "",
xoffset: 0,
yoffset: 0,
font: {
size: 12,
family: "sans-serif",
weight: "bold"
},
lineWidth: 300,
horizontalAlignment: "left",
verticalAlignment: "bottom"
}; This is how it looks for verticalAlignment: "bottom" Note the orange circle edit point which indicates the starting point for where I clicked to add the text. This is how it looks if I accept the default verticalAlignment value of "baseline" While the baseline setting is preferred, since it goes downward based on where you clicked and started your text, the problem is when our users go to export the map to pdf. They expect whatever is showing on the map, with all their redline markups and text, will be sent to another person and appear the same way. I am forced to make text start from the "bottom" only because it's reliable in the output pdf. The result of printing the last image above, with "baseline" as the vertical alignment, will be the following. I realize it's difficult to compare to the one above without the line and point features, but you can see the text shifted to way above the thick white (highway) line. Side note: all the layers you're seeing turned on in this output pdf are not visible (unchecked in the layer list). This is a JS 4.20 application, way too large to share all the code broken up into many files. This is either another bug or something going on with my code. Either way it's not obvious to me yet, because the Web Map JSON string does not include those layers you see shown (blue and red lines, the yellow points, etc.). I would think the print task is including too much, but again maybe an oversight by me somewhere. For the sake of staying on topic with the original post I will not go further with this issue. I'm unfortunately out of time to offer anything else for now. It may be days before I can return to this discussion.
... View more
10-13-2021
08:35 AM
|
0
|
0
|
2841
|
|
POST
|
Also, I noticed multi-line text needs a vertical alignment of "bottom" in order to have a predictable location in the output pdf. verticalAlignment: "bottom" Otherwise, the default "baseline" setting will throw all text upward (when rendering the pdf) rather than going downward as it increases in length.
... View more
10-12-2021
01:33 PM
|
0
|
0
|
2849
|
|
POST
|
Noah, thank you so much for looking into it. Will this bug be marked by the ESRI Development team as a fairly high priority? Soon I will be deploying an application I've migrated from 3.x to 4.x, and I discovered lineWidth is ignored at the last minute. Taking your idea of adding line escapes, some of us need to do this dynamically. So I found a handy regular expression that works to wrap user input which is being entered through a textarea element. It looks like this patch will do the trick for now. function addLineBreaks(textLabel) {
//apply line breaks to wrap text with max width of 32 characters
const wrappedText = textLabel.replace(
/(?![^\n]{1,32}$)([^\n]{1,32})\s/g, '$1\n'
);
return wrappedText;
}
... View more
10-12-2021
01:09 PM
|
1
|
1
|
2851
|
|
POST
|
I'm having the same problem. The feature layer is only labeling with the code (abbreviation), not the full description, from the domain. I tried useCodedValues = true with version 4.20 and much older versions of the 4.x API. Nothing works, although it does work with MapImageLayer sublayers. const labelClassWaterLine = {
labelPlacement: "above-center",
labelExpressionInfo: {
expression: "$feature.PIPEMATERIAL + TextFormatting.NewLine +
$feature.EXPOSURETYPE"
},
useCodedValues: true,
symbol: {
type: "text",
color: "red",
haloSize: 2,
haloColor: "white"
}
};
... View more
08-02-2021
01:52 PM
|
0
|
0
|
822
|
|
POST
|
My application allows for multiple labels (multi-line) for a single sublayer in a MapImageLayer. The only problem is that I need to set the labelClass "useCodedValues" property to false for only certain fields, not an all-or-nothing (domain code vs description) for all fields in the labelClass. It needs to be false (show codes rather than descriptions) for a field named "PipeMaterial" in two different sublayers. Domain description values need to be showing for all other label fields. So my thought was to either: 1) Try to apply multiple label classes to the sublayer if PipeMaterial field is to be labeled, but this doesn't seem possible with a multi-line label setup for MapImageLayers. Maybe I'm wrong? 2) Apply a function to dynamically produce domain code values for those few fields that need to use the code rather than description. Let's assume I've pulled all the codes from a REST query and have them available. (PipeMaterial codes such as "AC" = "Asbestos Cement", "CAST" = "Cast Iron", etc...) So is the #2 option possible? Let's take this ESRI example below. How could I apply a function to get the actual value of the COUNTY_NAME field and replace it on-the-fly while labeling? // For Spokane County, WA, label will display: "Spokane County, Washington"
labelClass.labelExpression = '[COUNTY_NAME] CONCAT " County, " CONCAT [STATE_NAME]'; My goal using pseudo code: ...if [COUNTY_NAME] value is "Spokane County" then return "SPOK" for the actual label output value
... View more
08-02-2021
07:19 AM
|
0
|
0
|
662
|
|
POST
|
Yes, this is the answer/explanation. Thanks for posting. I also discovered this and should have mentioned it in an update after my original reply. The API is not so much to blame. It's the API documentation pages where you start to accumulate many cookie issues. ESRI should hopefully make adjustments on their side with the documentation, but for now we'll have to use a different browser to avoid getting a high issue count. On a related note, we also discovered something with our internal facing web server used for hosting the secure JS API web application. If we use the fully qualified name in the application URL it will not have any cookie issues generated from this server. (i.e. "servername.abc.xyz/myapplication" instead of just "servername/myapplication")
... View more
07-25-2021
06:42 AM
|
1
|
1
|
5407
|
|
POST
|
Does anyone have a workaround? This has become a very frustrating problem for me, too. I'm having to wait for 6,000 - 8,000 issues to be logged before my internally hosted application finishes loading. It's a fairly simple 4.19 API application. I really wish we could get ESRI's input on this.
... View more
06-16-2021
12:34 PM
|
3
|
0
|
5696
|
|
POST
|
You're welcome. That's correct, it's applying your function once for each layer's creation. I'm not sure it'll be a noticeable improvement in performance, but it's a must for logic if you only want something done once...or if you're simply trying to debug and you don't want to unnecessarily hit a breakpoint for the same layer multiple times. That's what was annoying me. I just think it's the proper way to handle it, unless they change the API.
... View more
05-12-2021
02:11 PM
|
1
|
1
|
4968
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 3 | 2 weeks ago | |
| 1 | 07-01-2025 10:14 AM | |
| 1 | 04-16-2025 09:49 AM | |
| 1 | 11-17-2020 03:34 PM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|