POST
|
I'm using the popupTemplate's title property to show a parcel number, but it automatically formats it as a parsed local number (1,234,567) instead of leaving it as the number from the field (1234567). I want the number to be displayed without the commas, but can't figure out how to get it to stop formatting it under the hood. Here's a sample of my code: this.parcelTemplate = {
title: title(),
content: [{
type: "fields",
fieldInfos: [
{
fieldName: "OwnerName",
label: "Owner"
}
]
}],
expressionInfos: [
{
name: "parcelNumber",
title: "Parcel Number",
expression: `
if ($feature.RP_ACCT_ID != 0) {
return $feature.RP_ACCT_ID
}
if ($feature.PIN != 0) {
return $feature.PIN
}
if ($feature.PNUM != null) {
return $feature.PNUM
} else {
return $feature.PIN_STRING
}`
}
]
};
function title() {
return "Parcel Number: {expression/parcelNumber}"
} The resulting popup shows: I think I need to use the Acade Number() function but can't figure out how to get it working since the parcelNumber expression is already returning the number in the format I want, and the title string doesn't seem to accept Arcade expressions. Any help is much appreciated, thanks.
... View more
10-04-2019
11:48 AM
|
0
|
1
|
998
|
POST
|
Thank you Undral Batsukh and Jose Banuelos. I got it working using Undrals suggestion: let form = new FormData();
form.set("attachment", file);
form.append("f","json")
... View more
12-10-2018
02:44 PM
|
1
|
0
|
1485
|
POST
|
Hey there, I'm trying to use the addAttachment method introduced in 4.9, but it always returns an error: Unexpected token < in JSON at position 0 even if the operation is successful. That's all I get returned from the call, but if I look at the network traffic I can see that the call was successful but is returning HTML when JSON is expected. Here is my code for the call, basically copied from the doc: FeatureLayer.addAttachment(feature, form).then(function (result) {
console.log('added successfully', result)
})
.catch(function (err) {
console.log('err', err)
}); The FeatureLayerEditResult that is returned is always an error, even though I can see that the operation was successful and can access the newly added attachment from future attachment queries. Do I need to explicitly request a JSON response somehow or something?
... View more
12-06-2018
11:45 AM
|
0
|
5
|
2301
|
POST
|
Good idea, but the 'on-the-ground' elevation is set by default, and doesn't make a difference if set explicitly. It seems like the API must be capable of calculating the centroid of a polygon given only its rings' x and y values, as when I click on a feature to open the popup, the resulting popup has the z information. I just can't figure out how it's doing the calculation.
... View more
06-25-2018
01:00 PM
|
0
|
0
|
944
|
POST
|
Thanks for replying, Andrew. That's not a bad idea, but the polygons that the popups are tied to don't have z values, and neither does the centroid of the polygons. The click-triggered popup does include z-values, so I bet that would fix my issue if I had access to those z values, but unfortunately I don't. Any idea how to calculate the z values for polygons that don't come with that data? There must be a way if the popup can do it on it's own..
... View more
06-18-2018
05:46 PM
|
0
|
2
|
944
|
POST
|
I think I'm narrowing in on the problem, but would still like some confirmation or insight if anyone is having a similar issue. I've found that a token is being applied to the web-map-as-json object for image services, but not for feature services. This is what the auto-generated parsed json looks like from the execute task: {
"operationalLayers": [
{
"id": "164155056a1-layer-3",
"title": "World Shaded Relief",
"opacity": 1,
"minScale": 0,
"maxScale": 0,
"url": "https://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer",
"token": null
},
{
"id": "164155056a1-layer-4",
"title": "World Imagery",
"opacity": 0.4,
"minScale": 0,
"maxScale": 0,
"url": "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer",
"token": null
},
{
"id": "worldElevation",
"title": "Terrain3D",
"opacity": 1,
"minScale": 0,
"maxScale": 0,
"url": "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",
"token": null
},
{
"id": "164155056a1-layer-5",
"title": "Name of Image Service",
"opacity": 1,
"minScale": 0,
"maxScale": 0,
"url": "https://path_to_image_service/ImageServer",
// TOKEN //
"token": "token_registered_with_ID_manager.",
"format": "jpgpng",
"mosaicRule": {
"mosaicMethod": "esriMosaicAttribute",
"where": "group_name LIKE 'Monitoring'",
"sortField": "imagery_date",
"sortValue": "1488326400000",
"mosaicOperation": "MT_LAST"
}
},
{
"id": "16415505679-layer-0",
"opacity": 1,
"title": "Feature Service Name",
"url": "https://path_to_feature_service/FeatureServer/0",
"visibility": true,
"layerType": "ArcGISFeatureLayer",
"showLabels": true
// NO TOKEN PROPERTY //
}
],
"mapOptions": {
"extent": {
"spatialReference": {
"latestWkid": 3857,
"wkid": 102100
},
"xmin": -8983724.50840311,
"ymin": 4791756.402744357,
"xmax": -8953149.697089082,
"ymax": 4801960.746020414
},
"spatialReference": {
"latestWkid": 3857,
"wkid": 102100
},
"rotation": -0.9701294052936191,
"scale": 8233
},
"exportOptions": {
"dpi": 96
},
"layoutOptions": {
"titleText": "",
"authorText": "",
"copyrightText": "",
"scaleBarOptions": {},
"legendOptions": {
"operationalLayers": [
{
"id": "16415505679-layer-0"
},
{
"id": "16415505681-layer-1"
},
{
"id": "16415505682-layer-2"
}
]
}
}
} I removed some sensitive info, but suffice to say the print works fine if I include only the image service, but if I include a feature service I get an error like: "Failed to create layer from service at https://path_to_feature_service". ALSO: If I manually add the token property to the feature service object in the web-map json and run that directly from the print service endpoint, it works like a charm. So my working theory is that the API is not appending a necessary token to all secure map layers, but only to image services. I find it strange that there is even a 'token' property in the ESRI layer objects, but not in our feature service objects. Any ideas?
... View more
06-18-2018
05:34 PM
|
0
|
0
|
307
|
POST
|
You could do something like this I think : function someFunction() {
pointerDownListener = view.on("pointer-down", function (event) {
event.stopPropagation();
// do more stuff
});
}); someFunction would fire when the tool is selected, or something of the like. event.stopPropogation will stop the click event from firing as it normally would, and then you can hook up your own events to fire. Here's some documentation: stopPropagation() Event Method
... View more
04-26-2018
03:00 PM
|
0
|
0
|
430
|
POST
|
I have a bit of code that programmatically opens a popup for a certain feature in a feature layer, but the resulting popup does not behave like I would expect. When viewed from NADIR, the location of the popup is correct, but if the sceneview is tilted, the popup does not stay at the specified location. This is not the case if you click on the feature itself to open the popup. In that case, the popup works perfectly. I put together a small codepen to illustrate the problem here: Popup Example - Once in the codepen, click the button in the upper left and the popup will open view the view.popup.open() method, and you should see the weird behavior when you tilt the view. - Then click the blue feature layer itself and you should see the popup reopen and exhibit the correct behavior. Any insight into a fix would be much appreciated! Thanks
... View more
04-26-2018
02:40 PM
|
2
|
5
|
1231
|
POST
|
Thanks Robert! Since I'm using the 4.x API, i ended up having to use the fetchGroups() method found here: PortalUser | API Reference | ArcGIS API for JavaScript 4.6, but same idea.
... View more
03-21-2018
08:42 AM
|
3
|
0
|
1165
|
POST
|
I've run a query against portal to return a list of all users, but the user objects returned don't include the groups that each user belongs to. Any ideas how to get this info? I've tried running a query against portal to return the groups, but can't get that to work. It always returns undefined... why doesn't normal syntax like 1=1 or '*' work when querying portal?
... View more
03-20-2018
02:57 PM
|
1
|
2
|
1801
|
POST
|
Update: Ok, some cooky stuff going on here. For the sake of meeting deadlines I tried implementing this workaround: let queryParameters = {
query: "username:a* OR username:b* OR username:c* OR username:d* OR username:e* OR username:f* OR username:g* OR username:h* OR username:i* OR username:j* OR username:k* OR username:l* OR username:m* OR username:n* OR username:o* OR username:p* OR username:q* OR username:r* OR username:s* OR username:t* OR username:u* OR username:v* OR username:w* OR username:x* OR username:y* OR username:z* OR NOT username:esri*",
num: 1000
}; .. querying for every letter followed by the wildcard variable '*' returns all of the users who's username starts with a lowercase letter. Pretty tedious, but progress. The problem is it doesn't return usernames that begin with an uppercase letter. OK, I thought, I'll just brute force it and add all uppercase letters followed by the wildcard variable to the query too.. but that doesn't work! Changing all of the letters to uppercase in the above snippet still only returns lowercase usernames. The only way to return a username that begins with an uppercase letter is to query for the exact username, which obviously doesn't work for loading all users dynamically.
... View more
03-08-2018
04:49 PM
|
0
|
2
|
763
|
POST
|
I'm trying to run a query against portal to return all the registered users, but can't figure out how to get a wildcard variable to work. This works: let queryParameters = {
query: "username:" + portal.user.username
};
portal.queryUsers(queryParameters)
.then(function(result){
console.log(result);
}) But I need to do something like this, which doesn't work: let queryParameters = {
query: "username:*"
};
portal.queryUsers(queryParameters)
.then(function(result){
console.log(result);
}) Any ideas are much appreciated.
... View more
03-08-2018
03:24 PM
|
1
|
4
|
1114
|
POST
|
I noticed the same thing. Heres a link to my post. https://community.esri.com/thread/207422-polyline-methods-bugged-in-46
... View more
02-22-2018
11:00 AM
|
0
|
0
|
3208
|
POST
|
tldr: Web_Map_as_JSON for print request includes correct mosaic rule where clause for image service layer, but resulting pdf does not honor the mosaic rule and draws the entire image service layer I'm having a problem with the execute print task method when exporting an image service layer. I use the mosaic rule where clause to toggle the visibility of individual raster items in the image service, but when I go to print, the entire image service is shown in the resulting pdf. I'm using unique names from a field published in the service to effectively filter raster items out of the entire layer, and am building the mosaic rule client side as rasters items are toggle on/off. I checked the network traffic for the request and the Web Map as JSON data passes the correct mosaic rule where clause in the execute print task request, but still shows the entire image service. There is no definition expression parameter listed in the spec to pass along with this request, either (spec here. I'm looking at the "syntax for an image service layer" option). Here is an example of what the 2D map looks like (only one raster item from the service is turned on): This is what I get in the print result (don't mind the different zoom level, it's the same map): if the image does not appear below, please refresh - We would expect the above image to only be showing the imagery that begins in the bottom right corner, up until it meets the imagery with more green vegetation in the center. The imagery in the top left corner is not the same raster item as the bottom right, and shouldn't be showing either. Has anyone else been able to successfully execute a print in the 4.x API that honors an image service layer's mosaic rule? As always, any insight is much appreciated.
... View more
01-23-2018
11:40 AM
|
1
|
2
|
715
|
Title | Kudos | Posted |
---|---|---|
1 | 12-11-2017 11:48 AM | |
1 | 11-13-2017 03:20 PM | |
1 | 11-06-2017 01:20 PM | |
1 | 09-25-2017 12:10 PM | |
1 | 09-25-2017 11:48 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|