POST
|
Robert, Thanks for the update! I really appreciate all the work you have done on your other widgets. It really does help a lot of people! Thanks, Mark
... View more
04-24-2015
05:20 AM
|
0
|
0
|
339
|
POST
|
Has anyone been able to add a .pas file from ALOHA to show an air dispersion plume to a web app using the javascript api? I found a custom widget Robert Scheitlin, GISP created for Flex applications (link below), but my searches have not turned up much for javascript. Aloha Threat Zone Widget Preview Or if there is a way to dynamically create plumes directly in the app, that would work too. Any help would be greatly appreciated, since I am not sure how to even start this. Thanks, Mark
... View more
04-23-2015
02:20 PM
|
0
|
2
|
2603
|
POST
|
Here is what I might try, although I am new to python so it might not be the best way... In python... 1. Add fields for each attribute you want to transfer to the point feature class. Lets say you want to transfer two attributes from the polygon you would add those two fields to the point feature class. 2. Loop through the polygons and select each polygon 3. Save the two attributes you want to transfer to variables so they can be used later 4. Do a select by location to select all the points within the selected polygon 5. Use an update cursor to loop through the selected points and populate the two fields with the variables you created earlier I think that would get you your desired outcome and should be fairly simple to put the code together since it is all straight out of esri's help pages. P.S. - I have not tried this so I am not positive it will work jut thinking out loud here. Thanks, Mark
... View more
06-11-2014
11:46 AM
|
0
|
0
|
1665
|
POST
|
Jake, Do you already have a proxy page set up and working? I currently have this app running using a secured service and did initially have the same problem with the identity manage. I tried quite a few things so I cannot remember exactly what fixed the problem. I know one of my problems was that I did not have my proxy set up correctly at first. Thanks, Mark
... View more
04-02-2014
01:23 PM
|
0
|
0
|
191
|
POST
|
Here is how i have done it in the past, although there is probably a better way. Basically, I create a div that holds the measurement tools. [HTML] <div id="measureWindow" style="display: none"> <div id="measurementDiv"></div> <div id="Div1"></div> <span style="font-size:smaller;padding:5px 5px;">Press <b>CTRL</b> to enable snapping.</span> </div> [/HTML] Then I use the following code to close / hide the measurement div. I also include code to uncheck all the corresponding buttons and clear the graphics from the map. var nodeMeasure = dojo.byId('measureWindow');
if (dojo.coords(nodeMeasure).h > 0) {
WipeOutControl(nodeMeasure, 300);
measurement.clearResult();
measurement.setTool("location", false);
measurement.setTool("distance", false);
measurement.setTool("area", false);
}
dijit.byId('btnMeasure').setAttribute('checked', false);
And here is the code that actually wipes out the div when called. //Dojo function to animate address container
function WipeOutControl(node, duration) {
dojo.fx.wipeOut({
node: node,
duration: duration
}).play();
} Good luck, Mark
... View more
03-06-2014
09:29 AM
|
0
|
0
|
138
|
POST
|
Jeff, thanks for your response. I think I have poorly explained exactly what I want to do, although either way I will run into the same issue. Here is a very simple example of what I was trying to do, User A identifies a problem they need fixed. They open the app and add a service request. Based on the type of request, it gets assigned to User B. Shortly after, User A creates another service request. Based on the type of request, it gets assigned to User C. When user B and user C complete their tasks they open the app and sign in and then mark the requests complete. However, I only want User B to be able to mark the task assigned to him complete and not be able to edit the task assigned to User C. When I say I dont want everyone to sign in, I mean I dont want to force every "User A" to sign in because it doesnt really matter to me who originally created the request. I was just trying to allow only the assigned user to mark it complete. In order to do this, I think I would need to login (behind the scenes) using the user id of whoever it will be assigned to. That way in the editing tacking fields it will look like they created the request. Its probably more work than it is worth, since this is just for internal staff I am not too worried about people messing up the data. Thanks, Mark
... View more
02-11-2014
04:53 AM
|
0
|
0
|
432
|
POST
|
Thanks for the response. Yeah, I was hoping there was a way to allow only specific users to be able to "update" certain points. I also do not want to require everyone to sign in so I guess I will just not use ownership access control.
... View more
02-11-2014
03:19 AM
|
0
|
0
|
432
|
POST
|
Good Afternoon, I am working on configuring the "Citizen Service Request" from the Local Government resource center. I am making this app for internal use, where one staff member can create a service request and based on the "type" of request it will automatically get assigned to the relevant department. I want to set up ownership access control so that only the assigned department (user) can mark the request as complete. My problem is that I dont want to force everyone who uses it to sign in (unless they are going to mark an assigned request complete) and I also dont want the user who creates the request to have the control over the feature, I want the assigned user. I have tried (unsuccessfully) to change the value of the "created_user" field, which is one of the default editor tracking fields and the field that I believe is used to determine ownership access. In addition, since I do not sign in before creating the request the field is populated with "ESRI_Anonymous". When I look at the feature service in the arcgis services directory the editor tracking fields are say "editable: false" so I assume that is the reason I cant update the fields using applyEdits like I do with the rest of the fields. Is there a way to overwrite the created_user" value through applyEdits or is there any other way to give ownership access control to a user other than the one who actually creates the feature? Hope that all makes sense. Thanks, Mark
... View more
02-10-2014
11:13 AM
|
0
|
5
|
713
|
POST
|
Yes, our web server is windows. I am not really sure what what you would need to change to get it tow work on a Linux server. That is an area I do not know much. I would say, assuming the rest of my code worked you should have a properly formatted csv text string. Now all you need to do is find a web handler that will work on a Linux server. A quick search on stackoverflow found this thread that might be of some use to you. http://stackoverflow.com/questions/1116175/running-asp-net-on-a-linux-based-server Good Luck. Mark
... View more
02-07-2014
10:24 AM
|
0
|
0
|
1538
|
POST
|
I forgot this code. This is how I zoom to the feature on the map when the record is selected in the datagrid. I put this in the main "init" function of the app. dojo.connect(dijit.byId('gridCorners'), "onRowClick", onRowClickHandler); Here is the function. //Zoom to the parcel when the user clicks a row
function onRowClickHandler(evt) {
map.getLayer(selectedCulvertsID).clear;
var clickedTaxLotId = dijit.byId('gridCorners').getItem(evt.rowIndex).OBJECTID;
var selectedTaxLot;
var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_X, 15, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 0, 0, .01]));
dojo.forEach(map.graphics.graphics, function (graphic) {
if ((graphic.attributes) && graphic.attributes.OBJECTID === clickedTaxLotId[0]) {
selectedTaxLot = graphic;
return;
}
});
AddGraphic(map.getLayer(selectedCulvertsID), symbol, selectedTaxLot.geometry);
var culvertGeometry = selectedTaxLot.geometry;
var factor = 1; //some factor for converting point to extent
var culvertExtent = new esri.geometry.Extent(culvertGeometry.x - factor, culvertGeometry.y - factor, culvertGeometry.x + factor, culvertGeometry.y + factor, culvertGeometry.SpatialReference);
map.setExtent(culvertExtent.expand(80));
} Thanks, Mark
... View more
02-07-2014
05:04 AM
|
0
|
0
|
1219
|
POST
|
Jay, This is how I populate a dojo datagrid within some of my apps. My apps still use and older version of the javascript api and legacy style so it might not correlate to what you are doing with the dgrid. the "results" variable in the following code is just the featureset reurned from a esri findTask. I have also done this with the results from a queryTask. //create array of attributes var items = dojo.map(results, function (result) { var graphic = result.feature; graphic.setSymbol(symbol); map.graphics.add(graphic); return dojo.clone(result.feature.attributes); }); //Create data object to be used in store var data = { identifier: "OBJECTID", //This field needs to have unique values label: "ID", //Name field for display. Not pertinent to a grid but may be used elsewhere. items: items }; //Create data store and bind to grid. store = new dojo.data.ItemFileReadStore({ data: data }); var grid = dijit.byId('gridCorners'); grid.setStore(store); [HTML]<table id="gridCorners" dojotype="dojox.grid.EnhancedGrid" data-dojo-props="plugins:{exporter: true}" style="height: 220px; width:100%; overflow:auto;"> <!--rowsPerPage:'5', rowSelector:'20px', rowHeight:'16px'--> <thead> <tr> <th field="POINT ID" width="50px"> PT ID </th> <th field="PROJECT" width="70px" formatter="makeLink"> PROJECT </th> <th field="ROAD" width="60px"> ROAD </th> <th field="YEAR" width="50px"> YEAR </th> <th field="SIZE" width="40px"> SIZE </th> <th field="DESCRIPTION" width="60px"> TYPE </th> <th field="SURV_INV" width="100px"> AS SHOT ELEV </th> <th field="CALCD_INV" width="120px"> CALCULATED ELEV </th> <th field="LENGTH" width="60px"> LENGTH </th> <th field="APRONS" width="80px"> APRONS </th> <th field="DIRECTIONS" width="160px"> DIRECTIONS </th> <th field="SECTION" width="35px"> SEC </th> <th field="TOWNSHIP" width="35px"> TWP </th> <th field="RANGE" width="35px"> RNG </th> <th field="CONDITION" width="80px"> CONDITION </th> <th field="LAST INSPECTION" width="60px"> INSPECT </th> <th field="COMMENTS" width="200"> COMMENTS </th> <th width="100%"> </th> </tr> </thead> </table>[/HTML] Hope that helps. Good luck, Mark
... View more
02-07-2014
04:59 AM
|
0
|
0
|
1219
|
POST
|
Hank, I have implemented an "Export to CSV" tool in a couple of my javascript apps. So once the datagrid is populated with my selected records I click on a button to export and save the csv file. Here is how I have done it, although there is probably a better way since I am still learning... I have a web handler file that I have called csv.ashx located in a folder I called "webservices" located in the project folder (i have included a screenshot of my folder structure). <%@ WebHandler Language="C#" Class="csv" %> using System; using System.Web; public class csv : IHttpHandler { public void ProcessRequest (HttpContext context) { String content = "no data"; String filename = "MyFile"; if (context.Request["report"] != null) { try { content = context.Request["report"].ToString(); } catch { } } if (context.Request["filename"] != null) { try { filename = context.Request["filename"].ToString() + "_" + DateTime.Now.ToString("MMMd_HH.mm"); } catch { } } context.Response.ContentType = "text/csv"; context.Response.AddHeader("Content-disposition", "attachment;filename=" + filename + ".csv"); context.Response.Write(content); } public bool IsReusable { get { return false; } } } Now within the main html doc (although this should probably be moved to a separate javascript file) I have the following functions. This is the function called when the user clicks the button and it basically takes everything in the datagrid and into a csv text string. function exportCSVData() { var gridData = dijit.byId("gridCorners"); var csvdatafield = dojo.byId("csvdata"); dijit.byId('btnExport').setAttribute('checked', false); var csvText = ""; var fields = gridData.structure[0].cells[0]; if (fields != null && fields.length > 0) { for (var ifldCnt = 0; ifldCnt < fields.length; ifldCnt++) { if (ifldCnt == 0) { csvText = fields[ifldCnt].name; } else { csvText += "," + fields[ifldCnt].name; } } csvText += "\n"; var fieldValue = ""; for (var i = 0; i < gridData.rowCount; i++) { var featureAttribute = gridData.store._arrayOfAllItems; var columnVal; for (var ifldCnt = 0; ifldCnt < fields.length - 1; ifldCnt++) { fieldValue = ""; columnVal = featureAttribute[fields[ifldCnt].field][0]; if (columnVal != null && columnVal != "") { fieldValue = columnVal; } if (isNaN(fieldValue)) { if (fieldValue.indexOf('\'') != -1 || fieldValue.indexOf('\"') != -1 || fieldValue.indexOf(',') != -1) { if (fieldValue.indexOf('\"') != -1) { fieldValue = fieldValue.replace("\"", "\"\""); } fieldValue = "\"" + fieldValue + "\""; } } if (ifldCnt == 0) { csvText += fieldValue; } else { csvText += "," + fieldValue; } } csvText += "\n"; } getCSV(csvText) } } And this is what actually submits the form to the webhandler. There is also included code to prompt the user to name the file and if the do not they get an alert. function getCSV(csvText) { //Get the stored CSV var url = "webservices/csv.ashx"; var data = csvText; var f = dojo.byId("downloadform"); f.action = url; dojo.byId("reportinput").value = data; userChoice = prompt("Choose a File Name (the date and time will be added to end of filename):"); if (userChoice != null && userChoice != 'undefined' && userChoice != '') { dojo.byId("filename").value = userChoice; f.submit(); } else if (userChoice == 'undefined') { alert("You must type in a filename!"); } else if (userChoice == '') { alert("You must type in a filename!"); } else if (userChoice == null) { alert("The CSV Export was Canceled"); } } And here is the html for the hidden download form. [HTML]<form method="post" action="" style="height: 0px; width: 0px; display: none;" class="dlform" id="downloadform" target="_blank"> <input type="hidden" name="report" class="ri" id="reportinput" value="" /> <input type="hidden" name="filename" class="fn" id="filename" value="" /> <input type="hidden" name="s" class="s" id="s" value="" /> <input type="hidden" name="numberofcolumns" class="rit" id="numberofcolumns" value="pdf" /> </form>[/HTML] I hope this helps. As I mentioned above, there might be a better way to accomplish this. This app has been up and running for a while now and I haven't had any users inform me of issues with exporting so it does work reliably. Thanks, Mark
... View more
02-07-2014
03:32 AM
|
0
|
0
|
1538
|
POST
|
Found the answer. Thanks to Jeff's post, I took another look at my code and realized I had changed a variable along the way that was causing my issues.
... View more
01-21-2014
09:29 AM
|
0
|
0
|
445
|
POST
|
Thanks for the response Jeff! Here is the code that came in the template. <script type="text/javascript">
var dojoConfig = {
async: false,
parseOnLoad: true,
mblHideAddressBar: false,
packages: [{
name: "js",
location: location.pathname.replace(/\/[^/]+$/, '') + '/js'
}]
};
</script> Do I need to change something here? None of the other templates I have used from the local government gallery have required me to change something there. I have included a screenshot of the folder structure for this site. Thanks again!
... View more
01-21-2014
08:48 AM
|
0
|
0
|
445
|
POST
|
Good Morning, I am currently trying to set up the Citizen Service Request app (from the arcgis for local government app gallery) and continue to run into a problem. While debugging I encounter this error... "Microsoft JScript runtime error: xhrFailed" The error happens everytime the script reaches the following lines. dojo.require("js.config"); dojo.require("js.infoWindow"); dojo.require("js.date"); I have re-ordered these and the error happens no matter which one it hits first. The files exist and within each one they start with the following code (this is from the config.js file)... dojo.provide("js.config"); dojo.declare("js.config", null, { Any help would be greatly appreciated. Thanks, Mark
... View more
01-21-2014
06:19 AM
|
0
|
4
|
996
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|