POST
|
Hi Chris, Thanks for the reply. I tested on the five devices I have available; here are the results: Windows 10 (Edge 121.0.2277.83): App works as expected! Windows 11 (Edge 120.0.2210.144): Issue persists Windows 11 (Firefox 122.0): Issue persists iPad running iOS 15.6.1 (Safari): Issue persists iPhone running iOS 17.0 (Safari): Issue persists I noticed that when I enter full screen on the one device that works, I get the "Press Esc to exit full screen" modal, but this doesn't happen on the other Windows devices.
... View more
02-01-2024
09:13 AM
|
0
|
4
|
1124
|
POST
|
Hi Chris, Yes, I'm using AGOL. Here is an example: Address & Parcel Viewer (arcgis.com) I see the same behavior in Edge and Firefox on Windows, as well as Safari on iOS.
... View more
02-01-2024
07:26 AM
|
0
|
6
|
1139
|
POST
|
Hi Aaron, this will delete a specific user's map areas. I've found the user.items() query to be lacking as well, so I always query user items with gis.content.search, like so: from arcgis.gis import GIS
gis = GIS("home")
username_to_search = ''
user_map_areas = gis.content.search(query=f"owner:{username_to_search}",
item_type='Map Area',
max_items=10000
)
for area in user_map_areas:
try:
delete_result = area.delete()
if delete_result:
print(f"Map area '{area.title}' ({area.id}) deleted.")
except Exception as e:
print(f"! Deletion failed for map area '{area.title}' ({area.id}). Exception: {e}")
... View more
01-31-2024
08:16 PM
|
0
|
0
|
581
|
POST
|
The full screen button on the map widget doesn't work to exit full screen - nothing at all happens when it's clicked while in full screen mode (doesn't exit full screen, and nothing logged to the console). Pressing Esc does nothing. Is the ExB team aware of this? The extent navigation, measure, select, basemap, and layer list buttons also do nothing while in full screen mode. @TonghuiMing
... View more
01-31-2024
07:23 AM
|
2
|
10
|
1303
|
POST
|
It's probably all the empty field names. Hard to say without seeing the actual CSV.
... View more
01-21-2024
03:45 PM
|
0
|
0
|
852
|
POST
|
Hi, I see two issues right away: There are no features in the addFeatures payload. You must pass an array of features to be added. addFeatures does not accept a 'where' parameter. You need to query your hosted (ArcGIS Online) feature layer, then pass those features to the 'features' parameter of the addFeatures payload. If you're wanting to do this in chunks, the chunks would be best handled on the query; in other words, query 2000 records and add them, then query the next 2000 and add those, etc. If you have attachments, those will need to be handled separately. But this should move your features over in 2000-feature chunks: import requests
import json
source_service_url = ""
destination_service_url = ""
batch_size = 2000
offset = 0
while True:
query_url = f"{source_service_url}/query"
query_params = {
"f": "json",
"where": "1=1", # Change if you want to specify which features to query from source
"outFields": "*",
"resultOffset": offset,
"resultRecordCount": batch_size,
"token": agoltoken
}
query_response = requests.get(query_url, params=query_params)
features = query_response.json().get("features")
if not features:
break # no more features to process
add_url = f"{destination_service_url}/addFeatures"
add_params = {
"f": "json",
"features": json.dumps(features),
"token": portaltoken
}
add_response = requests.post(add_url, data=add_params)
offset += batch_size
... View more
01-21-2024
01:59 PM
|
0
|
5
|
786
|
POST
|
This should work for you, or hopefully put you on the right track. The code below will delete ALL features in your service in 2000-record chunks, unless you modify the where_clause variable to specify only certain features. Use with caution. You may also want to look at Truncate (Feature Layer)—ArcGIS REST APIs | ArcGIS Developers if you are truly trying to delete every feature. import requests
feature_layer_url = "https://<your_server_url>/arcgis/rest/services/<some_feature_service>/FeatureServer/0"
where_clause = "1=1" # this will grab all features, or you can replace with a different where clause. The objectid chunks will be handled later.
batch_size = 2000
while True:
query_url = f"{feature_layer_url}/query?where={where_clause}&returnIdsOnly=true&f=json&token={portaltoken}"
query_result = requests.get(query_url).json()
object_ids = query_result.get("objectIds", [])
if not object_ids:
break # No more features to delete
for i in range(0, len(object_ids), batch_size):
batch_ids = object_ids[i:i + batch_size]
where_clause_with_ids = f"{where_clause} AND OBJECTID >= {min(batch_ids)} AND OBJECTID <= {max(batch_ids)}"
delete_params = {
'where': where_clause_with_ids,
'f': 'json',
'rollbackOnFailure': True,
'token': portaltoken
}
response = requests.post(f"{feature_layer_url}/deleteFeatures", data=delete_params)
delete_result = response.json()
if 'deleteResults' in delete_result:
deleted_features = delete_result['deleteResults']
for feature in deleted_features:
if 'success' in feature and feature['success']:
print(f"Deleted feature with objectId {feature['objectId']}")
else:
print(f"Failed to delete feature with objectId {feature['objectId']}")
else:
print(f"Error deleting features. Response: {delete_result}")
... View more
01-19-2024
01:47 PM
|
0
|
0
|
414
|
POST
|
Hi Adam, It's not clear to me what element type you're working with, but perhaps this will put you on the right track. I wrote an expression that checks your two conditions, then changes the background color of a list item if both conditions are met, and also adds the text ALERT to the item. var DateTieIn = $datapoint.DateTieIn;
var GISStatus = $datapoint.GISStatus;
var moreThanTenDays;
var alert;
var alertText;
IIf(DateDiff(NOW(), DateTieIn, "days") > 10,
moreThanTenDays = true,
moreThanTenDays = false
);
IIf(moreThanTenDays == true && GISStatus != "Mapped in GIS",
alert = true,
alert = false
);
IIf(alert, alertText = 'ALERT', alertText = null);
return {
textColor: '',
backgroundColor: IIf(alert, 'red', 'white'),
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
attributes: {alertText:alertText}
} The result looks like this: Here's how the Line item template is configured:
... View more
01-18-2024
11:42 AM
|
1
|
1
|
445
|
IDEA
|
We need to be able to select a large number of records in the Table widget (for example, after applying a filter in the Table widget, we want to select all the features that meet the filter). Currently, holding down Shift while clicking records does the same thing as holding down CTRL, meaning each record must be clicked individually, which isn't practical for hundreds of records. We would like to be able to select a record, scroll down, hold Shift, and click another record, selecting all records between the clicked rows, just like ArcGIS Pro, Excel, and the Attribute Table widget in WAB.
... View more
01-11-2024
09:55 AM
|
9
|
1
|
355
|
POST
|
Thanks Doug. I think the filters might be our best option here. From my testing, the only way to make the views in the offline area match the web map again is to update the map area, then have the user delete the map area from their device and re-download -- not ideal for workers in the field. I appreciate your help.
... View more
12-11-2023
02:02 PM
|
1
|
0
|
415
|
POST
|
I have a web map with five hosted feature layer views (all pulling from the same parent) representing different inspection statuses (pending, in progress, completed, etc.). This map is being used for offline field collection using map areas defined on the web map item. When edits are made to the inspection status and the offline area is synced on the device, the hosted feature layer view filter apparently fails to apply to exclude the previous value. For example, when changing from "pending" to "completed", points show for both statuses: Before edit, we have one feature at this location with status "pending": After changing the status to "completed" and syncing the offline map area, we now have two points at the same location, showing both statuses: Any ideas how to resolve?
... View more
12-08-2023
01:23 PM
|
0
|
2
|
516
|
POST
|
Oh shoot, I deleted my response because it looked like you had solved your issue already by the time I posted it. So here it is again for posterity: var unitNumber = $feature.UNIT_NUMBER
var hasValue
IIF(IsEmpty(unitNumber), hasValue="N", hasValue="Y")
return hasValue
... View more
12-01-2023
12:17 PM
|
0
|
0
|
1579
|
POST
|
In an AGOL notebook, you can just use gis=GIS("home"). In fact, that might be preferred over hardcoded credentials. This way, credentials aren't exposed, and if you change your password, you don't have to edit your Notebook code. That said, I think the bug that is discussed in the link I sent is probably not relevant in an AGOL Notebook anyway. Seems to be limited to Pro 3.1/Python API 2.2.0.3. But I could be wrong about that.
... View more
12-01-2023
12:05 PM
|
3
|
1
|
554
|
IDEA
|
Make the Query widget execute when Enter is pressed after entering a query term, instead of needing to click "Apply". This is a minor complaint, but also seems like an easy fix to make it match the behavior of the Query widget in WAB.
... View more
12-01-2023
12:00 PM
|
11
|
1
|
267
|
POST
|
There's a thread on this that might be of interest: Please ensure gssapi is installed - Esri Community But an easy fix might be to just use gis = GIS("pro") instead.
... View more
12-01-2023
11:48 AM
|
0
|
3
|
569
|
Title | Kudos | Posted |
---|---|---|
2 | 3 weeks ago | |
1 | 09-06-2020 10:46 PM | |
1 | 09-05-2020 03:41 PM | |
1 | 06-03-2024 04:01 PM | |
1 | 04-25-2024 05:25 PM |
Online Status |
Offline
|
Date Last Visited |
Tuesday
|