|
POST
|
This is fantastic. Thank you for taking the time to do this. I am now looking into dgrid trying to learn more about it.
... View more
02-21-2019
06:22 PM
|
1
|
0
|
1839
|
|
POST
|
Done. As an aside, and I will dig deeper later, when I found this Bootstrap solution three or four years ago, I recall it was a necessary workaround because the then current API didn't handle what I wanted to do (I could be wrong there). If possible, I would like to stay primarily (or solely) within the 4.10 API (this is just because of my limited skills and knowledge in these regards--It makes my life somewhat easier). Is there any solution you would recommend beyond this hack. I am just wanting a pointer here--everything I do comes from modifying other examples I have found elsewhere. There are likely many examples I am overlooking. As always, much appreciated.
... View more
02-21-2019
06:23 AM
|
0
|
3
|
1839
|
|
POST
|
Thank you for the reply and assistance. Immediately after posting, I had to head out of the office for a conference. It will likely be a day or two before I get to dig into this. Nonetheless, in the meantime, I wanted to express my gratitude. Take care, Todd
... View more
02-20-2019
02:30 PM
|
0
|
5
|
1839
|
|
POST
|
Quick background. I currently have a feature layer that represents insect traps (this is a mock dataset with just two points for now). Occasionally, field technicians will go and inspect the traps and record the findings in a related table (we will ultimately use Collector for this). I am also developing an associated webapp. I would like to use JSAPI 4.10 to enable a user to click on a feature and the related table (showing the field inspections) open. This is actually something I previously did on another project using 3.15 in conjunction with bootstrap. When I update this old code with the new feature layer, it still works in 3.15. However, since I plan to integrate this into a larger app utilizing the newer version of the API, I would like to update it to 4.10. Thus far, I have failed miserably in this regard. Additionally, there may be a far more elegant and straightforward solution than I am trying to use, but I cannot find any examples (which I need since I follow the mantra of "code by cannibalization" since I really don't know what I am doing--ha)!!! For instance, here is a real simply web map I made in ArcGIS Online that has a popup with the option to show related records that, when clicked, the related table opens. I oh so want to believe there is a straight forward way to do this with the JSAPI. Below are two examples that I have. The first uses 3.15 and works. The second 4.10 and doesn't work. As I said, though, if there are better solutions out there, I would gladly explore those. Example 1: This works (but I don't have an option to close the table, which is another issue, but not the one I am addressing now) <!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"> <title>Related Table</title> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.2.4/bootstrap-table.min.css"> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <!-- cool bootstrap plugin for working with tables //http://wenzhixin.net.cn/p/bootstrap-table/docs/index.html --> <script src="http://rawgit.com/wenzhixin/bootstrap-table/master/dist/bootstrap-table.min.js"></script> <link rel="stylesheet" href="http://js.arcgis.com/3.15/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.15/esri/css/esri.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } #map { width: 100%; height: 100%; margin: 0; padding: 0; } .claro .dijitTooltipContainer { background-image: none; border: 1px solid #444444; background-color: #444444; color: #FFFFFF; } .claro .dijitTooltipConnector { background-image: none; } #info-pane { position: absolute; top: 10px; right: 10px; z-index: 1000; padding: 1em; background: white; } .fixed-table-container { position: absolute; bottom: 10px; left: 10px; z-index: 1000; padding: 1em; background: white; } .fixed-table-body { max-height: 400px; max-width: 600px; } #hidden { display: none; } </style> <script src="http://js.arcgis.com/3.15/"></script> <script> require([ "dojo/dom-construct", "dojo/parser", "esri/Color", "esri/config", "esri/dijit/Popup", "esri/dijit/PopupTemplate", "esri/layers/ArcGISTiledMapServiceLayer", "esri/layers/FeatureLayer", "esri/map", "esri/tasks/query", "esri/tasks/QueryTask", "esri/tasks/RelationshipQuery", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/tasks/GeometryService", "dojo/on", "dojo/domReady!" ], function ( domConstruct, parser, Color, esriConfig, Popup, PopupTemplate, ArcGISTiledMapServiceLayer, FeatureLayer, Map, Query, QueryTask, RelationshipQuery, SimpleFillSymbol, SimpleLineSymbol, GeometryService, on ) { parser.parse(); currentBasemap = [] map = new Map("map", { center: [-98.435731, 35.222876], zoom: 7, slider: false, logo: false }); relief = new ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer") currentBasemap.push(relief); var traps = new FeatureLayer("https://services.arcgis.com/3xOwF6p0r7IHIjfn/arcgis/rest/services/OBWEO_Collector_Test/FeatureServer/0", { mode: FeatureLayer.MODE_ONDEMAND, }); map.addLayers([relief, traps]); traps.on("click", queryRelated); //Here's the code with which I am having issue function queryRelated(evt) { var content var feature = evt.graphic; var relatedOWBEOQuery = new RelationshipQuery(); relatedOWBEOQuery.outFields = ["*"]; relatedOWBEOQuery.relationshipId = 0; relatedOWBEOQuery.objectIds = [feature.attributes[traps.objectIdField]]; traps.queryRelatedFeatures(relatedOWBEOQuery, function (relatedRecords) { var fset = relatedRecords[feature.attributes[traps.objectIdField]]; if (fset.features.length > 0) { var results = []; for (i = 0; i < fset.features.length; i++) { results.push(fset.features.attributes); } $('#my-table').removeClass('hidden'); //you can only call refresh() when loading from a url $('#my-table').bootstrapTable('destroy'); $('#my-table').bootstrapTable({ data: results, cache: false, striped: true, clickToSelect: true, columns: [{ field: 'TRAPID', title: 'Trap ID', sortable: true, order: 'asc' }, { field: 'Trapper', title: 'Trapper No.', sortable: true, }, { field: 'Date', title: 'Date', sortable: true }, { field: 'WeevilsCaught', title: 'Weevils Caught', sortable: true }, { field: 'Condition', title: 'Trap Condition', sortable: true }, { field: 'Comment', title: 'Comment', sortable: true } , { field: 'Status', title: 'Status', sortable: true }] }); } }); } }); </script> </head> <body class="claro"> <div id="my-table" class="hidden"> </div> <div id="map"></div> </body> </html> Example 2: My crude and failed attempt to migrate to 4.10 <!DOCTYPE html> <html dir="ltr"> <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" /> <title>Related Table</title> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.2.4/bootstrap-table.min.css"> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script src="http://rawgit.com/wenzhixin/bootstrap-table/master/dist/bootstrap-table.min.js"></script> <link rel="stylesheet" href="https://js.arcgis.com/4.10/esri/css/main.css"> <script src="https://js.arcgis.com/4.10/"></script> <style> html, body, #mapDiv { height: 100%; width: 100%; margin: 0; padding: 0; } </style> <script> require([ "esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer", "esri/tasks/support/Query", "esri/tasks/QueryTask", "esri/tasks/support/RelationshipQuery" ], function(Map, MapView, FeatureLayer, Query, QueryTask, RelationshipQuery) { // setup the map var map = new Map({ basemap: "streets" }); var view = new MapView({ container: "mapDiv", map: map, center: [-98.338, 35.636], zoom: 7 }); const pointRenderer = { type: "simple", // autocasts as new SimpleRenderer() symbol: { type: "simple-marker", // autocasts as new SimpleMarkerSymbol() size: 8, color: [0, 0, 0], outline: null } }; var traps = new FeatureLayer({ url: "https://services.arcgis.com/3xOwF6p0r7IHIjfn/arcgis/rest/services/OBWEO_Collector_Test/FeatureServer/0", renderer: pointRenderer, outFields: ["*"] }); map.add(traps); traps.on("click", queryRelated); function queryRelated(evt) { var content var feature = evt.graphic; var relatedOWBEOQuery = new RelationshipQuery(); relatedOWBEOQuery.outFields = ["*"]; relatedOWBEOQuery.relationshipId = 0; relatedOWBEOQuery.objectIds = [feature.attributes[traps.objectIdField]]; traps.queryRelatedFeatures(relatedOWBEOQuery, function (relatedRecords) { var fset = relatedRecords[feature.attributes[traps.objectIdField]]; if (fset.features.length > 0) { var results = []; for (i = 0; i < fset.features.length; i++) { results.push(fset.features.attributes); } $('#my-table').removeClass('hidden'); //you can only call refresh() when loading from a url $('#my-table').bootstrapTable('destroy'); $('#my-table').bootstrapTable({ data: results, cache: false, striped: true, clickToSelect: true, columns: [{ field: 'TRAPID', title: 'Trap ID', sortable: true, order: 'asc' }, { field: 'Trapper', title: 'Trapper No.', sortable: true, }, { field: 'Date', title: 'Date', sortable: true }, { field: 'WeevilsCaught', title: 'Weevils Caught', sortable: true }, { field: 'Condition', title: 'Trap Condition', sortable: true }, { field: 'Comment', title: 'Comment', sortable: true } , { field: 'Status', title: 'Status', sortable: true }] }); } }); } }); </script> </head> <body> <div id="mapDiv"></div> </body> </html> Thanks in advance. I appreciate any help on this. Todd
... View more
02-20-2019
11:21 AM
|
0
|
7
|
2059
|
|
POST
|
Thank you. I will contact the system admin and ensure he does this. Much appreciated.
... View more
12-12-2018
10:21 AM
|
0
|
0
|
1501
|
|
POST
|
Thanks for your assistance. Our system administrator seems to think ArcMap is looking for server resources that are not installed on my local machine and that installing Portal on the server will fix this. Then again, there may be additional licensing issues. Here's the screenshot.
... View more
12-12-2018
09:54 AM
|
0
|
4
|
5502
|
|
POST
|
I cannot get past the first dialog window to even select the type of service I wish to publish. We have Advanced. Thank you.
... View more
12-12-2018
08:04 AM
|
0
|
6
|
5502
|
|
POST
|
Originally, I started with a simple vector point shapefile that I was going to publish as a feature service. Next, I tried a simple orthomosaic I was going to publish as a cached map service (tile layer). In both instances, I couldn't even get beyond the initial dialog window.
... View more
12-12-2018
07:50 AM
|
0
|
8
|
5502
|
|
POST
|
We recently setup ArcGIS Server 10.6 (on a Windows 2012 R2 VM). I am trying to publish a service from ArcMap 10.6, but receive the following message: "The selected target server is not licensed for publishing the current service type." This happens immediately upon selecting the connection in the Publish a Service dialog window. The best we can tell, the server is properly configured and licensed. Any insight would be greatly appreciated.
... View more
12-12-2018
07:21 AM
|
0
|
12
|
8674
|
|
POST
|
Thank you, this is very helpful. For this particular task, I was using a File Geodatabase.
... View more
10-09-2018
10:42 AM
|
0
|
0
|
9569
|
|
POST
|
Thanks. It's good to have reference to the official docs, too!
... View more
10-09-2018
09:01 AM
|
0
|
0
|
9569
|
|
POST
|
This is a statement as much as a question because I solved my issue. However, others may encounter something similar, so I will go ahead and post this. I was looking for a DatePart equivalent for field calculator in ArcGIS Pro (e.g. in ArcMap could use something like DatePart("YYYY", [datefield])). I tried using SQL: EXTRACT(YEAR FROM "datefield"), which works for a query but apparently not for a field calculation. Anyone know why this may be? Finally, I was able to use Python 3: !datefield!.strftime('%Y') (I discovered this is also case sensitive ('%y') only returns year without century. The documentation on this seems to be poor (or I am not very good at finding it). Hopefully, this will help others who have a similar problem. This resource also proved to be very useful.
... View more
10-09-2018
08:48 AM
|
2
|
4
|
12721
|
|
POST
|
I was trying to remove a graphic layer from the layer list in 4.8 and found this, in particular the comment from Kristian Ekenes. I slightly modified her code to my needs and it worked. Hopefully this is still relevant to you almost two months after your post. //Hide graphic layer from layerList var graphicCurrentLayer = view.map.layers.flatten(function(item){ return item.layers; }).find(function(layer){ return layer.title === "Graphics Layer"; }); graphicCurrentLayer.listMode = "hide";
... View more
09-21-2018
10:45 AM
|
0
|
0
|
773
|
|
POST
|
Your tenacity and willingness to help is amazing. I greatly appreciate it. This is exactly what I needed. Again, thank you. You've saved me from multiple binds before and today is no different. Todd
... View more
09-20-2018
10:47 AM
|
0
|
0
|
7670
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-12-2025 12:15 PM | |
| 1 | 11-14-2024 12:18 PM | |
| 1 | 11-13-2024 01:18 PM | |
| 1 | 06-13-2024 03:06 PM | |
| 1 | 05-12-2022 06:53 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-13-2025
12:44 PM
|