POST
|
Good afternoon, I have an app that has a feature layer that allows editing and uses the identity manager for security. Everything works great in firefox and chrome, but when I view the app in IE the feature layer is drawn under the basemap so I cannot see or click on the points. I have a couple other apps that use feature layers, but do not require a sign in (using the identity manager) that work fine in IE so I am not sure why this problem is occurring. Has anyone experienced this type of problem while using feature layers with identity manager in IE? Also, if I have "compatibility mode" turned on in IE then everything works. Thanks, Mark
... View more
01-13-2014
11:04 AM
|
0
|
0
|
414
|
POST
|
Hi Numa, I have a web app that edits a stand alone SDE table. It might not apply 100% to what you are trying as I used a datagrid and allowed the user to add/delete/edit the records in the table through the datagrid in the app. I believe the same principles can be applied to the attribute inspector but have not tried that myself. Here is a link to the thread I started back when I was trying to figure it out. http://forums.arcgis.com/threads/77014-Edit-SQL-non-spatial-data-table?p=303743#post303743 I hope this helps get you started. - Mark
... View more
10-28-2013
11:22 AM
|
0
|
0
|
221
|
POST
|
Okay, so here is where I stand now... So I decided to create my own simple renderer for my features by creating a picturesymbol that uses the same image as my original feature service used. I then embedded this renderer into a decision tree so it would only be applied to my feature layer if the web browser was IE, all other browsers would be handled the default way. Here is my code... var pollLayer1 = new esri.layers.FeatureLayer(isBrowser ? pollLayer.ServiceUrl : pollMobileLayer.ServiceUrl, {
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
displayOnPan: isBrowser ? true : true,
outFields: ["*"]
});
pollLayer1.id = pollLayerId;
if (isBrowser) {
if (pollLayer1.UseImage) {
var pictureSymbol = new esri.symbol.PictureMarkerSymbol(pollLayer.Image, 25, 25);
var pollingPlaceRenderer = new esri.renderer.SimpleRenderer(pictureSymbol);
pollLayer1.setRenderer(pollingPlaceRenderer);
} else if (dojo.isIE) {
var symbolURL = 'http://server/Voting/images/star_symbol.png';
var pollSymbol = new esri.symbol.PictureMarkerSymbol(symbolURL, 23, 23);
var pollingPlaceRenderer = new esri.renderer.SimpleRenderer(pollSymbol);
pollLayer1.setRenderer(pollingPlaceRenderer);
}
}
else {
if (pollMobileLayer.UseImage) {
var pictureSymbol = new esri.symbol.PictureMarkerSymbol(pollMobileLayer.Image, 25, 25);
var pollingPlaceRenderer = new esri.renderer.SimpleRenderer(pictureSymbol);
pollLayer1.setRenderer(pollingPlaceRenderer);
}
}
map.addLayer(pollLayer1); This seemed to be working great, however after testing the site for a awhile I noticed I have a different problem now. If I navigate to the site all the features show up, but if i hit refresh or leave and then come back to the site then only some of the features show up on the map. It is alwways the same ones that show up, so it is not random. Any thoughts? Thanks, Mark
... View more
10-16-2013
08:48 AM
|
0
|
0
|
213
|
POST
|
Hi, I have an app that I just placed out on our web server and now all the server requests sent through the proxy page. esriConfig.defaults.io.alwaysUseProxy = true; Everything works great until I view the app in IE8. The symbols for the feature layer do not show up. When viewing the request in fiddler it seems that for some reason the image request does not get sent to the proxy page and instead gets sent directly to the rest endpoint and therefore cannot get through. Has anyone dealt with this issue before? I tried to follow the solution outlined in this thread (http://forums.arcgis.com/threads/24303-FeatureLayer-not-showing-image-in-Internet-Explorer-8-or-9) but that did not work for me because my layers renderer property is returned as null for some reason. Any help would be greatly appreciated. Thanks, Mark
... View more
10-15-2013
12:21 PM
|
0
|
2
|
756
|
POST
|
I finally got my export functionality to work. I went kind of along the same lines as mentioned above, but got the exact code from a post on gis.stackexhange. Here is the link to that thread in case this could help someone else. http://gis.stackexchange.com/questions/67862/export-dojo-datagrid-results-to-csv-in-javascript-web-application Thanks, Mark
... View more
08-06-2013
08:58 AM
|
0
|
0
|
445
|
POST
|
I have taken this approach for exporting the data to csv from datagrid. Added a form in page with hidden attribute and set its action to handler [HTML]<form id="csvForm" action="Handlers/MyWebHandler.ashx?module=ExportToExcel" method="post"> <input type="hidden" value="" id="csvdata" name="csvdata" /> <input type="hidden" value="" id="title" name="title" /> </form>[/HTML] Then in js function is written to get the grid data.
function exportCSVData() {
var gridData = dijit.byId("grid");
var csvdatafield = dojo.byId("csvdata");
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; ifldCnt++) {
fieldValue = "";
//columnVal = this.getValuefromAttribute(featureAttribute[fields[ifldCnt].field], false, "");
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";
}
if (csvText != "")
csvText = escape(csvText);
csvdatafield.value = csvText; // After value is set for the hidden field submit the form
var formCSV = dojo.byId("csvForm");
formCSV.submit();
}
} Once the form is submitted, the control is passed to handler, that will fetch the data from form submitted and create csv In handler get the attributes "MyWebHandler.ashx"
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
System.Collections.Specialized.NameValueCollection parameters = context.Request.Form;
string moduleName = parameters["module"];
ExportHelper objExportCSVHelper = new ExportHelper();
objExportCSVHelper.ExportToCSV(parameters["csvdata"].ToString(), HttpContext.Current, parameters["title"].ToString());
} And in ExportHelper class write the ExportToCSV Function
public void CSV2Excel(string strCSV, HttpContext current, string strTitle)
{
current.Response.Clear();
strCSV = removeUniCodeSequenceCharacters(strCSV);
strCSV = System.Text.RegularExpressions.Regex.Unescape(strCSV);
current.Response.AddHeader("content-disposition", "attachment;filename=" + strTitle +"_"+DateTime.Now.ToString("ddmmyyyyHHMMSS") + ".csv");
current.Response.Charset = "";
current.Response.ContentType = "application/octet-stream";
current.Response.Write(strCSV);
current.Response.End();
}
//Since we used escape to send text from javascript to Server side we need this function
private string removeUniCodeSequenceCharacters(string strWithEscapeSequence)
{
string strUse = "";
strUse = strWithEscapeSequence.Replace("%20", " ");
strUse = strUse.Replace("%2C", ",");
strUse = strUse.Replace("%27", "'");
strUse = strUse.Replace("%22", "\"");
strUse = strUse.Replace("%3F", "?");
strUse = strUse.Replace("%0A", "\n");
strUse = strUse.Replace("%28", "(");
strUse = strUse.Replace("%29", ")");
strUse = strUse.Replace("%26", "&");
strUse = strUse.Replace("%23", "#");
strUse = strUse.Replace("%3A", ":");
strUse = strUse.Replace("%21", "!");
strUse = strUse.Replace("%2D", "-");
strUse = strUse.Replace("%3B", ";");
strUse = strUse.Replace("%2A", "*");
strUse = strUse.Replace("%2B", "+");
strUse = strUse.Replace("%2E", ".");
strUse = strUse.Replace("%3C", "<");
strUse = strUse.Replace("%3D", "=");
strUse = strUse.Replace("%3E", ">");
strUse = strUse.Replace("%40", "@");
return strUse;
} Could you please provide all the code for your MyWebHandler.ashx file? I am trying to implement your strategy but keep getting errors in that file. I assume I missed some code or something so if you could provide the entire code for that file it would be greatly appreciated. Thanks, Mark
... View more
07-30-2013
09:52 AM
|
0
|
0
|
445
|
POST
|
Not sure if it matters, but in my code I create the layer and then below that I have the code for the dojo.connect and then below that i have the line to add the layer to the map. map.addLayer(devPlanLayer); Have you tried setting a break point inside the dojo.connect function and then stepping through the function to see where it errors out? In addition, if the breakpoint never gets called you know there is something wrong with either the code used to create the layer or the dojo.connect code. For instance, maybe there is another graphics layer on top of the parks graphics layer in which case the app would not recognize when your mouse it over the parks graphic. Another thing to just double check is the actual name of the attribute field you wish to use in the tooltip. The code I provided uses a field called "NAME". Does your parks layer use the same field or is it something different?
... View more
07-29-2013
05:29 AM
|
0
|
1
|
393
|
POST
|
Yes, I did set 'DevPlanLayer' as a feature service instead of a map service. //URL used for doing query task on the features.
'DevPlanLayer' : "http://servername/arcgis/rest/services/foldername/servicename/MapServer/0", devPlanLayerURL is populated with whatever you enter in the config file. devPlanLayerURL = responseObject.DevPlanLayer; I do find that using a feature service instead of a map service does decrease the speed of the app, but since it is just point features I am willing to deal with that. Thanks, Mark Also, if you post some code from your app, specifically all the parts that involve creating 'devPlanLayer' than I might be able to get a better idea as to what is going on.
... View more
07-25-2013
12:52 PM
|
0
|
0
|
393
|
POST
|
Craig, I have set up my parks app to show the park name when the user hovers over the park, however it is when they hover over a point in the park and not the actual park boundary (polygon) since I actually have that in my basemap. It is the same functionality though so hopefully this helps you. First, I bring my park pts in as a feature service... var devPlanLayer = new esri.layers.FeatureLayer(devPlanLayerURL, {
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
outFields: ["*"],
id: devPlanLayerID,
displayOnPan: false
}); Then, I set up the dojo.connect for when a user moves their mouse over the park pt... dojo.connect(devPlanLayer, "onMouseMove", function (evt) {
if (evt.graphic) {
if (evt.graphic.attributes) {
ShowMapTip(evt, evt.graphic.attributes.NAME);
}
}
});
dojo.connect(devPlanLayer, "onMouseOut", CloseMapTip); Finally, here are the functions used to actually create and close the map tips. (I think these were already in the template so you should have them as well in the utils.js file) //function to show maptip
function ShowMapTip(evtArgs, content) {
CloseMapTip();
var dialog = new dijit.TooltipDialog({
id: "toolTipDialog",
content: '<span style="font-size:11px; font-family:Verdana;">' + content + '</span> ',
style: "position: absolute; z-index:1000;"
});
dialog.startup();
dojo.style(dialog.domNode, "opacity", 0.80);
dijit.placeOnScreen(dialog.domNode, { x: evtArgs.pageX, y: evtArgs.pageY }, ["BL", "BR"], { x: 5, y: 5 });
}
//function to close maptip
function CloseMapTip() {
if (dijit.byId('toolTipDialog')) {
dijit.byId('toolTipDialog').destroy();
}
}
Hope this helps! Mark
... View more
07-25-2013
09:04 AM
|
0
|
0
|
393
|
POST
|
thanks Diana, that was exactly what I was looking for. Thank you to everyone who helped! Here is my code in case it can help someone else down the road... function DoBuffer(bufferDistance) {
//Selects the buffer unit based on user input
var bufferUnit = selectbufferUnit.value;
switch (bufferUnit) {
case 'Feet':
bufferUnit = [esri.tasks.GeometryService.UNIT_FOOT];
break;
case 'Miles':
bufferUnit = [esri.tasks.GeometryService.UNIT_STATUTE_MILE];
break;
case 'Meters':
bufferUnit = [esri.tasks.GeometryService.UNIT_METER];
break;
case 'Kilometers':
bufferUnit = [esri.tasks.GeometryService.UNIT_KILOMETER];
break;
}
var params = new esri.tasks.BufferParameters();
//Sets the buffer distance based on user input
params.distances = [bufferDistance];
params.unit = [bufferUnit];
params.bufferSpatialReference = map.spatialReference;
params.outSpatialReference = map.spatialReference;
//Gets the geometries for all the selected sites
params.geometries = esri.getGeometries(map.graphics.graphics);
//This parameter unions all the generated buffer polygons into a single multipart polygon
params.unionResults = true;
geometryService.buffer(params, ShowBuffer);
features = [];
}
//function for Displaying the buffer
function ShowBuffer(geometries) {
//Creates the symbol for the buffer
var lineColor = new dojo.Color();
lineColor.setColor(rendererColor);
var fillColor = new dojo.Color();
fillColor.setColor(rendererColor);
fillColor.a = 0.15;
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
lineColor, 2),
fillColor);
var bufferLayer = map.getLayer(tempBufferLayer);
//Adds the buffers to a graphics layer
AddGraphic2(map.getLayer(tempBufferLayer), symbol, geometries[0]);
//Sets the extent of the map so that the buffers are visible
var bufferPolygon = bufferLayer.graphics[0];
var bufferExtent = bufferPolygon.geometry.getExtent();
var finalExtent2 = bufferExtent.expand(1.5);
map.setExtent(finalExtent2);
//Queries the address point layer for any points contained within the buffers
var qTask = 'qTask';
qTask = new esri.tasks.QueryTask("http://servername/arcgis/rest/services/foldername/servicename/MapServer/1");
var query = new esri.tasks.Query();
query.where = "1=1";
query.geometry = geometries[0];
query.outFields = ["*"];
query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_CONTAINS;
query.returnGeometry = true;
//All addresses returned from the query are shown on the map and also shown in a datagrid.
qTask.execute(query, function (featureset) {
var addressGraphics = featureset.features;
//Creates the symbol for all the addresses returned from the query
var symbolAddress = new esri.symbol.SimpleMarkerSymbol(
esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 12,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_NULL,
new dojo.Color([247, 34, 101, 0.9]), 1),
new dojo.Color([207, 34, 171, 0.5])
);
//Creates the attributes for the addresses that will be added to a graphics layer
var attributes;
var a;
for (a = 0; a < addressGraphics.length; a++) {
attributes = { "OBJECTID": addressGraphics.attributes["OBJECTID"], "PIN": addressGraphics.attributes["PIN"], "BUSINESSNAME": addressGraphics.attributes["BUSINESSNAME"], "OWNAME": addressGraphics.attributes["OWNAME"], "PHYADDR1": addressGraphics.attributes["PHYADDR1"] };
//Adds the addresses to a graphics layer using the symbol and attributes previously created
AddGraphic2(map.getLayer(selectedAddressesID), symbolAddress, addressGraphics.geometry, attributes);
}
var results = map.getLayer(selectedAddressesID).graphics;
//create array of attributes
var items = dojo.map(results, function (result) {
return result.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('gridAddress');
grid.setStore(store);
});
} thanks again. Mark
... View more
07-23-2013
11:04 AM
|
0
|
0
|
401
|
POST
|
Could you add some more code, specifically the part where you convert the geometries returned from the geometry service to a string? I have not done that before and am having some issues implementing it.
... View more
07-22-2013
06:01 AM
|
0
|
0
|
401
|
POST
|
Hi, I am trying to query all the points located within multiple polygons. I have used the querytask many times to find features contained within a single polygon, but am having troubles accomplishing this with multiple polygons. Basically, my app selects specific sites (points) and then applies a buffer around them. From there I need to find all the addresses (points) located within all the buffer polygons (the number of buffer polygons varies based on the original search results). The buffers are added to a graphics layer when drawn and then cleared out anytime there is a new search. Can I query against the geometries of all the graphics in the buffer layer at once or do I need to loop through them running a seperate query each time and somehow combine all the results? Thanks in advance for any help you can provide. Thanks, Mark
... View more
07-18-2013
10:43 AM
|
0
|
5
|
737
|
POST
|
Do you have the capabilities to create your own locators and publish them out as a geocode service? If you do, that might be the best way to get accurate results (assuming your roads and address point layers are accurate). I use created a composite locator (roads & address points) and published that out for use in all of our apps. Otherwise, try swapping out the url you listed with the following ESRI one. http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_NA_10/GeocodeServer Good Luck, Mark
... View more
06-21-2013
08:05 AM
|
0
|
0
|
451
|
POST
|
Are you using the python script tabletoexcel.py that i pointed to? if so, here is how i modified it to fit my use. I added Make Feature Layer (or Make Table View) with the Query Expression (the same as you use query task's where clause). then use the result feature layer or table view (in your case would be data store) as the first input for the tabletoexcel.py and published it as a GP service (i also include a zip module to zip the result). Would it be possible for you to paste some code to show exactly how you implemented the gp service within your code? What did you do for the second input? Also, did you change anything within the actual table2excel python script? Any help would be greatly appreciated, I have been stuck on this for a while now. Thanks, Mark
... View more
06-21-2013
06:49 AM
|
0
|
0
|
445
|
POST
|
There is a python script in http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=95009B25-1422-2418-7FB5-B8638ECB2FA9. You can easily modify it and use it as a GP Service. I personally used it to convert a query results (FeatureSet) to CSV or .XLS file. I know this has been idle for a while, but I am stuck. What do I have to modify within the python script so that I can use it as a geoprocessing service to export data from a datagrid? Thanks, Mark
... View more
06-14-2013
08:27 AM
|
0
|
0
|
445
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|