|
POST
|
I tried to convert the code into my own widget. When I open the widget I get a “create widget error:” I have tried finding what else I need to change. Here is a copy of my widget.js file for my custom widget. What am I missing?
... View more
08-19-2015
02:57 PM
|
1
|
24
|
2426
|
|
POST
|
Huh, I can’t get it to run unless I remove that portion. Then if I zoom in really close and select a route it does return the correct values.. What browser are you running it in? http://app.mdt.mt.gov/arcgis/rest/services/LRS/LocateFeaturesOnDCandRM/GPServer/Locate%20features%20along%20DC%20and%20RM/jobs/jd16fdc7086cf4c30999292ec2330e538/results/LRM_DC_RM_MI1?f=json&returnType=data If I use the jsonLint it shows the route.
... View more
08-19-2015
10:54 AM
|
0
|
1
|
2426
|
|
POST
|
Sorry Robert, I’m a slow learner.. So I must have something wrong with the “Search_Radius” as when I comment out /**"Search_Radius": { "distance": 50, "units": "esriFeet" }, "Keep_only_the_closest_route_location": false**/ it works fine. But with that code in there it does not return the map. When I zoom it close and click on the map it returns the correct data for that point.
... View more
08-19-2015
10:31 AM
|
0
|
28
|
2426
|
|
POST
|
I have it open in brackets and note ++ but for some reason it does not see the syntax errors..
... View more
08-19-2015
09:35 AM
|
0
|
30
|
2426
|
|
POST
|
Tim, How did you determine he was missing the "esri/geometry/Multipoint" requirement?
... View more
08-19-2015
08:46 AM
|
0
|
2
|
1062
|
|
POST
|
I'm trying to use a gp service to return a point and values from a gp service and can't seem to get the define point to return. Can anyone help? <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>Geometry Service: Relation</title> <link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css"> <style> html, body, #mapDiv { height: 100%; margin: 0; padding: 0; width: 100%; } #info { bottom: 20px; color: #444; height: auto; font-family: arial; left: 20px; margin: 5px; padding: 10px; position: absolute; text-align: left; width: 200px; z-index: 40; } .label { display: inline-block; width: 4em; } </style> <script src="http://js.arcgis.com/3.14compact/"></script> <script> var map, gp; require([ "dojo/dom", "dojo/_base/array", "dojo/promise/all", "dojo/json", "esri/map", "esri/domUtils", "esri/graphic", "esri/graphicsUtils", "esri/geometry/Point", "esri/SpatialReference", "esri/tasks/GeometryService", "esri/tasks/Geoprocessor", "esri/tasks/FeatureSet", "esri/tasks/RelationParameters", "esri/Color", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleFillSymbol", "esri/config", "esri/request", "dojo/domReady!" ], function( dom, array, all, JSON, Map, domUtils, Graphic, graphicsUtils, Point, SpatialReference, GeometryService, Geoprocessor, FeatureSet, RelationParameters, Color, SimpleLineSymbol, SimpleMarkerSymbol, SimpleFillSymbol, config, Request) { var geometryService, geometries, baseGraphics; map = new esri.Map("mapDiv", { basemap: "topo", center: [-111.185, 46.052], zoom: 15 }); map.on("click", executeGP); gp = new Geoprocessor("http://app.mdt.mt.gov/arcgis/rest/services/LRS/LocateFeaturesOnDCandRM/GPServer/Locate%20features%20along%20DC%20and%20RM"); gp.setOutputSpatialReference({ wkid: 102100 }) function executeGP(run){ map.graphics.clear(); var pointSymbol = new SimpleMarkerSymbol(); pointSymbol.setSize(14); pointSymbol.setOutline(new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 0, 0]), 1)); pointSymbol.setColor(new Color([0, 255, 0, 0.25])); var graphic = new Graphic(run.mapPoint, pointSymbol); map.graphics.add(graphic); var features = []; var featureSet = new FeatureSet(); featureSet.features = features; var params = { "f": json, "outSR" : 102100, "City_Centers" : featureSet, "geometryType" : esriGeometryPoint, "features" : [{ "geometry" : { "x": -12180856.426452411, "y": 5952832.259593694, "spatialReference": { "wkid": 102100 } } }], "sr": { "wkid": 102100 } "Search_Radius": { "distance": 50, "units": esriFeet } "Keep_only_closest_route_location": false //'distance_field': true, //'zero_length_events': true, //'in_fields': true, //'m_direction_offsetting': true }; gp.submitJob(params, processGP); function processGP(jobInfo){ gp.getResultData(jobInfo.jobId, "LRM_DC_RM_MI1", renderResult); }; function renderResult(result, message){ alert(result); }; </script> </head> <body class="claro"> <div id="mapDiv"></div> <div id="LatLng" > Enter the lat/long: </div> </body> </html>
... View more
08-19-2015
08:37 AM
|
0
|
32
|
8949
|
|
POST
|
Ok , I make some progress but still can’t figure out why this will not go to the define coordinates.. Any ideas?
html, body, #mapDiv #info .label var map; var APP = {}; require([ "dojo/dom", "dojo/_base/array", "dojo/promise/all", "dojo/json", "esri/map", "esri/domUtils", "esri/graphic", "esri/graphicsUtils", "esri/geometry/Point", "esri/SpatialReference", "esri/tasks/GeometryService", "esri/tasks/Geoprocessor", "esri/tasks/FeatureSet", "esri/tasks/RelationParameters", "esri/Color", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleFillSymbol", "esri/config", "esri/request", "dojo/domReady!" ], function( dom, array, all, JSON, Map, domUtils, Graphic, graphicsUtils, Point, SpatialReference, GeometryService, Geoprocessor, FeatureSet, RelationParameters, Color, SimpleLineSymbol, SimpleMarkerSymbol, SimpleFillSymbol, esriConfig, esriRequest ) { var geometryService, geometries, baseGraphics; map = new esri.Map("mapDiv", { basemap: "topo", center: , zoom: 15 }); map.on("click", executeGP); var gpUrl = "http://app.mdt.mt.gov/arcgis/rest/services/LRS/LocateFeaturesOnDCandRM/GPServer/Locate%20features%20along%20DC%20and%20RM"; APP.geoprocessor = new Geoprocessor(gpUrl); function executeGP(){ var point = new Point(-12180856.426452411, 5952832.259593694, new SpatialReference({ wkid: 102100 })); //var geometry = new geometry(); var graphic = new Graphic(point); var features = []; var featureSet = new FeatureSet(); featureSet.features = features; var params = { "f": "json", "outSR": 102100, "City_Centers" : featureSet,/**{ "geometryType":"esriGeometryPoint", "features": [{ "geometry": { "x": -12180856.426452411, "y": 5952832.259593694, "spatialReference":{ "wkid": 102100 } } }], "sr": { "wkid": 102100 } },**/ "Search_Radius": { "distance":50, "units":"esriFeet" }, "Keep_only_closest_route_location": false //'distance_field': true, //'zero_length_events': true, //'in_fields': true, //'m_direction_offsetting': true }; APP.geoprocessor.submitJob(params, processGP); }; function processGP(jobInfo){ APP.geoprocessor.getResultData(jobInfo.jobId, "LRM_DC_RM_MI1", renderResult); }; function renderResult(result, message){ alert(result); }; });
|