|
POST
|
Ken, you are awesome! Thanks for the help. This sample is actually less code than what I have and it works well. I am building new applications with a number of floating panes, so this really helps me out. Thank you so much!
... View more
05-05-2015
11:07 AM
|
0
|
0
|
2045
|
|
POST
|
Ken, this seems to work great, but what if I want the floating pane hidden when the application is opened. Basically, I want the user to click the button when they want to use the tool. The on and off functionality works great as well as the hidden function. We are getting close
... View more
05-05-2015
10:50 AM
|
0
|
5
|
2045
|
|
POST
|
Tim, thank your for your response, but that sample shows the floating pane minimized. if you click the down arrow, it is mimized to the bottom of the screen. I can close it completely, which is what I want, but I want it to re-appear in the same position when it is re-opened.
... View more
05-05-2015
07:38 AM
|
0
|
7
|
2045
|
|
POST
|
Hello everyone. I have recently added a number of main toolbar tools to floating panes. The user can click on an icon from the main toolbar, then the floating pane is activated. When they close the floating pane, it appears again, but in a different position several pixels to the right and down and this behavior is repeated until the floating pane eventually disappears from the screen. Below is a screen shot of what is happening. Position #1 - after clicking on the icon from the main toolbar Position #2 - after closing the floating pane (when clicking on down arrow), then re-activating the pane by clicking on the icon. Position #3 - after closing the floating pane (when clicking on down arrow), then re-activating the pane by clicking on the icon. Notice how the position of the floating pane changes after it is opened then closed, then open again. How can I keep it in the same position at all times? Any feedback will be greatly appreciated. Thank you. Ian
... View more
05-05-2015
06:32 AM
|
1
|
9
|
5733
|
|
POST
|
Hello everyone! I am currently have an application that uses floating panes. I have a main toolbar that contains the tool icons. When a button is clicked, the floating pane will appear with the tool. However, when I close the floating pane, then click on the button to re-activate, the floating pane will not re-appear. I have read that closing the floating pane destroys the open. Has anyone come up with the solution, so that each time you close the floating pane, you can re-open by clicking on the button? The code I have is simple, both the JavaScript and HTML which is posted below. What modifications do I need to make? I appreciate any feedback. Thank you. Here is an example for a measuring tool: JavaScript Code // Hide Measuring Tool Floating Pane on Load domStyle.set("measuringToolFloatingPanePick", "visibility", "hidden"); // Measuring Tool activate Floating Pane on Click registry.byId("measuringToolButton").on("click", function () { openMeasuringToolFloatingPane("measuringToolFloatingPanePick"); }); // Open Measuring Tool using Floating Pane Function function openMeasuringToolFloatingPane(paneId) { var mtfp = registry.byId(paneId); mtfp.show(); } // Measuring Tool var measurementWidget = new Measurement({ map: map, defaultAreaUnit: esri.Units.SQUARE_FEET, defaultLengthUnit: esri.Units.FEET }, dom.byId("measurementDIV")); measurementWidget.startup(); HTML Code <!-- Measuring - Measuring Tool --> <div id="measuringFrame"> <div data-dojo-type="dijit/form/Button" id="measuringToolButton" title="Measuring" data-dojo-props="iconClass:'measuringIcon'"></div> </div> Here is how my floating pane appears. It appears when clicking on the icon (within the red square). When I close, then try to re-open...it won't.
... View more
05-01-2015
07:59 AM
|
0
|
1
|
3791
|
|
POST
|
This line of code is it: registry.byId('buttonExit').on('click', function() { window.close(); openedWindow.close(); }); Thank you for all of your responses. The window.close() works for I.E. what works for closing Google Chrome and FireFox Browsers?
... View more
04-07-2015
02:02 PM
|
0
|
1
|
1217
|
|
POST
|
Good afternoon. I have an application where I am tying a function to a button. When the button is pressed, I want the window/application to close. For some reason, I am getting the message that exitApplication is not defined. Here is my simple code: JavaScript // Exit Application if User does not Acknowledge function exitApplication() { window.close(); } HTML Portion <div dojotype="dijit.form.Button" id="buttonExit" data-dojo-type="dijit/form/Button" type="button" style="align-content: center" onclick="exitApplication();">Close</div> I have this working in another application (JavaScript 3.9 API). I am now trying to get this to work using the JavaScript 3.13 API. Anyone have any ideas? Thanks.
... View more
04-07-2015
11:46 AM
|
0
|
5
|
3673
|
|
POST
|
I am currently working on building a popup that shows attributes from the feature layer and I have related object attributes that I am also wanting to display. For related objects, we never use the Object ID, because the Object ID number changes. Based on the ESRI samples, they use OBJECTID or JOINID. We have a 1 to many relationship. For example here is how the relationship works with the unique ID numbers: Addresses: FACILITYID (Unique ID of 19305) - Feature Layer Utility Customer Information - C_FACILITYID (unique ID of 19305) - related object view As you can see, both field names are different, but the relationship works. However, I am having problems getting this to work using the different field names. In this sample, the same field names are used? Anyone know how I can change this to accept to different fields that contain the same unique ID number? Please refer to the index.html sample. Any feedback will greatly be appreciated.
... View more
03-06-2015
04:03 PM
|
1
|
1
|
2982
|
|
POST
|
I have the table view in a map service. Attached is a screenshot: I can easily query from the CISAddresses using an Id of 0 for the LayerID, just not the table view as shown.
... View more
12-17-2014
11:30 AM
|
0
|
0
|
755
|
|
POST
|
I currently have a table view set up in SDE that pulls a lot of utility information together. I am currently working on a JavaScript application that will allow a use to type in an address or name, then the results will be posted into a data grid. The problem is this, I can get this to work with any map service layer, but not with a table view. The table view in the map service contains an ID of 1. This particular application will not have a map service, just input parameters and a data grid. That is it. I can run queries through the REST endpoint and get the results I want. My question is, what is the correct class to use for querying from table views. I thought I could use findParams, but that doesn't seem to work. Anyone have any ideas? Thanks!
... View more
12-17-2014
10:02 AM
|
0
|
3
|
1947
|
|
POST
|
Thank you for the responses! I actually looked at the sample from ESRI and that works extremely well. I referred to the sample and now have a web application set up that does exactly what I need it to. Starting to like AMD more and more
... View more
12-04-2014
02:39 PM
|
1
|
1
|
1125
|
|
POST
|
So if I click a button that goes to http://machine/app/19305 the application will actually be loaded as http://machine/app? This is what I am wanting. The http://machine/app/19305 URL is actually not a real URL, but I want to capture the data while the app is loading. I hope this makes sense. Attached is a copy of my code. Ian
... View more
12-03-2014
01:23 PM
|
0
|
1
|
1125
|
|
POST
|
Good afternoon. I have a case where I need to parse a number out of a web url and store it within a data input form. The valid application url is this: http://<machinename>/<applicationname> However, I need to send a URL by clicking on the button that reads something like this: http://<machinename>/<applicationname>/19305 Of course this is not a real application site, so as the application is loading, I need to parse out 19305 so it reads http://<machinename>/<applicationname>. I then need to take the parsed value, then send it to an input form so it will locate within an application. Has anyone done this? Ian
... View more
12-03-2014
01:01 PM
|
0
|
6
|
2206
|
|
POST
|
I have a python script tool that exports records from a feature layer using an (area of interest - aoi). The tool works well, but the problem is that if I have a comma in text in one of the field records, it will break the text after the comma and move it to the next field. The shown below that are highlighted in yellow show records that are offset. I am attaching the toolbox along with the script. Is there a way I can fix this issue? I didn't get any help from ESRI. They just forwarded me some links, but I figure I can get some assistance from here. Here is a copy of the toolbox and script as an attachment: Here is the script code itself: <CODE> # -*- coding: utf-8 -*- ''' This script will convert a table to an excel spreadsheet. If the third-party module xlwt is available, it will use that. Otherwise, it will fall back to CSV. ''' # ********************************************************************** # * 01. Import arcpy Module * # ********************************************************************** import arcpy import os import zipfile # ********************************************************************** # * 02. Variable Descriptions * # ********************************************************************** # Variable Definition # # InputDataset Dataset used for input. # DataDescription Described properties of the input dataset. # FieldNames Field names from table. # FileFormat File format of output either CSV or XLS. # SelectedFeatures Features that are selected from input dataset. # OutputFile Name of the output file. # ********************************************************************** # * 03. Prepare Data for Table * # ********************************************************************** def get_ID_message(ID): return re.sub('%1|%2', '%s', arcpy.GetIDMessage(ID)) def zipUpFolder(folder, outZipFile): # zip the data try: zip = zipfile.ZipFile(outZipFile, 'w', zipfile.ZIP_DEFLATED) zipws(unicode(folder), zip, 'CONTENTS_ONLY') zip.close() except RuntimeError: # Delete zip file if exists if os.path.exists(outZipFile): os.unlink(outZipFile) zip = zipfile.ZipFile(outZipFile, 'w', zipfile.ZIP_STORED) zipws(unicode(folder), zip, 'CONTENTS_ONLY') zip.close() #Message' Unable to compress zip file contents.' arcpy.AddWarning(get_ID_message(86133)) def zipws(path, zip, keep): path = os.path.normpath(path) # os.walk visits every subdirectory, returning a 3-tuple # of directory name, subdirectories in it, and filenames # in it. for (dirpath, dirnames, filenames) in os.walk(path): # Iterate over every filename for file in filenames: # Ignore .lock files if not file.endswith('.lock'): #arcpy.AddMessage('Adding %s...' % os.path.join(path, dirpath, file)) try: if keep: zip.write(os.path.join(dirpath, file), os.path.join(os.path.basename(path), os.path.join(dirpath, file)[len(path)+len(os.sep):])) else: zip.write(os.path.join(dirpath, file), os.path.join(dirpath[len(path):], file)) except Exception as e: #Message ' Error adding %s: %s' arcpy.AddWarning(get_ID_message(86134) % (file, e[0])) return None def createFolderInScratch(folderName): # create the folders necessary for the job folderPath = arcpy.CreateUniqueName(folderName, arcpy.env.scratchFolder) arcpy.CreateFolder_management(arcpy.env.scratchFolder, os.path.basename(folderPath)) return folderPath # Returns a list of column names and an iterator over the same columns def header_and_iterator(InputDataset): # Describe Properties of Input Dataset DataDescription = arcpy.Describe(InputDataset) # Field Name Definitions FieldNames = [f.name for f in DataDescription.fields if f.type not in ['Geometry', 'Raster', 'Blob']] def iterator_for_feature(): cursor = arcpy.SearchCursor(InputDataset) row = cursor.next() while row: yield [getattr(row, col) for col in FieldNames] row = cursor.next() del row, cursor return FieldNames, iterator_for_feature() def export_to_xls(dataset, output): # Attempt to output to an XLS file. If xmlwt is not available, fall back # to CSV. XLWT can be downloaded from http://pypi.python.org/pypi/xlwt try: import xlwt except ImportError: arcpy.AddError('import of xlwt module failed') return header, rows = header_and_iterator(dataset) # Make spreadsheet workbook = xlwt.Workbook() worksheet = workbook.add_sheet(os.path.split(dataset)[1]) #Set Up Header Row and Freeze Panes header_style = xlwt.easyxf('font: bold on; align: horiz center') for index, colheader in enumerate(header): worksheet.write(0, index, colheader.replace('.','_')) worksheet.set_panes_frozen(True) worksheet.set_horz_split_pos(1) worksheet.set_remove_splits(True) # Write Rows for rowidx, row in enumerate(rows): for colindex, col in enumerate(row): worksheet.write(rowidx+1, colindex, col) # Completed Workbook workbook.save(output) if __name__ == '__main__': # *********************************** # * 01. Input Parameters * # *********************************** InputDataset = arcpy.GetParameterAsText(0) # Input Dataset aoi = arcpy.GetParameter(1) # Select Area of Interest FileFormat = arcpy.GetParameterAsText(2) # Output format (CSV or XLS) OutputFolder = createFolderInScratch('FlatFiles') OutputZipFile = arcpy.GetParameterAsText(3) for i,ds in enumerate(InputDataset.split(';')): # *********************************** # * 02. Select Dataset By Location * # *********************************** arcpy.SelectLayerByLocation_management(ds, 'INTERSECT', aoi) # Selected Features from Input Dataset SelectedFeatures = arcpy.MakeFeatureLayer_management(ds) # *********************************** # * 03. Format * # *********************************** # Comma Separated Values (CSV) if FileFormat == 'CSV': fields = '' for field in arcpy.ListFields(SelectedFeatures): if field.name.lower() not in ['shape']: fields = fields + field.name + ';' fields = fields.rstrip(';') arcpy.AddMessage('Export to CSV') # Create CSV File OutputFile = os.path.join(OutputFolder,'c%s_%s.csv' % (str(i).zfill(2), ds.split(os.sep)[-1])) arcpy.ExportXYv_stats(SelectedFeatures,fields,'COMMA',OutputFile,'ADD_FIELD_NAMES') # Excel File (XLS) elif FileFormat == 'XLS': try: # Create XLS File OutputFile = os.path.join(OutputFolder,'x%s_%s.xls' % (str(i).zfill(2), ds.split(os.sep)[-1])) export_to_xls(ds, OutputFile) except: import traceback arcpy.AddError(traceback.format_exc()) else: raise ValueError('Don\'t know how to export to %r' % FileFormat) zipUpFolder(OutputFolder, OutputZipFile) </CODE>
... View more
11-10-2014
07:53 AM
|
0
|
6
|
4888
|