|
POST
|
With help of another employee here....figured out the root of the problem....So we figured out a way to fix it early enough that we do not have to update the JSON file after it has been published to ArcGIS Server. It turns out that when you create a Feature Class with domains the Feature Template table (?) is not updated with teh domain values. If you start and stop an edit session on that Feature Class in ArcMap before you publish the Template tables are updated with the Description from the Domain. So Create Feature Class Create and update fields with the Domain options Start Edit session (you don have to edit anything or add anything, simply start the edit session ) End Edit session Publish to ArcGIS Server This fixed the issue for us....if you have any questions please ask....hope that I explained this well enough.
... View more
09-20-2018
11:09 AM
|
1
|
0
|
8742
|
|
POST
|
That sounds great but I have no idea where you are at...I am in ArcGIS Server are you referencing AGOL? I don see anything like you are explaining
... View more
09-14-2018
04:39 AM
|
0
|
2
|
2247
|
|
POST
|
OK I added admin to my URL to get to the admin section Was this http://services.arcgis.com/xxxx/arcgis/rest/services/Layername/FeatureServer/0 Now this http://services.arcgis.com/xxxx/arcgis/rest/admin/services/Layername/FeatureServer/0 That gets me here I click Update Definition and I dont get anything in the box. I assume the entire JSON would be there to make edits to
... View more
09-13-2018
05:29 AM
|
0
|
1
|
6496
|
|
POST
|
Looks like I am not in the Administration Directory... How do I get there?
... View more
09-13-2018
05:14 AM
|
0
|
2
|
6497
|
|
POST
|
In ArcGIS Server Manager I was able to click here to see the JSON I can identify the area that needs to be updated. "name": "0"; ,
"types": [
{
"id": "0",
"name": "0",
"domains": {
"PubPriv": {"type": "inherited"},
"Item": {"type": "inherited"}
},
"templates": [
{
"name": "0",
"description": "",
"prototype": {
"attributes": {
"Comments": null,
"Case_": null,
"PubPriv": null,
"Item": "0"
}
},
"drawingTool": "esriFeatureEditToolPoint"
}
] QUESTIONS: 1. My question is where and how do I do this from ArcGIS Server? 2. I can see what needs to be changed but have NO idea where to physically modify the json file. 3. I assume that once I do this I will have to do this every time the service is updated/overwritten because the error in the json file is coming from the publishing to the rest endpoint
... View more
09-13-2018
04:59 AM
|
0
|
4
|
6497
|
|
POST
|
OK I read the other post and I am sort of following. 1. How and where do I get the jSON file from my ArcServer Map Service (Data is served up locally to AGOL) 2. I assume I would have to do this each time I republish the Map Service from my mxd, for instance if there is a schema change etc. 3. I didn't read in there what you were actually changing in the jSON file...Think you mentioned updated via the Rest API...how do I do this Thanks for your thoughts and help
... View more
09-11-2018
04:44 AM
|
0
|
0
|
6496
|
|
POST
|
I created a FC and added Domains to it. I coded them as such 0 Fallen tree 1 Water Backup When I go into Collector App and bring up the webmap then user starts to edit Th edit window shows the symbology for each of the selections BUT it shows the 0 and 1 and not the description. This also appears in the web map while editing.... How do I get the description to show up
... View more
09-10-2018
06:26 AM
|
1
|
13
|
9605
|
|
POST
|
I did this and seems to have done the trick gridWMAPoint.set("store", memStore); gridWMAPoint.refresh();
... View more
09-06-2018
12:17 PM
|
0
|
0
|
1375
|
|
POST
|
Question. I have this working by itself. I added this to an existing app and put the code within some accordion panes. I click the map and it alerts me to the data returns. I go to where the grids are and nothing is showing. I click on the header (id) and then the data shows up. I click in the map again and the data changes but the dgrid still has the old data. I click the header again and the dgrid updates. trying to figure out why and/or some way of forcing the data to update or show initially... Any thoughts? Funny is that the original page with just this code updates fine on the fly... The data selection and feature selections update in real time...its just the dgrid update that is not occurring. I have to click on the header to get the results to show and then click on it again after a map click to get the dgrid to update with the new results....but again the feature selection and highlighting is occurring in real time.
... View more
09-06-2018
11:57 AM
|
0
|
1
|
1375
|
|
POST
|
Thanks for your help....tweaked a couple things on your example to get my grids fired and the proper functions called.....CHEERS and thank you for your thoughts and comments... Here is my final (with the help of Robert of course) if anyone is interested <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Map with a Dojo dGrid</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.25/dojo/resources/dojo.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.25/dgrid/css/dgrid.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.25/dgrid/css/skins/tundra.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.25/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.25/esri/css/esri.css">
<style>
html,
body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
/* dgrid formatting */
#gridWMAPoint {
height: 100%;
width:50%;
}
#gridWMALine {
height: 100%;
width:50%;
}
.dgrid-row-odd {
background: #F2F5F9;
}
.dgrid-cell {
border: none;
}
.dgrid {
border: none;
}
.dgrid-column-name {
width: auto;
}
/* Location of dgrid in the site - Page formatting */
#container {
height: 100%;
visibility: hidden;
}
#bottomPane {
height: 200px;
}
.sides{
margin:0;
}
.left{
float:left;
width:75%;
overflow:hidden;
}
.right{
float:left;
width:25%;
overflow:hidden;
}
/* Change cursor on hover of selected feature */
.field-id {
cursor: pointer;
}
</style>
<script src="http://js.arcgis.com/3.25/"></script>
<script>
// LOAD DGRID, ESRI and DOJO MODULES
require([
"dgrid/OnDemandGrid","dgrid/Selection","dojo/store/Memory","dojo/_base/array","dojo/dom-style","dijit/registry",
"esri/map","esri/layers/FeatureLayer","esri/symbols/SimpleMarkerSymbol","esri/symbols/SimpleLineSymbol","esri/symbols/SimpleFillSymbol",
"esri/Color","esri/renderers/SimpleRenderer","esri/tasks/QueryTask","esri/tasks/query","esri/geometry/Circle","esri/graphic",
"esri/dijit/PopupTemplate","esri/InfoTemplate","dojo/_base/declare","dojo/number","dojo/on","dojo/_base/lang","dojo/parser",
"dijit/layout/BorderContainer","dijit/layout/ContentPane","dojo/domReady!"
], function(
Grid,Selection,Memory,array,domStyle,registry,
Map,FeatureLayer,SimpleMarkerSymbol,SimpleLineSymbol,SimpleFillSymbol,
Color,SimpleRenderer,QueryTask,Query,Circle,Graphic,
PopupTemplate,InfoTemplate,declare,dojoNum,on,lang,parser
) {
parser.parse();
// DEFINE THE TWO GRIDS BEING USED BELOW. ---------------------------------------------------------------------------------------
// WMA POINT GRID
window.gridWMAPoint = new(declare([Grid, Selection]))({
// use Infinity so that all data is available in the grid
bufferRows: Infinity,
subRows:[
[
{field: "_item", label: "image", rowspan: 2,
formatter: function(item){
var btn = new dijit.form.Button({
label: "Edit"
});
return btn;
}
},
{field:"id", label: "ID", rowSpan: 2},
{field:"TYPE", label: "type"},
{field:"WMA", label: "wma" }
],
[
{field:"Rotate_Val", label: "Rotate Val"},
{field:"FG_Symbol", label: "FG Symbol"}
]
]
}, "gridWMAPoint");
// add a click listener on the ID column
gridWMAPoint.on(".field-id:click", selectWMAPointGrid);
// WMA LINE GRID
window.gridWMALine = new(declare([Grid, Selection]))({
// use Infinity so that all data is available in the grid
bufferRows: Infinity,
subRows:[
[
{field:"id", label: "ID", rowSpan: 2},
{field:"TYPE", label: "type"},
{field:"WMA", label: "wma" }
],
[
{field:"Label", label: "Label"},
{field:"Name", label: "Name"}
]
]
}, "gridWMALine");
// add a click listener on the ID column
gridWMALine.on(".field-id:click", selectWMALineGrid);
// DEFINE MAP AND PARAMETERS - LOAD FUNCTION - DEFINE LOCATION MAP -------------------------------------------------------------
window.map = new Map("map", {
basemap: "gray",
center: [-79.665, 37.629],
zoom: 8,
logo: false,
showLabels : true
});
// On Map load
map.on("load", function(evt) {
// show the border container now that the dijits
// are rendered and the map has loaded
domStyle.set(registry.byId("container").domNode, "visibility", "visible");
});
// Display WMAs for spatial reference in the map
var WMAs = new FeatureLayer("https://xxxxxx/arcgis/rest/services/Projects/Locations/MapServer/6", {
mode: FeatureLayer.MODE_SNAPSHOT,
id: "wmas",
opacity: .5,
visible: true
});
map.addLayer(WMAs);
// DEFINE SELET SYMBOLOGY FOR POINT - LINE - POLYGON -------------------------------------------------------------------------------
// Selection symbol POINTS
var symbolPoint = new SimpleMarkerSymbol(
SimpleMarkerSymbol.STYLE_CIRCLE,
12,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_NULL,
new Color([247, 34, 101, 0.9]),
1
),
new Color([207, 34, 171, 0.5])
);
// Selection symbol LINE
var symbolLine = new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([207, 34, 171, 0.9]), 3);
// Selection symbol POLYGON
var symbolPolygon = new SimpleFillSymbol(
SimpleFillSymbol.STYLE_NULL,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([247, 0, 0, 1]),
3
),
new Color([0, 0, 0, 0.5])
);
// DEFINE FEATURES THAT ARE GOING TO BE SELECTED ------------------------------------------------------------------------------------
// WMA POINT
window.WMAPointUrl = "https://xxxxxx/arcgis/rest/services/Projects/Locations/MapServer/2";
window.PointoutFields = ["OBJECTID", "ID", "TYPE", "WMA", "Rotate_Val", "FG_Symbol", "Lat"];
var WMAPoints = new FeatureLayer(window.WMAPointUrl,{
id: "idWMAPoints",
outFields: ["*"],
visible: true
});
// Selection symbol used to draw the selected census block points within the buffer polygon
WMAPoints.setSelectionSymbol(symbolPoint);
// Make POINT unselected features invisible
var nullSymbol = new SimpleMarkerSymbol().setSize(0);
WMAPoints.setRenderer(new SimpleRenderer(nullSymbol));
WMAPoints.on("click", selectWMAPoints);
// change cursor to indicate features are click-able
WMAPoints.on("mouse-over", function() {
window.mapClickEvt.pause();
map.setMapCursor("pointer");
});
WMAPoints.on("mouse-out", function() {
setTimeout(function(){
window.mapClickEvt.resume();
}, 800);
map.setMapCursor("default");
});
map.addLayer(WMAPoints);
// WMA LINE
window.WMALineUrl = "https://xxxxxx/arcgis/rest/services/Projects/Locations/FeatureServer/4";
window.LineoutFields = ["OBJECTID", "ID", "Type", "WMA", "Label", "Name"];
var WMALines = new FeatureLayer(window.WMALineUrl,{
id: "idWMALines",
outFields: ["*"]
});
// Selection symbol used to draw the selected lines
WMALines.setSelectionSymbol(symbolLine);
// Make LINE unselected features invisible
var nullSymbol = new SimpleLineSymbol().setWidth(0);
WMALines.setRenderer(new SimpleRenderer(nullSymbol));
WMALines.on("click", selectWMALines);
// change cursor to indicate features are click-able
WMALines.on("mouse-over", function() {
window.mapClickEvt.pause();
map.setMapCursor("pointer");
});
WMALines.on("mouse-out", function() {
setTimeout(function(){
window.mapClickEvt.resume();
}, 800);
map.setMapCursor("default");
});
map.addLayer(WMALines);
// CREATE CIRCLE SMOBOLOGY FOR BUFFER - MAP CLICK TO CREATE BUFFER AND CALL FUNTIONS TO SELECT FEATURES AND POPULATE DGRID -----------
// Symbology of the buffer circle
var circleSymb = new SimpleFillSymbol(
SimpleFillSymbol.STYLE_NULL,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SHORTDASHDOTDOT,
new Color([105, 105, 105]),
2
), new Color([255, 255, 0, 0.25])
);
var circle;
// When the map is clicked create a buffer around the click point of the specified distance
window.mapClickEvt = on.pausable(map, "click", function(evt){
circle = new Circle({
center: evt.mapPoint,
geodesic: true,
radius: .5,
radiusUnit: "esriMiles"
});
map.graphics.clear();
var graphic = new Graphic(circle, circleSymb);
map.graphics.add(graphic);
var query = new Query();
query.geometry = circle;
// Query WMA Points
WMAPoints.selectFeatures(query, FeatureLayer.SELECTION_NEW, selectInBufferPoints);
// Query WMA Lines
WMALines.selectFeatures(query, FeatureLayer.SELECTION_NEW, selectInBufferLines);
});
//=== FUNCTION CALLED FROM ABOVE - SELECT FEATURES + POPULATE DGRID =================================================================
// WMA POINT GRID
function selectInBufferPoints(features){
var data = array.map(features, function(feature) {
return {
// property names used here match those used when creating the dgrid
"id": feature.attributes[PointoutFields[0]],
"TYPE": feature.attributes[PointoutFields[2]],
"WMA": feature.attributes[PointoutFields[3]],
"Rotate_Val": feature.attributes[PointoutFields[4]],
"FG_Symbol": feature.attributes[PointoutFields[5]]
};
});
alert(JSON.stringify(data));
var memStore1 = new Memory({
data: data
});
gridWMAPoint.set("store", memStore1);
}
// WMA LINE GRID
function selectInBufferLines(features){
var data = array.map(features, function(feature) {
return {
// property names used here match those used when creating the dgrid
"id": feature.attributes[LineoutFields[0]],
"TYPE": feature.attributes[LineoutFields[1]],
"WMA": feature.attributes[LineoutFields[2]],
"Label": feature.attributes[LineoutFields[3]],
"Name": feature.attributes[LineoutFields[4]]
};
});
alert(JSON.stringify(data));
var memStore2 = new Memory({
data: data
});
gridWMALine.set("store", memStore2);
}
//=== INTERACTION BETWEEN MAP AND DGRID - VISA VERSA =================================================================
// WMA POINT GRID
// fires when a row in the dgrid is clicked
function selectWMAPointGrid(e) {
map.graphics.clear();
var WMAPoints = map.getLayer("idWMAPoints");
var query = new Query();
query.objectIds = [parseInt(e.target.innerHTML, 10)];
query.returnGeometry=true;
WMAPoints.queryFeatures(query, function(results){
var gra = results.features[0].clone();
var symbol = new SimpleMarkerSymbol(
SimpleMarkerSymbol.STYLE_CIRCLE,
12,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_NULL,
new Color([247, 247, 0, 1]),
1
),
new Color([247, 247, 0, 0.9])
);
gra.setSymbol(symbol);
map.graphics.add(gra);
});
}
// fires when a feature on the map is clicked
function selectWMAPoints(e) {
var id = e.graphic.attributes.OBJECTID;
// select the corresponding row in the grid
// and make sure it is in view
gridWMAPoint.clearSelection();
gridWMAPoint.select(id);
gridWMAPoint.row(id).element.scrollIntoView();
}
// WMA LINE GRID
// fires when a row in the dgrid is clicked
function selectWMALineGrid(e) {
map.graphics.clear();
var fl2 = map.getLayer("idWMALines");
var query = new Query();
query.objectIds = [parseInt(e.target.innerHTML, 10)];
query.returnGeometry=true;
fl2.queryFeatures(query, function(results){
var gra = results.features[0].clone();
var symbol = new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([247,247,0,.9]),
5
);
gra.setSymbol(symbol);
map.graphics.add(gra);
});
}
// fires when a feature on the map is clicked
function selectWMALines(e) {
var id = e.graphic.attributes.OBJECTID;
// select the corresponding row in the grid
// and make sure it is in view
gridWMALine.clearSelection();
gridWMALine.select(id);
gridWMALine.row(id).element.scrollIntoView();
}
});
</script>
</head>
<body class="tundra">
<div id="container" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design: 'headline', gutters: false">
<div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'"></div>
<div id="bottomPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'">
<div id="gridWMAPoint" class="left"></div>
<div id="gridWMALine" class="right"></div>
</div>
</div>
</body>
</html>
... View more
09-05-2018
01:24 PM
|
0
|
0
|
1375
|
|
POST
|
Thanks....this is whats frustrating about ESRI....here is an example of select with feature but if you actually want to select a line or polygon this wont work and we dont have an example...Would be nice if they stated that it wont work on lines or polys at the top before I chase a solution down the rabbit hole......no idea how to move on from here but thank you for your help...
... View more
09-05-2018
10:09 AM
|
0
|
4
|
1375
|
|
POST
|
Thank you for your help and comments by the way...much appreciated.
... View more
09-05-2018
09:05 AM
|
0
|
6
|
1375
|
|
POST
|
ok....first not sure how to do that so will have to research...second I want to test if the line or any part of it is within the circle....not sure how to test this....I am going to have to do the same for a polygon. If any part of the polygon is in the circle.
... View more
09-05-2018
09:04 AM
|
0
|
0
|
1375
|
|
POST
|
Im confused. I thought there was a map click creating a point geometry. That geometry is used to create the circle that circle is used to select the features in the map Both lines and points are selected and returned to their corresponding grids.
... View more
09-05-2018
08:40 AM
|
0
|
9
|
1637
|
|
POST
|
I have two functions to select each of the feature types... If I change it to Features2 in each of the lines it stops returning the WMA Lines but still returns the points. // Use an objectIds selection query (should not need to go to the server)
WMALines.selectFeatures(queryWMALn, FeatureLayer.SELECTION_NEW, function(features2){
var data = array.map(features2, function(feature) { If I leave it as Features in both it also does not return the line features to the grid but returns for the points. // Use an objectIds selection query (should not need to go to the server)
WMALines.selectFeatures(queryWMALn, FeatureLayer.SELECTION_NEW, function(features){
var data = array.map(features, function(feature) { Is this getting mixed up because of the two separate calls to select features? // WMA POINT GRID
function selectInBuffer(response){
var feature1;
var features1 = response.features;
var inBuffer1 = [];
// Filter out features that are not actually in buffer, since we got all points in the buffer's bounding box
for (var i = 0; i < features1.length; i++) {
feature1 = features1[i];
if(circle.contains(feature1.geometry)){
inBuffer1.push(feature1.attributes[WMAPoints.objectIdField]);
}
}
var queryWMAPt = new Query();
queryWMAPt.objectIds = inBuffer1;
// Use an objectIds selection query (should not need to go to the server)
WMAPoints.selectFeatures(queryWMAPt, FeatureLayer.SELECTION_NEW, function(features){
var data = array.map(features, function(feature) {
return {
// property names used here match those used when creating the dgrid
"id": feature.attributes[PointoutFields[0]],
"TYPE": feature.attributes[PointoutFields[2]],
"WMA": feature.attributes[PointoutFields[3]],
"Rotate_Val": feature.attributes[PointoutFields[4]],
"FG_Symbol": feature.attributes[PointoutFields[5]]
};
});
alert(JSON.stringify(data));
var memStore1 = new Memory({
data: data
});
gridWMAPoint.set("store", memStore1);
});
}
// WMA LINE GRID
function selectInBufferLines(response){
alert("SelectInBufferLines");
var feature;
var features = response.features;
var inBuffer = [];
// Filter out features that are not actually in buffer, since we got all points in the buffer's bounding box
for (var i = 0; i < features.length; i++) {
feature = features[i];
if(circle.contains(feature.geometry)){
inBuffer.push(feature.attributes[WMALines.objectIdField]);
}
}
var queryWMALn = new Query();
queryWMALn.objectIds = inBuffer;
// Use an objectIds selection query (should not need to go to the server)
WMALines.selectFeatures(queryWMALn, FeatureLayer.SELECTION_NEW, function(features2){
var data = array.map(features2, function(feature) {
return {
// property names used here match those used when creating the dgrid
"id": feature.attributes[LineoutFields[0]],
"TYPE": feature.attributes[LineoutFields[2]],
"WMA": feature.attributes[LineoutFields[3]],
"Label": feature.attributes[LineoutFields[4]],
"Name": feature.attributes[LineoutFields[5]]
};
});
alert(JSON.stringify(data));
var memStore2 = new Memory({
data: data
});
gridWMALine.set("store", memStore2);
});
}
... View more
09-05-2018
07:34 AM
|
0
|
11
|
1637
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2018 11:09 AM | |
| 1 | 09-10-2018 06:26 AM | |
| 1 | 09-15-2022 11:02 AM | |
| 1 | 05-21-2021 07:35 AM | |
| 1 | 08-09-2022 12:39 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-19-2022
09:23 PM
|