|
POST
|
Love the fact that you can interact with APRX projects so well in Python using arcpy. Iterating through maps and layout, layers, or layout elements. But while trying to automate map making, I kept banging my head against the well because despite things like: # loop through layout.listElements
if elem.type == 'LEGEND_ELEMENT':
legend = elem:
# ...
legend.syncLayerVisibility = True
legend.syncLayerOrder = True
# ...
layout.exportToPDF(PDF_File, resolution = 300) my legend wouldn't show up in the PDF I'm generating. Then I noticed that I could see it containing only one layer inside of ArcGIS Pro where my layout is set up instead of showing ALL layers. After trying everything imaginable (and more) in my code and getting blisters on my finger tips navigating the ridiculous panes of pain in Pro, I realized that the current width of my legend element was too much for the page width. But it didn't just cut off the text labels of some of the items - it hid them completely and therefore rendered a blank legend in the app, which leads to a blank legend in the PDF. Oh, come on!
... View more
03-04-2020
02:32 PM
|
0
|
1
|
1791
|
|
POST
|
Yes, I did and the setting was 'false'. What I couldn't figure out was why. Sorry if that wasn't clear. By now, I've identified the culprit as a layer in the ArcGIS Pro map behind the map service that was doing some funky join between feature classes in different databases. Never seen that before, and since I didn't author the original map it took a bit longer to track down. supportsAdvancedQueries would return false in the following scenarios: The layer / table resides in a workspace other than an enterprise database or File Geodatabase. The layer / table is joined with another layer / table from a different workspace. from: Layer / Table—ArcGIS REST API: Services Directory | ArcGIS for Developers Thanks for taking the time to look at this, Robert!
... View more
03-03-2020
01:43 PM
|
3
|
0
|
5649
|
|
POST
|
Robert, that's the same article I linked to above. I didn't see anything in there that suggested a logical place for further investigation.
... View more
03-03-2020
11:13 AM
|
0
|
2
|
5649
|
|
POST
|
Just cut over to 2017. So I'm pretty sure it's not my SQL version. I think it's something specific to this map services. But I can't figure out what it is.
... View more
03-03-2020
09:12 AM
|
0
|
4
|
5649
|
|
POST
|
So I've run into an issue that appears to be related to pagination. Not something that I've ever thought about before. In short, I'm trying to replace an instance of QueryTask in JSAPI tied to a dojo search field with an instance of Search so that I can use the 'suggestions' feature. But I can't get it to work. I kept getting a pagination error. It works when I switch my FeatureLayer out for this ESRI service: https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/US_Senators/FeatureServer/0 So I came across this thread about pagination: https://support.esri.com/en/technical-article/000012579 ...and I can replicate the behavior described there when I try to run a query at the Rest endpoint using result offset/result record count. So if pagination is turned on by default in SQL Server and works for FeatureLayer that are sublayers of a Map Service, why is it not working? In ArcGIS Server Manager, I don't see anything I can tweak with regard to pagination. Any ideas what I should be trying here?
... View more
03-03-2020
08:35 AM
|
0
|
6
|
5925
|
|
POST
|
As a post-mortem exercise, here is what made it work: WebMapPDF_forDownload = os.path.join(arcpy.env.scratchWorkspace, 'WebMap_{0}.pdf'.format(uniqueID))
PDFOutputFile = open(WebMapPDF_forDownload)
PDFOutputFile.close()
arcpy.SetParameter(1, PDFOutputFile.name) The help came from here: Download File from Geoprocessing Service by URL To see how to marry this to the web and a custom widget that calls this service, see my other thread: Help me understand how to use ConvertWebMapToArcGISProject.
... View more
02-27-2020
02:15 PM
|
0
|
0
|
2087
|
|
POST
|
Doing a post-mortem on this before I forget....So I dropped my efforts to use the OTB GP widget, instead, I created a GP tool in ArcGIS Pro (using Python) and ConvertWebMapToArcGISProject which allows you to create an in-memory APRX and then massage it to your heart's delight - iterate over maps or layers, choose a pre-configured template, and export that to PDF. To consume that, I created a custom widget and in it, I did something like this: printFromJSON : function (){
var currentMap = this.map;
var printTask = new PrintTask();
var params = new PrintParameters();
params.map = currentMap;
var webMapAsJSON = printTask._getPrintDefinition(currentMap, params);
var webMapAsJSONasString = JSON.stringify(webMapAsJSON);
var file;
var gpParams = {"Web_Map_as_JSON" : webMapAsJSONasString,
"PDFOutputFile" : file};
gp.submitJob(gpParams, this.completeCallback, this.statusCallback);
},
//Note the "var file" in there. It has to match any output parameters you've configured in your GP tool.
... View more
02-27-2020
02:04 PM
|
0
|
0
|
2900
|
|
POST
|
Just doing a post-mortem on this one: You can your JSON from esri/tasks/PrintTask, as explained here: Get the WebMap from Javascript API esri/map.
... View more
02-27-2020
01:56 PM
|
0
|
0
|
3124
|
|
POST
|
Ken, that must be it. Because I've done both - the export/zip from within WAB and then just straight folder zip and copy/paste. Didn't realize there was this going on behind the scenes. Great information. I'm trying to formulate some development best practices for our team as it pertains to WAB, and this needs to go in there.
... View more
02-27-2020
01:36 PM
|
0
|
0
|
1645
|
|
POST
|
Well, without my taking another look, you've probably answered my question. This was not a point geometry. I don't think I specified an outSpatialReference The only reason I started using InfoTemplate rather than PopupTemplate is because I stumbled upon and then started working with an example online that seemed to fit my needs. I don't really know how they're different. I will try and use PopupTemplate and report back. Thanks, as always.
... View more
02-27-2020
01:34 PM
|
0
|
1
|
1408
|
|
POST
|
Inside, a custom widget I'm working on I would like select a feature in the map and an associated popup to open up, all based on user selection in a list of records. This is what I've got: showFeature : function(featureSet){
this.inherited(arguments);
this.map.graphics.clear();
var resultFeatures = featureSet.features;
graphic = resultFeatures[0];
var symbol = new SimpleFillSymbol();
symbol.setColor(new Color([255,0,51,0.5]));
graphic.setSymbol(symbol);
this.map.graphics.add(graphic);
var infoTemplate = new InfoTemplate("...some configuration here ...");
graphic.setInfoTemplate(infoTemplate);
this.map.infoWindow.setFeatures([graphic]);
this.map.infoWindow.show(graphic.geometry); When this runs, the feature is selected, highlighted - in other words, the graphic makes it onto the map. But there is no sign of the Popup, except for this message in Dev Tools: I do see the PopupManager.js in my app's folder but I have no idea what is role is. The app contains a number OTB widgets that someone else on my team configured. So I'm suspecting there is another Popup template configured and my widget is getting confused. Any pointers or references to some documentation are appreciated.
... View more
02-26-2020
03:09 PM
|
0
|
3
|
1441
|
|
POST
|
As I'm building various app's in Web AppBuilder (DE) and deploying them on our web server (Web Adaptor machine), I notice that some of them require a tweak in env.js where no apiUrl is set. In my case, adding the line below has always worked. apiUrl = 'http://js.arcgis.com/3.31/', But I'm not sure how env.js file is generated or updated by WAB throughout development. My suspicion is that as you add custom developed widget (either home grown or sources elsewhere), the need for this arises whereas something straight out of WAB doesn't need this? Can anyone shine some light on this for me?
... View more
02-26-2020
02:49 PM
|
0
|
3
|
1741
|
|
POST
|
Sweet, worked like a charm! Plus, the syntax isn't as gross as some I've seen. Haha. Reminds of stepping through k,v n Python dict items. - I'll have another questions for you in a separate thread this afternoon.
... View more
02-26-2020
11:21 AM
|
0
|
0
|
2696
|
|
POST
|
Working with JSAPI v.3.31 on WAB DE widget stuff. So I have a query that returns a feature set, in fact it's a single feature, so that:.. var resultFeatures = featureSet.features;
var graphic = resultFeatures[0]; . Then I provide some styling and add it to the map var symbol = new SimpleFillSymbol();
symbol.setColor(new Color([255,0,51,0.5]));
graphic.setSymbol(symbol);
this.map.graphics.add(graphic); I can access the attributes of the feature using: var attributes = graphic.attributes But I can't figure out how to step through them, to selectively add them to an InfoTemplate or otherwise process the attribute info. All of the below has failed because attributes is type Object.. attributes.forEach( function()...)
// or
dojo.forEach(attribute,function()...)
// or
array.forEach(attribute,function()...) What's the solution here? I don't want to have to access each attribute directly: grahic.attributes['myattribute'] THANKS!
... View more
02-26-2020
09:04 AM
|
0
|
2
|
2886
|
| 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 |
04-15-2026
12:14 PM
|