GP service

Jump to solution
08-19-2015 08:37 AM
Occasional Contributor II

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>
<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="">

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;
<script src=""></script>

var map, gp;
require([ "dojo/dom",
"esri/Color", "esri/symbols/SimpleLineSymbol",
"esri/request", "dojo/domReady!"
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("");
wkid: 102100       
function executeGP(run){
var pointSymbol = new SimpleMarkerSymbol();
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);
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){


<body class="claro">
<div id="mapDiv"></div>
<div id="LatLng" >
Enter the lat/long:

0 Kudos
32 Replies
Occasional Contributor II


I tried that but I can’t seem to get it to work.. Do you have a second to look at it?

0 Kudos
MVP Esteemed Contributor


   No, I am in the middle of migrating all my widgets I have made available to the public, over to WAB 1.2.

Here is the doc link for the project method

You can also glean code from custom widget that are available on GeoNet (like Tim's Location widget).

Occasional Contributor II


Thanks for all of your help, I was able to get the widget working correctly..  Thanks for your patience.

0 Kudos