|
POST
|
Hi. Is there a way to have returned results from a query "flash" for a brief second similar to the flash that is created in ArcMap editing mode when clicking on the Attributes? They are hard to see at the US CONUS extent. I want it so that visible layer 6 in my map service flashes the returned polygons. I was looking for a workaround and thought of having a different symbology for small scales but that is not possible yet according to this arcgis idea: http://ideas.arcgis.com/ideaView?id=087300000008IPaAAM Thank you. searchService.setLayerDefinitions(defintionExpression, true);
searchService.setVisibleLayers(visible, true);
var vL = searchService.visibleLayers;
//If 1 and 2 are the only layers selected, make them non-transparent so they stand out (since they are points, not polygons)
if (vL == 1) {
searchService.setOpacity(1.0);
} else if (vL == 2) {
searchService.setOpacity(1.0);
} else {
searchService.setOpacity(0.6);
}
... View more
06-19-2014
11:17 AM
|
0
|
2
|
1212
|
|
POST
|
The InfoTemplate does give you the ability to execute a function that returns the template. You can view the documentation here, but using your code, you could try this: if (layerName === 'County_City_Py') { var CityCountyTemplate = new InfoTemplate(function (graphic) { var attr = graphic.attributes; var template = "City: "; template += (attr.CITY_NAME === null) ? 'n/a' : attr.CITY_NAME; template += '<br />County: ' + attr.COUNTY; template += '<br />State: ' + attr.STATE_NAME; return template; }); CityCountyTemplate.setTitle("Search Result") feature.setInfoTemplate(CityCountyTemplate); } Thanks for your response. I checked out that link and tweaked your code. This is working now. I am not sure why I had to put quotes around Null. In the table preview in ArcCatalog it states <Null> for null values. if (layerName === 'County_City_Py') { if (feature.attributes.CITY_NAME === "Null") { var CityCountyTemplate = new InfoTemplate("", "City: n/a <br/> County: ${COUNTY} <br/> State: ${STATE_NAME}"); CityCountyTemplate.setTitle("Search Result") feature.setInfoTemplate(CityCountyTemplate); } else { var CityCountyTemplate = new InfoTemplate("", "City: ${CITY_NAME} <br/> County: ${COUNTY} <br/> State: ${STATE_NAME}"); CityCountyTemplate.setTitle("Search Result") feature.setInfoTemplate(CityCountyTemplate); } }
... View more
06-11-2014
08:19 AM
|
0
|
0
|
758
|
|
POST
|
Hi I have the following code that is very similar to the JS sample https://developers.arcgis.com/javascript/jssamples/find_popup.html Sometimes the CITY_NAME field will be null. When that occurs I would like it to say "n/a" rather than "Null." It shows up as "Null" capitalized. if (layerName === 'County_City_Py') { var CityCountyTemplate = new InfoTemplate("", "City: ${CITY_NAME} <br/> County: ${COUNTY} <br/> State: ${STATE_NAME}"); CityCountyTemplate.setTitle("Search Result") feature.setInfoTemplate(CityCountyTemplate); } I have tried a combination of if/then statements including: if (${CITY_NAME} != null) { Unexpected token { error and if ("${CITY_NAME"} != null) { No error but doesn't work. Thank you!
... View more
06-11-2014
06:35 AM
|
0
|
2
|
1073
|
|
POST
|
Hi Jake, Thank you for your response. After doing alert(pastDate) it was telling me that the pastDate was 1/24/114. I changed "getYear" to "getFullYear" and now it is working fine. Thanks!
... View more
04-24-2014
11:46 AM
|
0
|
0
|
514
|
|
POST
|
Hi I am trying to set up my def expression to display only points within the last 90 days using a feature service from the NWS. However, no points are being displayed when I know some points should be. If I change the def expression to another field ("injuries > 3"); that works. I am not sure if the date field is formatted correctly and I could not find any examples. Thank you! stormdate ( type: esriFieldTypeDate , alias: stormdate , editable: true , nullable: true , length: 36 ) var feature = new esri.layers.FeatureLayer(layer.url, { infoTemplate: infoTemplate, mode: esri.layers.FeatureLayer.MODE_ONDEMAND, outFields: ["stormdate", "surveydate", "injuries"] }); var pastDate = new Date(); pastDate.setDate(pastDate.getDate()-90); feature.setDefinitionExpression("stormdate > pastDate");
... View more
04-24-2014
08:20 AM
|
0
|
2
|
920
|
|
POST
|
Hi. I just want to view the attachments of a feature service available online. I do not want to edit, delete, or add attachments. If I open the feature service using AGOL I am able to view the attachment link when clicking on the point. However, if I try to add the feature service to my JS application, I cannot get the link to the attachments to display. Other fields display correctly. function createFeatureLayer(layer) {
var infoTemplate = new esri.InfoTemplate(
"${stormdate}",
"${dod_txt}"
);
var feature = new esri.layers.FeatureLayer(layer.url, {
infoTemplate: infoTemplate,
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ["*"],
hasAttachments: true
});
attachmentEditor = new esri.dijit.editing.AttachmentEditor({}, dojo.byId("content"));
attachmentEditor.startup();
feature.on("click", function(evt) {
attachmentEditor.showAttachments(evt.graphic,feature);
map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
});
return feature; Thank you for any help.
... View more
04-22-2014
11:44 AM
|
0
|
0
|
360
|
|
POST
|
Thank you. I found some info on the ArcGIS help pages. Here is what I did. arcpy.ConvertTimeField_management(pt,"datetime","yyyyMMddHHmmss, yyyy/MM/dd HH:mm:ss", "DATETIME_Converted") arcpy.AddField_management(pt, "DATETIME_CST", "DATE") arcpy.CalculateField_management(pt, "DATETIME_CST", "DateAdd(\"h\",-6,[DATETIME_Converted])", "VB", "")
... View more
02-27-2014
11:01 AM
|
0
|
0
|
1281
|
|
POST
|
Hi I have the following python code where the field "datetime" is a string field and is different for each record. I want to convert the UTC time string to a date/time and then subtract 6 hours from it (CST). It is telling me that "!datetime!" does not match the format of "%Y%m%d%H%M". The actual records within the field do match that format, but I think it is trying to use the string "!datetime!" rather than using the data within that field name. I wonder if this is a quick formatting fix or I need to set up a cursor to go through each field? Thank you. arcpy.CalculateField_management(pt, "DATE_CST", dt.strptime("!datetime!", "%Y%m%d%H%M") - timedelta(hours=6), "PYTHON_9.3")
... View more
02-26-2014
10:37 AM
|
0
|
2
|
4274
|
|
POST
|
Yes that is correct. That is what is happening on my VM. I am running the scipt on my PC using v10.1, and it does not produce blank values.
... View more
01-31-2014
06:37 AM
|
0
|
0
|
550
|
|
POST
|
The SnowFall and PrecipTotal fields. Those fields contain text values 'M' and ' T', but they are lost once I do the tabletogeodb conversion. If I run the script on my VM and look at the geodatabase table, those are now number fields and the values of M and T are now replaced with blank space. Thanks!
... View more
01-31-2014
06:17 AM
|
0
|
0
|
550
|
|
POST
|
Hi I have attached the python script and the data file (zip). Thank you for your help! Basically the script extracts the files from the zip file then looks for the .txt file that contains "daily" in the file name, and converts that to geodb table.
... View more
01-31-2014
04:21 AM
|
0
|
0
|
1429
|
|
POST
|
Hello. I can try. Most of the script was written by a private vendor, so I am not sure if I feel comfortable with that. I will try to work up something though. Also, a schema.ini file is created when running the script on the VM, and not on my PC. It's contents is here. Col 1 and 2 only contain integers. Columns 3,5,7,11,13,15, 17 all have a mix of text and integer values, but only the integer values come through on my VM. Thank you. [201312daily.txt]
Col3=Tmax Text
Col5=Tmin Text
Col7=Tavg Text
Col11=DewPoint Text
Col13=WetBulb Text
Col15=Heat Text
Col17=Cool Text
... View more
01-30-2014
12:20 PM
|
0
|
0
|
1429
|
|
POST
|
There is some error logging. I did not create this script from scratch. I'm doing some modification of an older script my company uses. I am not getting an error. It runs fine.
... View more
01-30-2014
10:39 AM
|
0
|
0
|
1429
|
|
POST
|
No in the windows command prompt. I call the loader.bat file which calls the .ini config file and .py file. Thanks!
... View more
01-30-2014
10:23 AM
|
0
|
0
|
1429
|
| Title | Kudos | Posted |
|---|---|---|
| 5 | 11-01-2023 07:21 AM | |
| 1 | 06-22-2021 06:58 AM | |
| 1 | 01-11-2019 07:17 AM | |
| 1 | 04-04-2016 11:08 AM | |
| 1 | 07-23-2019 01:16 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-27-2025
06:53 AM
|