|
POST
|
Yes, good point, Marco - familiar with materialized views or indexed views. However, I don't know how the arcpy reindex method is supposed to treat such indexes. In my case, there are no indexes associated with these views, at least none I can discern in SSMS.
... View more
01-30-2020
07:51 AM
|
0
|
0
|
2602
|
|
POST
|
Wanted to provide an update on this: I believe the issue was caused by trying to create/register spatial views in a SDE database of version 10.2. This is a little used database that apparently was never update. Others are all 10.5.From this thread understand that there was some changes from pre-10.5. Why this would have caused views to end up in [SDE_table_registry], I don't understand but that's what tripped up my maintenance script when trying to rebuild/refresh indexes. I haven't actually had time to update the GDB, I'll add a note about what that does.
... View more
01-29-2020
04:09 PM
|
0
|
2
|
2602
|
|
POST
|
Okay, I'm venturing into somewhat new terrain here... I've read countless examples providing various levels of clarity on the subject but I'm banging my head against the wall trying to make my example work. After working through a few easy examples of custom widget for Web AppBuilder and successfully interacting with map and layers, etc. I wanted to try and bring in some of the JSAPI modules. Objective: hook a dom input field up to event listener/handler that executes a query against a map service. After a few circuitous failed attempts, I settled for trying to adapt this ESRI example: https://developers.arcgis.com/javascript/3/jshelp/intro_querytask.html. In my imports I have the following: define(['dojo/_base/declare',
'jimu/BaseWidget',
'dijit/_WidgetsInTemplateMixin', //The Mixin is like my MultiVitamin.
//Not sure I need it here but I've
//needed in the past and learned the hard way.
'esri/tasks/QueryTask', //query and QueryTask (watch for upper/lower case!)
'esri/tasks/query', //are needed for the query.
"dojo/_base/lang", //to hitch a lang
"dojo/on", //"On" and "dom" I'm using for the event handling.
"dojo/dom"],
function(declare,
BaseWidget,
_WidgetsInTemplateMixin,
QueryTask,
Query,
lang,
on,
dom) My template code all follows the Custom Widget template, so I won't include here. All my custom code I packed in the onOpen lifecycle function, starting with: onOpen: function(){
this.inherited(arguments); // Dont' know if I really need this - do I?
console.log('onOpen');
var searchBtn = dom.byId('searchBtn');
on(searchBtn,"click",function(evt){
lang.hitch(this,lang.hitch(this,executeQueryTask())); // Just my last attempt...
}); So this handles the input event. Next I set up my query: var query = new Query();
query.returnGeometry = false;
query.outFields = ["NAME"]; // Any field will do right now
queryUrl = "https:// ... this is the URL to my service ends in ....MapServer/0";
var queryTask = new QueryTask({queryUrl}); Finally, simplifying the above ESRI example. I set up three (3) functions: Reads the current input in the DOM field. Executes the query using the JS API. Displays the results passed from 2) and print record count to the console. function showResults(featureSet) {
var resultFeaturesCount = featureSet.features.length;
console.log(resultFeaturesCount);
}
function getInput(){
return document.getElementById('searchField').value;
}
function executeQueryTask() {
query.where = `NAME like '%${getInput()}%'`
queryTask.execute(query,showResults);
} So I think I understand what I'm trying to do. My widget looks great. My event handler works. But the error has been the same all along: Uncaught TypeError: Cannot read property 'query' of undefined
at Object.execute (init.js:2315)
at Object.c.<computed> [as execute] (init.js:1148)
at executeQueryTask (Widget.js?wab_dv=2.14:101)
at HTMLInputElement.<anonymous> (Widget.js?wab_dv=2.14:67) Everything I've read (most of it by our generous contributor Robert Scheitlin, GISP) leads me to believe this is all about scope. So what am I missing? The scope-hitch-lang still confuses me.
... View more
01-29-2020
03:52 PM
|
0
|
4
|
4010
|
|
POST
|
Great question.I'd be very interested in hearing about other teams' scenarios setup for WAB development, source/version control, and deployment strategies, especially where you're going Dev=>Test=>Production.
... View more
01-24-2020
11:50 AM
|
0
|
0
|
989
|
|
POST
|
Thanks, Brian. Very helpful We should've discussed when you were still down the hall. haha.
... View more
01-24-2020
11:44 AM
|
0
|
0
|
6262
|
|
POST
|
Did you ever try and look at the ImportLog that gets created in your "ImportLog" folder inside your project folder? It might reveal some error message (or then it might not...).
... View more
01-15-2020
11:14 AM
|
0
|
0
|
2906
|
|
POST
|
Kory, Do you know of any information on what elements of or issue withs an MXD might not import well into Pro? I've never had any problems with importing MXD's until today when a whole batch of MXD's won't import. The common denominator appears to be an error with scales: Interestingly, when I switch to Data View instead of Layout View in ArcMap and save that way before importing, Pro will also crash but show this in the ImportLog:
... View more
01-15-2020
11:12 AM
|
0
|
0
|
2906
|
|
POST
|
Robert Scheitlin, GISP, thanks for getting me off the ground here. All the sudden, there is a faint shimmer of light at the end of the tunnel! Got my even handler working. If Layers are called Layer1, Layer2, Layer3, then all I do is: function updateLayerVisibility(oldValue,newValue) {
layerStructure.traversal(function(layerNode) {
if (layerNode.title.includes(oldValue))
{layerNode.hide();}
if (layerNode.title.includes(newValue))
{layerNode.show()};
});
} So if the current dropdown value "Layer1" (oldValue) is changed to "Layer2" (newValue), then I just traverse layer tree, check if oldValue/newValue matches my layer name, and turn the oldValue layer off and the newValue layer on. No doubt there are more elegant ways to do this, and this is in no way configurable. But I'm so excited the light bulb has gone off. haha
... View more
01-14-2020
09:15 AM
|
1
|
0
|
824
|
|
POST
|
Added a missing define([..., "dojo/_base/lang", ...] function(..., lang, , ... ) and I'm off to the races!
... View more
01-13-2020
02:52 PM
|
0
|
1
|
824
|
|
POST
|
Nice! Sorry I'm thinking in nano-steps.... but I'll try that. I also just pasted some snippet referencing LayerStructure class and that worked. So I'm slooooowly warming up to the Jimujambalaya. Thanks for going the extra miles for all of us out here!!! 🙂
... View more
01-13-2020
02:39 PM
|
0
|
2
|
824
|
|
POST
|
That was the first thing I tried, and I get this: init.js:115 TypeError: Cannot read property 'watch' of undefined
at Object.startup (Widget.js?wab_dv=2.14:25)
at Object.advice (init.js:121)
at Object.c [as startup] (init.js:120)
at Object.<anonymous> (BaseWidgetPanel.js?wab_dv=2.14:83)
at init.js:64
at m (init.js:108)
at k (init.js:108)
at e.resolve (init.js:110)
at Object.<anonymous> (WidgetManager.js?wab_dv=2.14:131)
at init.js:64 "TypeError: Cannot read property 'watch' of undefined
... View more
01-13-2020
02:20 PM
|
0
|
4
|
4231
|
|
POST
|
Robert Scheitlin, GISP, 3 weeks on, and I'm finally getting back to this. I read over your instructions up there, and I think I hear what you're saying. It's just still seems too much at once for my first round of widgetry. So instead, I'm starting with this for widget.html and using dijit/form/Select <div>
<select name="LayerSelector" data-dojo-type="dijit/form/Select">
<option value="First Layer">First Layer</option>
<option value="Second Layer">Second Layer</option>
</select>
</div> That gives me this: Great! Then I used the Demo widget as template, added the Mixin's for the dojo dropdown define(['dojo/_base/declare',
'jimu/BaseWidget',
'dijit/_WidgetsInTemplateMixin'
],
function(declare,
BaseWidget,
_WidgetsInTemplateMixin
) {
return declare([BaseWidget,_WidgetsInTemplateMixin], {
baseClass: 'jimu-widget-layerselector',
[...] I also kept the following life cycle methods - bare, with only console logging: postCreate: function() {
this.inherited(arguments);
console.log('postCreate');
},
startup: function() {
this.inherited(arguments);
console.log('startup');
},
onOpen: function(){
console.log('onOpen');
},
onClose: function(){
console.log('onClose');
} Then I added an event handler (merely to log the event), based on this other thread where you chimed in. cbChangedHandler: function (who, property, oldValue, {
console.info(who, property, oldValue, newValue);
} Now, how do I rig this up with a event listener? Again, I found the following snippet in your other example: this.LayerSelector.watch('displayedValue', lang.hitch(this, this.cbChangedHandler, "LayerSelector")); But where does it need to live? Am I generally still on track to widget enlightenment or lost in the woods?
... View more
01-13-2020
01:28 PM
|
0
|
6
|
4231
|
|
POST
|
Joshua is absolutely right. You need to get to the servers first. If you don't use the Python API a lot, it can be a little confusing. I have to always refer to script I've used before. I had a snipped lying around... to turn on/off services. from arcgis import gis
# I like this interactive way whenever possible instead of storing passwords
mygis = gis.GIS(<your_portal_path>, username='arcgis_python')
servers = mygis.admin.servers.list()
one_server = servers[0]
services_on_that_server = one_server.services.list()
one_of_those_services = services_on_that_server[0]
# provided your service is running to begin with
print(one_of_those_services.status)
one_of_those_services.stop()
print(one_of_those_services.status)
one_of_those_services.start()
print(one_of_those_services.status) This gives me the following output: {'configuredState': 'STARTED', 'realTimeState': 'STARTED'}
{'configuredState': 'STOPPED', 'realTimeState': 'STOPPED'}
{'configuredState': 'STARTED', 'realTimeState': 'STARTED'}
... View more
01-09-2020
03:26 PM
|
2
|
5
|
6410
|
|
POST
|
In a separate post a while back, I was hoping to solicit some guidance on how to use the geoprocessing widget. After some distractions, I'm now returning to this effort. I have built a few functioning Python tool(boxe)s with ArcGIS Pro now. I understand how to interact with the map layout in Pro to programmatically create PDF of my map and modify the map for conversion to PDF. I am not completely sure how that related to what ESRI calls a "staged layout template." But that has to be similar to what I'm doing. First, I want to replace my aprx reference to a project file with one to a web map. Memorable ESRI Quote #1 For advanced printing scenarios, you ... can use the ConvertWebMapToMapDocument (for ArcMap) or ConvertWebMapToArcGISProject (for ArcGIS Pro) functions in the Python arcpy module. So I am trying to leverage arcpy.mp.ConvertWebMapToArcGISProject(<webmap_as_json>, <some_wonderful_pdf>) There is no simple way of generating some sample JSON describing your web map that you could use to test your script. So after publishing a script as a geoprocessing service that takes <webmap_as_json> as an argument, how do I pass the json ? I can hook Web AppBuilder's Geoprocessing widget into my geoprocessing services but it's needing that JSON to feed on. So I'm inclined to think I'm headed down the wrong path. Questions: Which widget, if any, can call geoprocessing services and pass along the JSON? Is a "staged layout template" just a PAGX file sitting in a folder registered with my hosting server?
... View more
01-09-2020
02:17 PM
|
0
|
1
|
2893
|
|
POST
|
Been playing with publishing geoprocessing tools as webtools from ArcGIS Pro and surprised there is no way to update/overwrite what you've published after modifying your Python code in the tool. Do I have to first delete existing tool in Portal (as item) before I republish?
... View more
01-09-2020
01:12 PM
|
1
|
0
|
932
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-16-2025 07:32 AM | |
| 1 | 02-09-2024 05:18 PM | |
| 1 | 02-04-2025 09:27 AM | |
| 1 | 03-22-2019 10:55 AM | |
| 1 | 03-05-2020 08:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
a month ago
|