POST
|
I'd like to symbolise a polygon by aggregating the values of point layers within in it. My map has a time slider, so those points inside the polygon will change depending on the map time range.
... View more
05-24-2018
09:23 AM
|
0
|
0
|
386
|
POST
|
I have a saved webmap containing layers pointing at an ArcGIS Server which is now switched off. I need to update webmap, changing the layer URLs to a new ArcGIS Server URL. Layers were added straight to the map using Add Layer From Web. I need the old webmap so I retain styling and popup configuration. My web map ID is also referenced in a JS app. Apparently I can edit the URLs for layers and apps, but not maps. Why? Anyone know a way to edit the layer URLs? From esri help: https://doc.arcgis.com/en/arcgis-online/share-maps/item-details.htm "URL (Apps and ArcGIS Server layers only)—Changing the URL of an ArcGIS Server layer is only recommended when you move the service to a different server. If you've changed the service—for example, added or removed layers—you should add the service as a new item. Any map that uses the moved layer will appear broken because it references the old URL. To fix the map, delete the layer, add it again with the new URL reference, and save the map. Any layer properties you saved to the item are still available. If you edit the URL of a changed service, the map may not display correctly, even after you readd the layer. You cannot edit the URL of a hosted feature or tile layer." Thanks, James
... View more
06-10-2015
09:26 AM
|
2
|
3
|
5214
|
POST
|
I had to get esri support onto this one in the end. By changing the url of the analysis service to "http://analysis1.arcgis.com/rest/services/tasks/GPServer/FindNearest" the application now returns results for users in my ArcGIS Online Organization. Doesn't seem to work for trial accounts however.
... View more
10-31-2014
12:32 PM
|
0
|
0
|
693
|
POST
|
Also posted to gis.stackexchange... esri JavaScript Spatial Analysis Services: Select appropriate helper services url from Portal for requested operation - …
... View more
10-13-2014
01:39 PM
|
0
|
0
|
693
|
POST
|
Hey Kelly, Thanks for taking a look. Here are the steps I use to reproduce... Go to http://www.deloitte-geospatial.com/rigplanner/ ( I will revise url for original post as github gives a different error) Open your browser's developer tools (I'm using Chrome) and show the network tab Search by Filter > Search. You do not need to change any of the default filter values Enter a valid ArcGIS Online username and password and hit OK. You should be able to see the api submit the gp task, then check it's status a few times before failing. When I examine the output of the final output I see jobStatus: esriJobFailed with an array of 4 messages. See the output from my original posting the JSON object. As I say this app was working fine up until a couple of months ago, and should return 2 objects when successful. i) The nearestLayer containing the 10 nearest points to the little rig marker, and also ii) the connecting lines from the marker to each point. It's a fun little proof of concept that we'd love to get working again. Cheers, James
... View more
10-06-2014
09:49 AM
|
0
|
0
|
693
|
POST
|
Hello, about 6 months ago I built a prototype JavaScript app which uses the spatial analysis service; FindNearest.Find Nearest—ArcGIS REST API: Spatial Analysis Service | ArcGIS for Developers The app ran fine for a few months, prompting users to log in to ArcGIS online, before submitting a task and returning results. Now my geoprocessing job is failing with: Select appropriate helper services url from Portal for requested operation","params". See below for full JSON response. You can also debug yourself at RigPlanner . Look at arcgis.js lines 215 to 255 to see me build my parameters object and submit the task. So what's changed? And what do I need to change to get my app returning results again? Cheers! { jobId: "j1d25d7282f4b43fab8bd626a59908963", jobStatus: "esriJobFailed", results: { }, inputs: { }, messages: [ ] {}, type: "esriJobMessageTypeError", description: "{"error": {"code" : 0, "messageCode": "GPEXT_015","message": "Select appropriate helper services url from Portal for requested operation","params": {}}}" {}, type: "esriJobMessageTypeError", description: "{"messageCode": "AO_100030", "message": "FindNearest failed."}" {}, type: "esriJobMessageTypeError", description: "Failed to execute (FindNearest)." {} type: "esriJobMessageTypeError", description: "Failed." } Message was edited by: James Parker Changed URL and added steps to reproduce error
... View more
09-30-2014
09:15 PM
|
0
|
4
|
3850
|
POST
|
Jim, No - I had someone else remake the maps :cool: But Jian Huang's solution in the post above seems like a goer. Use the JS API to try to modify the url. Did you try that yet? I'd be interested to know. Cheers, James
... View more
05-01-2014
08:38 PM
|
0
|
0
|
237
|
POST
|
OK update... Got it working locally with https and proxy after doing two things: 1. Manually putting my token on the esriRequest with a content object similar to Jeff's suggestion.
var connectingLines = esriRequest({
url: url,
content: { f: "json", token: token}
});
2. Realising that the trial arcgis online account I'd setup for this app had expired! doh. Hence the permissions warning. Now I need to figure out how to prompt for login on app load, instead of when I submit the gp job. http://deloittegeospatial.github.io/ Thank you both. James
... View more
04-15-2014
05:13 AM
|
0
|
0
|
473
|
POST
|
Hi Derek and Jeff, Thanks for your replies. Jeff - I can confirm from the proxy is being used. Derek - I've had some time to try and make your recommended changes. I've created a self signed certificate and and running everything over https locally now. I'm also using addProxyRule. I've posted my code up here: https://deloittegeospatial.github.io/ but don't have a proxy setup (not sure how I'd do that on github). Are you able to get it running locally? I'm still getting permission errors when I submit the geoprocessing task. Request URL: https://localhost/esriProxy/proxy.ashx?https://analysis.arcgis.com/arcgis/rest/services/tasks/GPServer/FindNearest/submitJob?f=json&analysisLayer=%7B%22layerDefinition
"You do not have permissions to use this resource." I actually can't get this running under any scenario now...https/http, proxy/no proxy. Supposed to be demoing it tomorrow :-S Any help appreciated. James PS proxy looks like this: <?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*"
mustMatch="false">
<serverUrls>
<serverUrl url="http://services.arcgisonline.com"
matchAll="true"/>
<serverUrl url="http://analysis.arcgis.com"
matchAll="true"/>
</serverUrls>
</ProxyConfig>
<!-- See https://github.com/Esri/resource-proxy for more information -->
... View more
04-14-2014
02:45 PM
|
0
|
0
|
473
|
POST
|
Yeah like a said before you need an AGOL account, as you do with all of the Spatial Analyst Services. esri charge you credits to use them. You can however sign up for a free developer account and get 200 free credits. My app only queries one feature at a time and so barely consumes credits. Analysis is one credit per 1000 features. Sign up and use my app to see working code. http://www.arcgis.com/features/free-trial.html http://www.esri.com/software/arcgis/arcgisonline/credits
... View more
03-19-2014
01:07 PM
|
0
|
0
|
393
|
POST
|
You can see my app for a limited period here: http://deloittegeospatial.github.io/ Code here: https://github.com/DeloitteGeospatial/deloittegeospatial.github.io/blob/master/js/arcgis.js Getting published GP services to work is a whole different problem set. I'm sure you've seen these documents but I would start here: http://resources.arcgis.com/en/help/main/10.2/index.html#/Analyzing_a_geoprocessing_service/00570000006v000000/
... View more
03-19-2014
07:56 AM
|
0
|
0
|
393
|
POST
|
Ganesh, Sure: http://jsfiddle.net/geo_james/uDX9a/1/ A free developer AGOL account works fine. I was considering my own GP model if I couldn't get this to work but we eventually cracked it. Thanks to Derek. Cheers, James
... View more
03-18-2014
03:19 PM
|
0
|
0
|
1109
|
POST
|
Hello all, I'm working with the new Spatial Analysis Services. Specifically FindNearest at "http://analysis.arcgis.com/arcgis/rest/services/tasks/GPServer/FindNearest" When I submit my job to this url by clicking a button I'm prompted to login to AGOL by the IdentityManager. I'd like to either prompt for login when the app loads, or better yet just suppress the sign in all together and login with a developer account I've created. Using IdentityManager and a ServerInfo object, I can prompt the user to login when the app loads. I then register the returned token with the IdentityManager. However, when I call my FindNearest function I get an error about access control allow origin and the request fails. My app is hosted locally. I've tried adding "analysis.arcgis.com" to esri.config.defaults.io.corsEnabledServers to no avail. XMLHttpRequest cannot load http://analysis.arcgis.com/arcgis/rest/services/tasks/GPServer/FindNearest/�?�OPERATOR%20LIKE%20%27%25%27%22%7D&maxCount=10&measurementType=StraightLine. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. I'm pretty sure analysis.arcgis.com is CORS enabled. So I'm guessing my ServerInfo is not set up correctly and I'm not generating a valid token/credentials to access analysis.arcgis.com.
esri.config.defaults.io.useCors = true;
esri.config.defaults.io.corsEnabledServers.push("analysis.arcgis.com");
//esriConfig.defaults.io.proxyUrl = "http://localhost/esriProxy/proxy.ashx?"
esri.config.defaults.io.proxyUrl = "http://localhost/esriProxy/";
var server = new ServerInfo({
server: "http://analysis.arcgis.com",
tokenServiceUrl: "https://www.arcgis.com/sharing/generateToken"
// I saw the below on my esri.id.server
//adminTokenServiceUrl: "http://analysis.arcgis.com/arcgis/admin/generateToken"
})
var loginDeferred = esri.id.signIn("http://analysis.arcgis.com", server);
loginDeferred.then(function (response) {
esri.id.registerToken(response);
})
$("#searchButton").click(function () {
var gp = new Geoprocessor("http://analysis.arcgis.com/arcgis/rest/services/tasks/GPServer/FindNearest");
var params = //skipped for space but I know these are fine
gp.submitJob(params, completeCallback);
}
I've also tried using a proxy in the event that CORS isn't working but can't seem to crack that either. Still get the CORS error message.
<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*"
mustMatch="true">
<serverUrls>
<serverUrl url="http://services.arcgisonline.com"
matchAll="true"/>
<serverUrl url="http://analysis.arcgis.com"
matchAll="true"/>
</serverUrls>
</ProxyConfig>
I'm doing at least one thing wrong... Cheers, James
... View more
03-13-2014
12:52 PM
|
0
|
4
|
1587
|
POST
|
I mean the ?token=.... param is added to the url regardless of whether I include the following line or not: content: { f: "json", token: token} I've just realised that I can leave out the content obj if i include the f=json param in the url function completeCallback(jobInfo) {
var url = "http://analysis.arcgis.com/arcgis/rest/services/tasks/GPServer/FindNearest/jobs/" + jobInfo.jobId + "/results/nearestLayer?f=json";
var token = esri.id.credentials[1].token;
console.log(token);
var nearRigs = esriRequest({
url: url
//content: { f: "json", token: token}
});
nearRigs.then(function (data) {
console.log("Data: ", data); // print the data to browser's console
}, function (error) {
console.log("Error: ", error.message);
});
}
... View more
03-05-2014
04:38 PM
|
0
|
0
|
1109
|
POST
|
Thanks Nils. We went about it slightly differently but your example was really useful My fix: http://forums.arcgis.com/threads/103931-How-to-use-a-Spatial-Analysis-Service-FindNearest-with-JS-api
... View more
03-05-2014
04:24 PM
|
0
|
0
|
484
|
Title | Kudos | Posted |
---|---|---|
2 | 06-10-2015 09:26 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|