POST
|
What's happening with the Total and Selection counts if you select multiple rectangles without clearing the selection? I've selected just single parks with two rectangles, but the selection says 3.
... View more
2 hours ago
|
0
|
1
|
25
|
POST
|
Note that that sample isn't working correctly. Draw a rectangle to select features. Clear the selection and draw another rectangle. Both the features in the current rectangle and the previously selected features are highlighted.
... View more
4 hours ago
|
0
|
3
|
46
|
POST
|
Since I can't current edit my own post, please note that "auths" looks like this "auths": [
{
"location": "localhost",
"appId": "xxxxxxxxxxxxxxxx",
"popupCallbackUrl": "../assets/oauth-callback.html"
},
{
"location": "development server url",
"appId": "yyyyyyyyyyyyyyyy",
"popupCallbackUrl": "../assets/oauth-callback.html"
},
{
"location": "production server url",
"appId": "zzzzzzzzzzzzzzzz",
"popupCallbackUrl": "../assets/oauth-callback.html"
}
... View more
4 hours ago
|
0
|
1
|
38
|
POST
|
Today, I posted a response to a question, but realized I forgot something and tried to edit my post. However, the Post Options dropdown no longer contains the Edit option.
... View more
4 hours ago
|
1
|
4
|
75
|
POST
|
In my custom widget that I am current working on (so I don't have everything in place, such as the settings panel), I have a button to authenticate and return a specific layer that is shared with the user. It's a separate component from the main widget, which is imported and used like this: ...
import SignIn from '../components/SignIn';
...
return (
...
<SignIn getUrl={getUrl} {...props}></SignIn> //getUrl is a function that uses the url in the component to make a feature layer and add it to the map. This is the SignIn component. Since I haven't worked on the settings panel, I use tempConfig in its place. import { AllWidgetProps } from 'jimu-core';
import { Alert, Button } from 'jimu-ui';
import React, { useState } from 'react';
import OAuthInfo from '@arcgis/core/identity/OAuthInfo';
import esriId from '@arcgis/core/identity/IdentityManager';
import esriConfig from '@arcgis/core/config';
import Portal from '@arcgis/core/portal/Portal';
import PortalQueryParams from '@arcgis/core/portal/PortalQueryParams';
import tempconfig from '../assets/test_config.json';
import { IMConfig } from '../config';
import FeatureLayer from '@arcgis/core/layers/FeatureLayer';
export default function SignIn({ getUrl }, props: AllWidgetProps<IMConfig>) {
const [buttonText, setButtonText] = useState('Sign In');
const [signedIn, setSignedIn] = useState(false);
const [welcomeText, setWelcomeText] = useState('');
const [showAlert, setShowAlert] = useState(false);
const [alertMessage, setAlertMessage] = useState('');
let gridUrl: string = null;
let _portal: Portal;
let _ownerName: string = tempconfig.agolSettings.ownerName;
let _baseGridLayerName: string = tempconfig.agolSettings.baseGrid;
const portalUrl = tempconfig.agolSettings.portalUrl; //your portal
const appInfo = tempconfig.agolSettings.auths; //see below
let theAppId: string, thePopupCallbackUrl: string;
//functions
const formSubmit = () => {
if (signedIn) {
logOff();
} else {
logOn();
}
};
const logOn = () => {
setSignedIn(true);
setButtonText('Sign Out');
setShowAlert(false);
const loc = window.location.hostname;
const location = appInfo.find(
(x) => x.location === window.location.hostname
);
if (location !== undefined) {
theAppId = location.appId;
thePopupCallbackUrl = location.popupCallbackUrl;
} else {
setAlertMessage(
`This site (${window.location.hostname}) is not in the Authentication Location table in the Settings.`
);
setShowAlert(true);
logOff();
return;
}
const info = new OAuthInfo({
appId: theAppId,
flowType: 'auto',
popup: false,
});
esriConfig.request.trustedServers.push(portalUrl);
esriId.registerOAuthInfos([info]);
try {
esriId
.getCredential(info.portalUrl, { oAuthPopupConfirmation: false })
.then(() => {
_portal = new Portal({ url: portalUrl });
_portal.load().then(() => {
const queryParams: PortalQueryParams = {
num: 100,
query: `owner: ${_ownerName} AND type: "Feature Service" AND title: "${_baseGridLayerName}"`, //this finds the specific layer in AGOL
sortField: 'title',
sortOrder: 'asc',
};
_portal.queryItems(queryParams).then((results) => {
if (results.total == 0) {
setAlertMessage('The layer is not available');
setShowAlert(true);
logOff();
return;
}
if (
!results.results.some((item) => {
if (item.url == null) return false;
gridUrl = item.url;
return item.url.indexOf(_baseGridLayerName) > -1;
})
) {
setAlertMessage(
'You are not authorized to use this layer!'
);
setShowAlert(true);
logOff();
return;
}
setWelcomeText(`Welcome ${_portal.user.fullName}`);
getUrl(gridUrl);
});
});
});
} catch ({ name, message }) {
console.log(`***********${name}`);
console.log(message);
}
};
const logOff = () => {
setSignedIn(false);
setWelcomeText('');
setButtonText('Sign In');
esriId.destroyCredentials();
getUrl('');;
};
const styles = {
wrapper: {
display: 'flex',
margin: '10px',
alignItems: 'center',
justifyContent: 'space-between',
},
welcome: {
marginLeft: 'auto',
},
alert: {
margin: '10px',
width: 'auto',
},
};
return (
<>
<div className="wrapper" style={styles.wrapper}>
{/* <form onSubmit={formSubmit}> */}
<Button onClick={formSubmit}>{buttonText}</Button>
<div className="text" style={styles.welcome}>
{welcomeText}
</div>
</div>
<Alert
style={styles.alert}
text={alertMessage}
type="error"
open={showAlert}
/>
</>
);
} On Line 25, appInfo is an array of possible locations where the user is signing in from, along with the appId set up for that location. That looks like this: "auths": [
{
"location": "localhost",
"appId": "xxxxxxxxxxxxxxxx"
},
{
"location": "development server url",
"appId": "yyyyyyyyyyyyyyyy"
},
{
"location": "production server url",
"appId": "zzzzzzzzzzzzzzzz"
}
... View more
4 hours ago
|
0
|
2
|
45
|
POST
|
You'll have to use an Arcade element, which can return html code. var output = iif
(
IsEmpty($feature.Case_Study), " ",
`Read the ${$feature.Short_Title} <a href="${feature.Case_Study}">Case Study</a>`
);
return {
type : 'text',
text : output
}
... View more
Monday
|
0
|
0
|
96
|
POST
|
Here's an example how to do that using IIf, IsEmpty and template literals return iif(
IsEmpty($feature.expected_delivery),
status,
`${$feature.status}, ${$feature.expected_delivery}`
);
... View more
Monday
|
1
|
1
|
117
|
POST
|
While the documentation page discusses it as a class component, the code itself has been updated to be a functional component.
... View more
|
1
|
0
|
25
|
POST
|
You'd have to use this. for (var pnt in pt_fs) {
var in_fire = [];
var in_event = [];
var has_fire = Within(pnt, fire_poly);
var has_weather = Within(pnt, weather_poly);
Console("Outer for loop iterating.");
if (has_fire || has_weather) {
Console("First conditional passed."); I was testing on some public data and got it to work var portal = Portal("https://www.arcgis.com");
var fire_poly = FeatureSetByPortalItem(
portal,
"d957997ccee7408287a963600a77f61f",
1,
["IncidentName"],
true
);
var weather_poly = FeatureSetByPortalItem(
portal,
"a6134ae01aad44c499d12feec782b386",
6,
["Event", "Severity"],
true
);
var pt_fs = Top(FeatureSetByPortalItem(
portal,
"9e2f2b544c954fda9cd13b7f3e6eebce",
0,
["*"],
true
), 80);
var features = [];
var feat;
for (var pnt in pt_fs) {
var in_fire = [];
var in_event = [];
if (Count(Within(pnt, fire_poly)) > 0 || Count(Within(pnt, weather_poly)) > 0) {
for (var poly in fire_poly) {
if (Within(pnt, poly)) {
Push(in_fire, poly["IncidentName"]);
}
}
for (var poly in weather_poly) {
if (Within(pnt, poly)) {
Push(in_event, poly["Severity"] + " " + poly["Event"]);
}
}
console(pnt)
feat = {
attributes:
{
SAP_EQUIP: pnt["place"],
fire: IIf(IsEmpty(First(in_fire)), "N/A", Concatenate(in_fire, ", ")),
weather_event:
IIf(IsEmpty(First(in_event)), "N/A", Concatenate(in_event, ", "))
}
};
Push(features, feat);
}
}
var out_dict = {
fields: [
{ name: "SAP_EQUIP", alias: "SAP Equipment ID", type: "esriFieldTypeString" },
{ name: "fire", alias: "Name of Fire", type: "esriFieldTypeString" },
{
name: "weather_event",
alias: "Weather Event",
type: "esriFieldTypeString"
}
],
geometryType: "",
features: features
};
return FeatureSet(out_dict);
... View more
Thursday
|
0
|
2
|
126
|
POST
|
You can use Console to test out where the script is breaking. If I have a problem with the script, I sprinkle them throughout to find the problem line. As it turns out, I was incorrect for lines 48 and 54. I was mixing up the Withins. The one on line 46 is a FeatureSet Within and doesn't return a Boolean, while the other two are Geometry Withins which do return a Boolean. for (var poly in fire_poly) {
if (Within(pnt, poly)) {
Push(in_fire, poly["IncidentName"]);
}
}
for (var poly in weather_poly) {
if (Within(pnt, poly)) {
Push(in_event, poly["Severity"] + " " + poly["Event"]);
}
}
... View more
Thursday
|
0
|
4
|
157
|
POST
|
I was looking at the FeatureSet Within instead of the Feature Within. Still, when I ran a test on the Feature Within, it returns a FeatureSet. I misplaced a parenthesis in the second Count. Try this instead. if (Count(Within(pnt, fire_poly)) > 0 || Count(Within(pnt, weather_poly)) > 0) {
... View more
Thursday
|
0
|
7
|
168
|
POST
|
Your problem is on line 46 (as well as 48 and 54). Within returns a FeatureSet, which can't be directly evaluated in an if statement. You have to return some sort of boolean, such as if (Count(Within(pnt, fire_poly)) > 0 || Count(Within(pnt, weather_poly) > 0)) {
... View more
Thursday
|
0
|
9
|
211
|
IDEA
|
This is already available in the Field Maps Designer. See this documentation The Field Maps mobile app provides access to maps that are shared with or owned by a mobile worker. You may have maps that you don't want accessed from the mobile app. For example, you may have maps that are made for ArcGIS Dashboards that are for desktop use only. To hide maps you own from the Field Maps mobile app, complete the following steps...
... View more
Thursday
|
0
|
0
|
138
|
POST
|
Honestly, I'm stumped on this. I don't have access to a dataset on Oracle, so I can't do further testing to see how the syntax may be different..
... View more
Wednesday
|
0
|
1
|
64
|
Title | Kudos | Posted |
---|---|---|
1 | 4 hours ago | |
1 | Monday | |
1 | Friday | |
2 | a week ago | |
3 | a week ago |
Online Status |
Offline
|
Date Last Visited |
15m ago
|