POST
|
Kevin does that mean if I have an api key I'm able to use the google street view widget?
... View more
08-12-2020
03:00 PM
|
0
|
1
|
1241
|
POST
|
I'm trying to auto populate a text box in a widget I have created. I would like to be able to start typing a route and it returns the lists of routes as you type. I don't need to know how to pass this object as I already have that working. I found this post and tried to implement it in my application with not much success.. https://community.esri.com/people/mlewis22/blog/2014/10/21/autocomplete-search-box-using-arcgis-services I was wondering if anyone else as has done this in a widget.js file? Here is what my code currently looks like. Any direction would be greatly appreciated. _queryRoutes: function (Query, QueryTask) {
//create array
var array = []
//build query task
var queryTask = new QueryTask("https://app.mdt.mt.gov/arcgis/rest/services/LRS/LRM_RM/MapServer/0");
//build query filter
var query = new Query();
query.returnGeometry = false;
query.outFields = ["corridor"];
query.where = "OBJECTID > 0";
queryTask.execute(query, showResults);
function showResults(results) {
// Collect the results
var resultItems = [];
var resultCount = results.features.length;
for (var i = 0; i < resultCount; i++) {
var featureAttributes = results.features[i].attributes;
for (var attr in featureAttributes) {
var routes = String(featureAttributes[attr]);
resultItems.push(routes);
}
}
// Sort the array
var sorted = resultItems.sort()
// Remove Duplicates
var uniqueNames = [];
$.each(sorted, function (i,el) {
if ($.inArray(el, uniqueNames) === -1) {
uniqueNames.push(el);
}
});
array = uniqueNames
var availableTags = array;
$("#routes").autocomplete({
// set the source as the availableTags above
source: availableTags
});
}
}, I was able to create this html file but not sure how to incorporate it into my custom widget. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" /> <link rel="stylesheet" href="https://js.arcgis.com/3.20/js/esri/css/esri.css"> <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css"> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> <script src="https://code.jquery.com/ui/1.11.1/jquery-ui.js"></script> <link rel="stylesheet" href="https://community.esri.com/resources/demos/style.css"> <style> html, body, body { background-color: #FFF; overflow: hidden; font-family: "Trebuchet MS"; } </style> <script src="https://js.arcgis.com/3.20/"></script> <script> require(["esri/map", "esri/tasks/QueryTask","esri/tasks/query", "dojo/domReady!"], function (Map, QueryTask, Query) { $(function () { var array = [] queryTask = new QueryTask("https://app.mdt.mt.gov/arcgis/rest/services/LRS/LRM_RM/MapServer/0"); query = new Query(); query.returnGeometry = false; query.outFields = ["Corridor"]; query.where = "OBJECTID > 0"; queryTask.execute(query, showResults); function showResults(results) { // Collect the results var resultItems = []; var resultCount = results.features.length; for (var i = 0; i < resultCount; i++) { var featureAttributes = results.features.attributes; for (var attr in featureAttributes) { // Convert the attribute to a string. Null Values create an extra comma which stops the widget from functioning. routes = String(featureAttributes[attr]); // push the attributes tothe blank array resultItems.push(routes); } } // Sort the array sorted = resultItems.sort() // Remove Duplicates var uniqueNames = []; $.each(sorted, function (i, el) { if ($.inArray(el, uniqueNames) === -1) uniqueNames.push(el); }); // Set the varrible array array = uniqueNames // This is your AutoComplete Widget var availableTags = array; // Reference the div id which you want the autocomplete list to appear (in this case tag) $("#routes").autocomplete({ // set the source as the availble tags above source: availableTags }); } }); }); </script> </head> <body> <div class="ui-widget"> <label for="routes">Corridor: </label> <input id="routes"> </div> </body> </html> I figured it out. Needed to have the following libraries loaded in the index.html file. <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js" ></script>
... View more
05-02-2019
11:20 AM
|
0
|
0
|
1187
|
POST
|
Basically I have 2 different measured route layers. One that has the route and the accumulated mileage. The second has segments for each route going from mile post to mile post. Each of those segments is named C000001E_1 the 1 is denoting the mile post. I can enter the route C000001E and the mile post and offset for the segment layer and it returns the location of the start and end point that I'm looking for. I cant use the accumulated offset layer as the event layer for a couple reasons. In the event input table the Corridor_RM is the route name and in the accumulated mileage layer there is only the corridor name like C000001E and the shape length. the second reason I cant use it is because off long and short mile post locations. I might enter a mile post and offset from the mile post and offset layer and the point lands before or after the location returned from the accumulated mileage layer. I tried splitting the line from the 2 points but that will not work as I really only want a temp line from the entered points.
... View more
04-18-2019
07:36 AM
|
0
|
1
|
991
|
POST
|
Is there a tool that will create a route segment from 2 points that are along a measured route segment defined below? The points table looks like this. The measure table looks like this. The points were created from another measured layer that has segments for the entire route. In the above example the segment is C000001E_2 and C000001E_3 with corresponding offsets. the make route event layer wont work as the measure table have one route name and an accumulated length. I have created a simple model to create the merge layer that contains the 2 points. I cant find a tool to create a segment between these 2 points to complete my geoprocessing service. Any help would be greatly appreciated.
... View more
04-17-2019
02:45 PM
|
0
|
3
|
1188
|
POST
|
I have built a model and within the model I perform a merge. that creates a table. I have a script that creates one record from that table. I want to make a route event layer from this table. The problem I have is the script is the last thing to run so the make route event layer fails. I thought setting the precondition on the created table would make the script run before the table is used by the Make Route Event tool. Is there a way to force the script to run on the table before the Make Route Event Layer? Here is the code in my script. table = r"C:\mdtapps\interactive\test.gdb\combined" ridList = [] with arcpy.da.SearchCursor(table, ["RID"]) as cursor: for row in cursor: ridList.append(row[0]) del cursor ridList = set(ridList) for RID in ridList: toMeasList = [] with arcpy.da.SearchCursor(table, ["RID", "END"], "RID = '" + RID + "'") as cursor: for row in cursor: toMeasList.append(row[1]) del cursor toMeasList.sort() with arcpy.da.UpdateCursor(table, ["END"], "RID = '" + RID + "'") as cursor: for row in cursor: row[0] = toMeasList[-1] cursor.updateRow(row) del cursor toMeasList.sort() with arcpy.da.UpdateCursor(table, ["OBJECTID"]) as cursor: for row in cursor: if row[0] == 2: cursor.deleteRow() del cursor This is what my model looks like.
... View more
03-05-2019
02:15 PM
|
0
|
1
|
520
|
POST
|
Hey Robert, Do you the updated version of your old Help Widget? Thanks, Terry
... View more
02-16-2018
07:50 AM
|
0
|
2
|
928
|
POST
|
I have the following function and when it's executed it returns SEE URL Below (A). My GP service returns SEE below (B) I'm thinking when the url that gets built and passed to the GP service it has the "geometryType":null at the end its causing the GP service to fail. Does anyone know why the "geometryType":null is added to the end of the url? I looked at the API and tried adding "env:outSR":102100 to my var params but that didn't help. //execute gp
executeGP: function (rs) {
this.shelter.show();
this.map.graphics.clear();
var featureSet = new FeatureSet();
var gra = new Graphic(null, null, rs, null);
featureSet.features = [gra];
featureSet.fields = [
{
name: "OBJECTID",
alias: "OBJECTID",
type: "esriFieldTypeOID"
}, {
//name: "Corridor",
name: "Corridor",
alias: "Corridor",
type: "esriFieldTypeString",
length: 8
}, {
name: "from_offset",
alias: "from_offset",
type: "esriFieldTypeSingle"
}, {
name: "to_offset",
alias: "to_offset",
type: "esriFieldTypeSingle"
}
];
var params = {
"Route_Points": featureSet,
};
this.gp.submitJob(params, lang.hitch(this, this.processGP));
},
(A) Returns the following url. :https://app.mdt.mt.gov/arcgis/rest/services/LRS/ReturnRouteSegment/GPServer/segment/submitJob?f=json&env:outSR=102100&Route_Points={"fields":[{"name":"OBJECTID","alias":"OBJECTID","type":"esriFieldTypeOID"},{"name":"Corridor","alias":"Corridor","type":"esriFieldTypeString","length":8},{"name":"from_offset","alias":"from_offset","type":"esriFieldTypeSingle"},{"name":"to_offset","alias":"to_offset","type":"esriFieldTypeSingle"}],"features":[{"attributes":{"OBJECTID":1,"Corridor":"C000001E","from_offset":"100","to_offset":"200"}}],"geometryType":null}
({
"paramName": "Route_Points_Events1",
"dataType": "GPFeatureRecordSetLayer",
"value": {
"displayFieldName": "",
"geometryType": "esriGeometryPolyline",
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
},
"fields": [
{
"name": "OBJECTID",
"type": "esriFieldTypeOID",
"alias": "OBJECTID"
},
{
"name": "Corridor",
"type": "esriFieldTypeString",
"alias": "Corridor",
"length": 8
},
{
"name": "from_offset",
"type": "esriFieldTypeSingle",
"alias": "from_offset"
},
{
"name": "to_offset",
"type": "esriFieldTypeSingle",
"alias": "to_offset"
},
{
"name": "LOC_ERROR",
"type": "esriFieldTypeString",
"alias": "LOC_ERROR",
"length": 50
},
{
"name": "Shape_Length",
"type": "esriFieldTypeDouble",
"alias": "Shape_Length"
}
],
"features": [{
"attributes": {
"OBJECTID": 1,
"Corridor": "C000001E",
"from_offset": 100,
"to_offset": 200,
"LOC_ERROR": "NO ERROR",
"Shape_Length": 241333.05456719542
},
"geometry": {"paths": [[
[
-1.2763657977400001E7,
6122093.660400003B)
]
]]}
}],
"exceededTransferLimit": false
}
}
... View more
01-05-2018
11:38 AM
|
0
|
0
|
1945
|
POST
|
Sorry for all of the questions, is the hosted layer owned by you? Do you have that layer in SDE? Is this layer static?
... View more
03-10-2016
09:44 AM
|
0
|
1
|
871
|
POST
|
Yeah I would just create a model in the model builder with the layer you want to calculate and then use the calculate field tool. Then create the GP and you should be able to add the calculate item in WAB.
... View more
03-10-2016
08:36 AM
|
1
|
4
|
871
|
POST
|
So you are wanting to calculate acres from a specific column in a hosted feature layer?
... View more
03-10-2016
07:56 AM
|
0
|
6
|
871
|
POST
|
I did a linear offset for routes, what kind of offset are you wanting to perform?
... View more
03-10-2016
07:21 AM
|
0
|
8
|
1065
|
POST
|
I have used ArcMap and python to create a GP service that calculates offset so I think it would be possible to do what you are wanting to do..
... View more
03-07-2016
04:38 AM
|
0
|
10
|
1065
|
Title | Kudos | Posted |
---|---|---|
1 | 08-19-2015 02:57 PM | |
1 | 03-10-2016 08:36 AM | |
1 | 03-10-2016 09:00 AM | |
1 | 07-16-2015 01:15 PM | |
1 | 09-14-2015 06:48 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|