POST
|
Greetings, I'm trying to build a find nearest tool that uses the REST API to perform a Find Nearest analysis. Right now I'm working in the service directory form to get some simple results. From there I'll integrate into an http call from a Java application. I'm walking through the documentation to build out a simplified example and entering the information into the html form (accepting most of the defaults) as such: analysisLayer: { "layerDefinition": { "geometryType": "esriGeometryPoint", "fields": [{ "name": "OBJECTID", "type": "esriFieldTypeOID", "alias": "OBJECTID" }] }, "featureSet": { "geometryType": "esriGeometryPoint", "spatialReference": { "wkid": 4326 }, "features": [{ "geometry": { "x": -78.78227, "y": 35.78691 }, "attributes": { "OBJECTID": 1 } }] } } nearLayer: { "layerDefinition": { "geometryType": "esriGeometryPoint", "fields": [ { "name": "OBJECTID", "type": "esriFieldTypeOID", "alias": "OBJECTID" } ] }, "featureSet": { "geometryType": "esriGeometryPoint", "spatialReference": { "wkid": 4326 }, "features": [ { "geometry": { "x": -78.78845, "y": 35.79748 }, "attributes": { "OBJECTID": 1 } }, { "geometry": { "x": -78.79154, "y": 35.78691 }, "attributes": { "OBJECTID": 2 } }, { "geometry": { "x": -78.78604, "y": 35.78272 }, "attributes": { "OBJECTID": 3 } }, { "geometry": { "x": -78.77162, "y": 35.79192 }, "attributes": { "OBJECTID": 4 } }, { "geometry": { "x": -78.77541, "y": 35.78774 }, "attributes": { "OBJECTID": 5 } } ] } } measurementType: StraightLine MaxCount: 100 searchCutoff: 5000 searchCutoffUnits: Meters timeOfDay: null timeZoneForTimeOfDay: GeoLocal I'm getting cryptic errors upon clicking the Submit Job (POST) button: esriJobMessageTypeError: {"messageCode": "AO_100030", "message": "FindNearest failed."} esriJobMessageTypeError: Failed to execute (FindNearest). esriJobMessageTypeError: Failed. I'm assuming that there are some details that are expected from my analysisLayer and nearLayer JSON objects. However, I am unable to determine why the process failed from the error message. Does anyone recognize any issue with my JSON objects or is there a way that I can access a more detailed error message? Thanks, Tyler
... View more
02-08-2018
05:50 AM
|
0
|
1
|
1644
|
POST
|
Greetings, Does Portal for ArcGIS share to ArcGIS Hub? I'm curious how these applications interact with each other. Thanks, Tyler
... View more
01-03-2018
05:25 AM
|
0
|
3
|
2288
|
POST
|
Greetings, I have a ESRI JS API (3.19) map with Bootstrap 3.3.7 in an iFrame in a long page. The map is in the center of the page. When the user scrolls up and down the page, the map hijacks the page scroll and either zooms in or out. I want to disable to scroll in the map until the user clicks within the map. However, I am unable to disable the map's scrolling zoom using 'map.disableScrollWheelZoom()' . I've also set 'map.isScrollWheelZoom = false' for safe measure. The map continues to scroll, however. Is there any way to disable to scroll wheel zoom? Thanks, Tyler
... View more
12-14-2017
07:08 AM
|
0
|
1
|
926
|
POST
|
I saw that graphicsLayer is not a valid type. I'm wondering if there is a way to hack into the legend's DOM get the graphics layer's symbology and dynamically create some HTML to push into the legend wrapper. Has anyone doen anything like that?
... View more
10-16-2017
12:56 PM
|
1
|
1
|
1261
|
POST
|
Greetings, I'd like to be able to add graphicsLayers into my legend instance. Has anyone added a graphicsLayer to the legend widget? Thanks, Tyler
... View more
10-16-2017
09:13 AM
|
0
|
3
|
1866
|
POST
|
I'd like to create spoof a tolerance for the graphicsLayer clicke event. I'd like to create something like the IdentifyParameter tolerance property so someone does not have to click a graphic's geometry exactly to fire the click event. Is there a way to spoof a tolerance for the graphicsLayer's click event? Thanks, Tyler
... View more
10-11-2017
10:22 AM
|
0
|
2
|
769
|
POST
|
That was it. I now have my graphicsLayers and featureLayers reporting in the same popup.
... View more
10-11-2017
09:31 AM
|
0
|
0
|
1281
|
POST
|
The error I'm getting is: Uncaught TypeError: a.getLayer is not a function at Object.<anonymous> (init.js:1179) at Object.forEach (init.js:70) at Object._processFeatures (init.js:1179) at Object.<anonymous> (init.js:63) at Object.<anonymous> (init.js:644) at Object.c [as onSetFeatures] (init.js:119) at Object._updateFeatures (init.js:1178) at Object.setFeatures (init.js:1171) at Object.n (init.js:157) at Object.setFeatures (init.js:1137) Thanks, Tyler
... View more
10-11-2017
07:54 AM
|
0
|
0
|
212
|
POST
|
Hi Robert, the graphics are contained in a graphicsLayer in the map. I have an 'on click' event on the graphicsLayer. The graphicsLayer 'on click' event is used to populate an array of features (graphicsLayerFeatures) returned by the event: graphicsLayer.on("click", function(event){ var graphicFeature = {}; graphicFeature.geometry = event.graphic.geometry; graphicFeature.attributes = event.graphic.attributes; graphicFeature.infoTemplate = event.graphic.infoTemplate; var sms = new SimpleMarkerSymbol().setStyle(SimpleMarkerSymbol.STYLE_SQUARE).setColor(new Color([255,0,0,0.5])); graphicFeature.symbol = sms; graphicsLayerFeatures.push(graphicFeature); } I am attempting to add to graphicsLayerFeatures later in the event chain to add features returned by a an identify task performed on a number of feature layers. I want to combine info from both graphicsLayers and featureLayers in my popup so that the user may seamlessly iterate over the results from both layer types using the popup's left and right arrows.
... View more
10-11-2017
07:39 AM
|
0
|
2
|
1281
|
POST
|
Hi Robert, The documentation for the Popup digit says that the required parameters are features. The features are an array of features or deferreds (i.e. Graphic[ ], Deferred[ ]). However, I am only able to pass a single graphic to this method in testing. For example, I have the following graphic array: var graphicsLayerFeatures = [{"geometry":{"type":"point","x":-8767571.07357861,"y":4253201.3693682095,"spatialReference":{"wkid":102100}},"attributes":{"Type":"Water Meter Asset","Name":"Meter: 73186851","Id":"02i0x00000054jOAAQ"},"infoTemplate":{"title":"Water Meter Asset","content":"Type: ${Type} <br/>Name: ${Name} <br/><span class='link' onclick='LinkAsset(\"02i0x00000054jOAAQ\",\"Salesforce\")'>Link Asset</span>"},"symbol":{"style":"square","color":{"r":255,"g":0,"b":0,"a":0.5},"size":16,"outline":{"width":1.3333333333333333,"color":{"r":0,"g":0,"b":0,"a":1},"style":"solid"}}}] If I pass this graphics array with one graphic in it (i.e. map.infoWindow.setFeatures(graphicsLayerFeatures)) map.infoWindow.setFeatures() fails with an error of: Uncaught TypeError: a.getLayer is not a function at Object.<anonymous> (init.js:1179) at Object.forEach (init.js:70) at Object._processFeatures (init.js:1179) at Object.<anonymous> (init.js:63) at Object.<anonymous> (init.js:644) at Object.c [as onSetFeatures] (init.js:119) at Object._updateFeatures (init.js:1178) at Object.setFeatures (init.js:1171) at Object.n (init.js:157) at Object.setFeatures (init.js:1137) However, if I pass only a graphic to map.infoWindow.setFeatures(i.e. map.infoWindow.setFeatures(graphicsLayerFeatures[0]) then map.infoWindow.setFeatures() succeeds. How do I set more than on feature using map.infoWindow.setFeatures? Thanks, Tyler
... View more
10-11-2017
06:51 AM
|
0
|
1
|
1281
|
POST
|
Hi. I'm trying to use map.infoWindow.setFeatures(). Does anyone know where I can view the documentationz? It's not listed in the InfoWindow help documentation. I want to know what the arguments are. Thanks, Tyler
... View more
10-11-2017
04:53 AM
|
0
|
6
|
2469
|
POST
|
Its still dying at map.infoWindow.setFeatures(graphicsLayerFeatures); The JSON for graphicsLayerFeatures looks like: [{"geometry":{"type":"polygon","rings":[[[-8768009.64172613,4252914.910190374],[-8768007.41799213,4253855.89837671],[-8767070.558637924,4253853.624670654],[-8767072.86179002,4252912.636868052],[-8768009.64172613,4252914.910190374]]],"_ring":0,"spatialReference":{"wkid":102100,"latestWkid":3857}},"symbol":null,"attributes":{"OBJECTID":"530","Grid":"67913","SHAPE":"Polygon","GlobalID":"{BA7BB332-5E11-404A-A37F-0C7F0F8E5E89}","SHAPE.STArea()":"6249760.10791","SHAPE.STLength()":"9999.808084","layerName":"Utility Grid"},"infoTemplate":{"title":"AREANAME","content":"OBJECTID: 530<br/> Grid: 67913<br/> GlobalID: {BA7BB332-5E11-404A-A37F-0C7F0F8E5E89}<br/> "}},{"geometry":{"type":"point","x":-8767571.07357861,"y":4253201.3693682095,"spatialReference":{"wkid":102100}},"attributes":{"Type":"Water Meter Asset","Name":"Meter: 73186851","Id":"02i0x00000054jOAAQ"},"infoTemplate":{"title":"Water Meter Asset","content":"Type: ${Type} <br/>Name: ${Name} <br/><span class='link' onclick='LinkAsset(\"02i0x00000054jOAAQ\",\"Salesforce\")'>Link Asset</span>"},"symbol":null},{"geometry":{"type":"polygon","rings":[[[-8768009.64172613,4252914.910190374],[-8768007.41799213,4253855.89837671],[-8767070.558637924,4253853.624670654],[-8767072.86179002,4252912.636868052],[-8768009.64172613,4252914.910190374]]],"_ring":0,"spatialReference":{"wkid":102100,"latestWkid":3857}},"symbol":null,"attributes":{"OBJECTID":"530","Grid":"67913","SHAPE":"Polygon","GlobalID":"{BA7BB332-5E11-404A-A37F-0C7F0F8E5E89}","SHAPE.STArea()":"6249760.10791","SHAPE.STLength()":"9999.808084","layerName":"Utility Grid"},"infoTemplate":{"title":"AREANAME","content":"OBJECTID: 530<br/> Grid: 67913<br/> GlobalID: {BA7BB332-5E11-404A-A37F-0C7F0F8E5E89}<br/> "}},{"geometry":{"type":"point","x":-8767570.516981157,"y":4253194.793324914,"spatialReference":{"wkid":102100}},"attributes":{"Type":"Water Meter Asset","Name":"Meter: 73193287","Id":"02i0x00000054jHAAQ"},"infoTemplate":{"title":"Water Meter Asset","content":"Type: ${Type} <br/>Name: ${Name} <br/><span class='link' onclick='LinkAsset(\"02i0x00000054jHAAQ\",\"Salesforce\")'>Link Asset</span>"},"symbol":null}] Any ideas?
... View more
10-10-2017
01:18 PM
|
0
|
2
|
212
|
POST
|
The deferred IdentityTask. I'm not sure what map.infoWindow.setFeatures requires. I couldn't find any documentation for it. should I be sending graphics? If I send it the graphics, how should I include the IdentifyTask outputs? Thanks, Tyler
... View more
10-10-2017
12:43 PM
|
0
|
4
|
825
|
POST
|
Hi Robert, I ended up picking up creating an object array of features in the graphicsLayer's on 'click' event like so: graphicsLayer.on("click", function(event){ var graphicFeature = {}; graphicFeature.geometry = event.graphic.geometry; graphicFeature.attributes = event.graphic.attributes; graphicFeature.infoTemplate = event.graphic.infoTemplate; graphicsLayerFeatures.push(graphicFeature); console.log("graphicsLayerFeatures: " + JSON.stringify(graphicsLayerFeatures)); }); graphicsLayerFeatures looks like this: [{"geometry":{"type":"point","x":-8767571.07357861,"y":4253201.3693682095,"spatialReference":{"wkid":102100}},"attributes":{"Type":"Water Meter Asset","Name":"Meter: 73186851","Id":"02i0x00000054jOAAQ"},"infoTemplate":{"title":"Water Meter Asset","content":"Type: ${Type} <br/>Name: ${Name} <br/><span class='link' onclick='LinkAsset(\"02i0x00000054jOAAQ\",\"Salesforce\")'>Link Asset</span>"}}] In the featureLayer identifyTask's callback I add identify results to graphicsLayerFeatures. However, the deferred response does not appreciate this and gives the following error: init.js:113 TypeError: a.getLayer is not a function init.js:133 Am I doing anything wrong? Or is there another means for getting both featureLayers and graphics in the same infoWindow? Thanks for you help, Tyler
... View more
10-10-2017
12:26 PM
|
0
|
6
|
825
|
POST
|
I think I figured it out. The graphicsLayer click fires before the map click. I'll create a graphicsLayer 'features' object in the graphicsLayer click and pick them up in the mapClick. Thanks, Tyler
... View more
10-10-2017
10:51 AM
|
1
|
0
|
212
|
Title | Kudos | Posted |
---|---|---|
1 | 07-28-2016 03:05 PM | |
4 | 09-20-2017 11:37 AM | |
2 | 01-28-2019 12:21 PM | |
1 | 10-16-2017 12:56 PM | |
1 | 10-07-2014 07:04 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|