|
POST
|
Did you add the module in the require statement at the top?
... View more
02-04-2021
08:51 AM
|
0
|
3
|
6296
|
|
POST
|
You could use point.distance() or geometry engine distance() or geodesicUtils geodesicDistance() or geometryEngineAsync distance() or geometry service distance().
... View more
02-04-2021
06:45 AM
|
0
|
8
|
6335
|
|
POST
|
Is this so you can zoom the map to a particular extent? If so, MapView.goTo() works with the Extent object. Zoom to extent of all features | ArcGIS API for JavaScript
... View more
02-03-2021
07:46 AM
|
0
|
0
|
1900
|
|
POST
|
Glad you found a solution and appreciate you posting it. I didn't realize that putting an object in the JS template literal that it comes out as [object Object] so that JSON.stringify() was a great find on your part!
... View more
02-01-2021
01:55 PM
|
1
|
1
|
4098
|
|
POST
|
I don't think JSON.parse() is available in Arcade so your assignment for planObj isn't needed. And just for testing to simplify everything, use the original JS object. What happens if you change it to var arcadeExp = `
var planObj = ${JSON.stringify(treatmentPlan.pavementIDs)};
var pvtID = 100;
return planObj[pvtID]`;
console.log(arcadeExp); Then add a console.log(arcadeExp) to make sure the Arcade expression is correct after JS inserts everything. You can verify the logged expression in the Arcade Playground.
... View more
02-01-2021
12:39 PM
|
1
|
3
|
4116
|
|
POST
|
Does it work without any of the JSON manipulation? I think Arcade should be able to use the JavaScript object natively.
... View more
02-01-2021
10:11 AM
|
0
|
1
|
4130
|
|
POST
|
We're in the same boat; lots of fcin, fcout that can't be dynamically renamed. To add to your menu of options, I'll mention that we use dictionaries instead of tuple pairs. dataSources = {
infc1: outfc1,
infc2: outfc2,
infc3: outfc3,
# etc...
}
for infc, outfc in dataSources.items():
... View more
02-01-2021
09:05 AM
|
0
|
0
|
3549
|
|
POST
|
I'm in a similar situation. Python is not a constant thing at the front of my mind. I find it helpful to browse GeoNet to keep current on the technology and learn new coding patterns. And of course, trying to answer questions. The best way to learn something is to teach it!
... View more
02-01-2021
08:25 AM
|
0
|
0
|
3563
|
|
POST
|
Here's what I would do. import arcpy
import os
inDir = r"\\filelocation"
inputmapfile = os.path.join(inDir, "Water Map Files", "Water Network.mapx")
outDir = r"\\filelocation\Mobile Map Packages"
waterLayer = [
"North_1",
"North_2",
"South_1",
"South_2",
"East_1",
"East_2",
"West_1",
"West_2"
]
for lyr in waterLayer:
inLyrx = os.path.join(inDir, "Water Map Files", "{}.lyrx".format(lyr))
outName = lyr.replace("_", " ")
outMmpk = os.path.join(outDir, "{} Water Network.mmpk".format(outName))
arcpy.CreateMobileMapPackage_management(
in_map=inputmapfile,
output_file=outMmpk,
in_locator="",
area_of_interest=inLyrx,
extent="DEFAULT",
clip_features="CLIP",
title="{} Water Network".format(outName),
summary="Mobile Map Package of the {} Water Network".format(outName),
description="",
tags="Water Network, {}".format(outName),
credits="",
use_limitations="",
anonymous_use="STANDARD",
enable_map_expiration="DISABLE_MAP_EXPIRATION",
map_expiration_type="ALLOW_TO_OPEN",
expiration_date="",
expiration_message="This map is expired. Contact the map publisher for an updated map."
)
... View more
02-01-2021
07:33 AM
|
2
|
2
|
3586
|
|
POST
|
As @Anonymous User mentioned, you need the table attributes to support this operation. Check out XY To Line and notice the id_field parameter. This tool only creates single line segments so you'll need to use dissolve to join longer segments together based on the id_field or some other field that you can include using attributes="ATTRIBUTES"
... View more
02-01-2021
06:17 AM
|
1
|
0
|
5957
|
|
POST
|
Yes, because it's just mashing up two existing sample apps. Just get rid of the point and line graphics to test with the polygon. I'm sorry, I don't have the time and ability to develop a solution for this in a reasonable amount of time. You're going to have to get creative on your own.
... View more
01-30-2021
07:35 AM
|
0
|
0
|
957
|
|
POST
|
I'm not able to develop a working solution for this but I think it should be possible. The extent indicator in the overview map is just a graphic so you should be able to modify it. Here's a solution that modifies a static graphic in a map view. I was also able to get the cursor to change when mousing over the overview extent graphic. You can use this on the 4.x example from above. // get screenpoint from mapView's pointer-move event
mapView.on("pointer-move", function(event) {
mapView.hitTest(event, {include: mapView.graphics}).then(function(response) {
// check if a feature is returned from the hurricanesLayer
if (response.results.length) {
document.getElementById("overviewDiv").style.cursor = "move";
const graphic = response.results[0].graphic;
// do something with the graphic
} else {
document.getElementById("overviewDiv").style.cursor = "default";
}
});
}); Be sure to post back here if you're able to build a working solution! 😀
... View more
01-29-2021
04:24 PM
|
0
|
2
|
4445
|
|
POST
|
You're mixing a lot of stuff up in that one assignment for arcadeExp. There are syntax issues the way you have it now. Try splitting it up like this to simplify the logic. If this app is meant for modern browsers (ES6) use template literals to make it more readable. var arcadeExp = `var indexPvtID = ${treatmentPlan.pavementIDs}.indexOf($feature.PvtID);
IIF(
indexPvtID >= 0,
${treatmentPlan.pavementCondition}[indexPvtID],
$feature.PCR_NBR
)`; It seems like there's a potential weak point with grabbing the value of pavementCondition based on index from pavementIDs. You'd be better off making pavementCondition an object where the keys are the values from pavementIDs and the value of each is whatever each value is in pavementCondition. pavementCondition = {
pavementID1: pavementConditionValue1,
pavementID2: pavementConditionValue2,
pavementID3: pavementConditionValue3,
pavementID4: pavementConditionValue4,
pavementID5: pavementConditionValue5,
// etc...
} Then you could var arcadeExp = `var pavementCondition = ${treatmentPlan.pavementCondition};
IIF(
HasKey(pavementCondition, $feature.PvtID),
pavementCondition[$feature.PvtID],
$feature.PCR_NBR
)`; I'm not an Arcade expert and haven't tested this so I might be missing something obvious but hopefully you can make it work.
... View more
01-29-2021
02:47 PM
|
1
|
8
|
4169
|
|
POST
|
Check out Generate Near Table. You can specify the closest_count parameter to how many results you want; 8 in your case.
... View more
01-28-2021
12:19 PM
|
2
|
0
|
999
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 1 | 10-23-2025 03:53 PM | |
| 1 | 04-28-2026 07:25 AM | |
| 1 | 03-19-2026 08:59 AM | |
| 1 | 02-12-2026 01:37 PM |