POST
|
If you have a relationship set up between the feature layer and the relationship table, you can use that directly using FeatureSetByRelationshipName function to return the related records for a feature. For example, this layer has several related tables. This is the code to loop through the related records from the related table "DCGIS.SURDOCS" for the feature. var related = FeatureSetByRelationshipName($feature, "DCGIS.SURDOCS");
for (var rec in related) {
}
... View more
5 hours ago
|
0
|
1
|
30
|
POST
|
This will be fixed in ExB DE 1.14, according to the staff at the Dev Summit.
... View more
10 hours ago
|
0
|
0
|
6
|
POST
|
This will be fixed in ExB DE 1.14, according to the staff at the Dev Summit.
... View more
10 hours ago
|
0
|
0
|
4
|
POST
|
There were a couple of issues. First, you were using a string ('1.0') instead of a number to check for metersize_inches. Also, you were missing some curly braces in the if statements. If I understand your logic, then this should work using the When function. When (//Meters less than or equal to 1.0 inches and installed less than or equal to 15 years ago
$feature.metersize_inches <= 1.0 && DateDiff(Now(), Date($feature.installdt), 'year') <= 15, "Small Meters installed up to 15 years ago",
//Meters greater than or equal to 1.5 inches and installed less than or equal to 10 years ago
$feature.metersize_inches >= 1.5 && DateDiff(Now(), Date($feature.installdt), 'year') <= 10, "Large Meters installed up to 10 years ago",
"None of these");
... View more
11 hours ago
|
0
|
1
|
97
|
POST
|
You can always add more fields to a label string. This example uses template literals. var output = `${$feature.field1} and ${$feature.field2}`
... View more
11 hours ago
|
0
|
0
|
3
|
POST
|
Line 19 should get the proper customer ID from the related table. What do you want to return if there's no related record?
... View more
11 hours ago
|
0
|
1
|
14
|
POST
|
You were returning the Console function instead of the CustomerID from the related layer. Give this code a try. I restructured it so it first checks if there's an intersection before getting the related table. // Define a Featureset (Customers) from the layer "Customers" in the $map
// that contains the attribute ['CustomerID']
var Customers = FeatureSetByName($map, "Customers", ['CustomerID']);
// Define a variable (code) to store the value we want
// Get the value by Intersecting the polygon location
// with the FeatureSet "Customers", or Customers
var code = First(Intersects($feature, Customers));
// If the current location intersects Customers,
// return the value in the field ['CustomerID'].
if (!IsEmpty(code)) return code['CustomerID'];
// If no intersect, pull customer id into related feature layer [PropertyBoundary]
var relcustid = First(FeatureSetByRelationshipName($feature.CustomerID, "Customers_PropertyBoundary"));
return relcustid["CustomerID"];
... View more
Friday
|
1
|
3
|
56
|
POST
|
The first thing you should do is check if the TaxRateCity is unincorporated. There's no need to do the expensive buffer and intersections if isn't in your jurisdiction. Next, you're buffering the feature twice. Only do that once. It looks like the feature only intersect one Zoning feature and one Zoning SP category, since you're not pushing the results into an array. If so, you can just get the First item in each intersection FeatureSet instead of looping through them. Here's my attempt at making this more efficient, also using template literals to make it easier to understand. Note, it's not tested, so it may need some tweaking. var revision_text ;
if ($feature.TaxRateCity != "unincorporated") {
revision_text = `This property is within the city of <b>${$feature.TaxRateCity}</b> and is out of our jurisdiction.<br/><br/>
Our zoning is only for the UNINCORPORATED areas of LA County.<br/><br/>
Contact city staff for zoning info.<br/><br/>
<a href='https://file.lacounty.gov/SDSInter/lac/1043535_city_webaddress.pdf'>Incorporated LA County Cities Contact List</a>`;
} else {
var featBuffer = Buffer($feature, -20, "feet");
var GeneralIntersect = First(Intersects(FeatureSetByName($map, "ZNET_Public - Zoning (Hidden from Map)"), featBuffer));
var SP_Intersect = First(Intersects(FeatureSetByName($map, "ZNET_Public - Zoning SP Category (Hidden from Map)"), featBuffer));
var zone_link = `https://library.municode.com/ca/los_angeles_county/codes/code_of_ordinances?nodeId=TIT22PLZO_${GeneralIntersect.TITLE_22}`;
var zone_area = `${Proper(GeneralIntersect.NAME)}-${GeneralIntersect.PLNG_AREA} Planning Area`
revision_text = `<a href='${zone_link}'><font color=#0066ff><b>${GeneralIntersect.Z_DESC} Zone (${GeneralIntersect.Z_CATEGORY})↗</b></font></a><br>
<span style='font-size:15px;'>Specific Zone(s): ${GeneralIntersect.Zone} <span>- ${SP_Intersect.PLAN_LEG}</span><span title='This may or may not be the same as the zone category above.
It can differ when extra numbers or letters are added to the end,
or when the property is part of a specific plan. Extra numbers
indicate a minimum lot size and letters indicate a combined
zone.'> ⓘ</span><br><br>
<span style='font-size:15px;'><b><i>Main Address:</i></b><i><br>
${$feature.SitusFullAddress}</i><br>
<b><i>AIN:</i></b><i> ${$feature.AIN}</i><br><br>
${zone_area}<br><br>
<a href='https://portal.assessor.lacounty.gov/parceldetail/${$feature.AIN}'><font color=#0066ff><i>Get Assessor Details for this Property↗</i></font></a><br>
<a href='https://rpgis.isd.lacounty.gov/Html5Viewer/index.html?viewer=GISNET_Public.GIS-NET_Public&run=UrlSearch&term=${$feature.AIN}'><font color=#0066ff><i>Go to this Property in GIS-NET↗</i></font></a><br>
<a href='https://planning.lacounty.gov/land-use-zoning/'><font color=#0066ff><i>Learn More about Zoning↗</i></font></a><br>
<a href='https://outlook.office365.com/book/RegionalPlanningVirtualOnlineAppointments@lacounty.onmicrosoft.com/'><font color=#0066ff><i>Schedule an Appointment↗</i></font></a></span>`;
}
return {
type : 'text',
text : `<span style=\"display: block; size: '20'; font-size: 16px; text-align: left; padding: 0.5rem; color: black; \">${revision_text}</span>`
}
... View more
Friday
|
0
|
0
|
26
|
POST
|
Your problem in the first line of the When function is a wind can't be both (&&) greater than 337.5 and 22.5. You want to check if it's greater OR (||) less than those values. An easier way to write that expression is var wind = $feature.Wind_Dir;
When(
wind < 22.5, 'N',
wind < 67.5, 'NE',
wind < 112.5, 'E',
wind < 157.5, 'SE',
wind < 202.5, 'S',
wind < 247.5, 'SW',
wind < 292.5, 'W',
wind < 337.5, 'NW',
wind < 360, 'N',
'NA'
); If the function doesn't evaluate the first line as true, then it moves to the second line. For example, if the wind is 30, it fails the first check and moves on to the second. You don't need to check if is greater than 22.4 and less than 67.5 since it already verified that it's greater than 22.5.
... View more
Friday
|
0
|
1
|
72
|
POST
|
It would be helpful to start a new discussion and give more information on what you're trying to do.
... View more
Thursday
|
0
|
0
|
47
|
POST
|
Web Viewer Classic is built with JavaScript 3.x, which doesn't support '\n' or TextFormmatting.NewLine. The new Map Viewer is built with Javascript 4.x, which does support these.
... View more
Wednesday
|
0
|
1
|
69
|
POST
|
If I understand your scenario correctly, each feature may have a number of related features. You want to sort those related records, not the feature itself. var relatedRecords = FeatureSetByRelationshipName($feature, "the relationship name");
var order = OrderBy(relatedRecords, "Treat_Date DESC");
var latest = First(order);
Iif(DateDiff(now(), latest.treat_date, 'months') < 12, "Treated", "Requires Treatment")
... View more
Tuesday
|
0
|
1
|
60
|
POST
|
You can Push the results into an array and use Concatenate to put them into a comma-separated string if (Count(records) == 0) return "No maintenance needed";
var output = [];
for (var f in truerecords) {
Push(output, f.Main_Type)
}
return Concatenate(output, ', ')
... View more
Tuesday
|
1
|
0
|
57
|
Title | Kudos | Posted |
---|---|---|
2 | Friday | |
1 | Friday | |
1 | Tuesday | |
1 | Tuesday | |
1 | 11-06-2023 09:43 AM |
Online Status |
Offline
|
Date Last Visited |
10 hours ago
|