|
POST
|
Hello, I'm trying to filter esri's geocoder for a specific country. I've had some success, but nothing works extremely well. I would have thought simply adding sourceCountry = "xxx" to the parameters of the arcgisGeocoder would work, but I couldn't get it to zoom correctly. here are the three versions I've found: 1. attach a condition to the URL 2. go with no filter 3. use suffix = ", USA" I'm attaching a code snippet as well below of these. I'm wondering: Has anyone found a better way to filter the autocomplete options and have the map zoom to the correct coordinates? //1. this one works okay, but the autofill is much slower than the others var myGeocoders = [{ url: "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer?sourceCountry=USA", name: "EsriWorldLocator", placeholder: "Find a place", autoComplete: true, singleLineFieldName: "SingleLine" }]; var geocoder = new Geocoder ({ map: map, arcgisGeocoder: false, geocoders: myGeocoders }, dom.byId("search") ); geocoder.autoComplete = true; //2. This is the original, no filter var geocoder = new Geocoder({ arcgisGeocoder: { placeholder: "Find a place" }, autoComplete: true, map: map }, dom.byId("search") ); //3. This one has a great autocomplete, but it zooms to a seemingly random location var geocoder = new Geocoder({ arcgisGeocoder: { //sourceCountry: "USA", suffix: ", USA", placeholder: "Find a place" }, autoComplete: true, autoNavigate: true, map: map }, dom.byId("search") );
... View more
01-05-2015
04:18 PM
|
0
|
9
|
11072
|
|
POST
|
Looks like QueryTask does not allow for geometry when using statistics: from Query api for outStatistics parameter (query-amd | API Reference | ArcGIS API for JavaScript 😞 "The definitions for one or more field-based statistic to be calculated. outStatistics is only supported on layers/tables where supportsStatistics is true. If outStatistics is specified the only other query parameters that will be used are groupByFieldsForStatistics , orderByFields , text , timeExtent and where ."
... View more
12-01-2014
07:07 AM
|
0
|
0
|
685
|
|
POST
|
Hello, I have a question about using QueryTask to do two things: 1. Identify unique value for a record in a graphics layer via mouseover. This unique value (from a specified field) is used to create a barchart 2. Use StatisticDefinition to obtain the maximum value possible for all records in a field. I want to use the max value to set the limit to the barchart length Unfortunately, I seem to be able to do only one or the other: If I obtain the maximum value, I can't get the graphicsLayer to display. if I get the graphicsLayer to show, then the statisticDefinition doesn't work. I need some help understanding how QueryTask works. Can it only do one thing? Should I make two queryTasks to manage my two actions? If so, how do I synchronize them? I'm attaching my script (needs a mapservice that allows for modification of layer order and symbology to function) and an image showing how the horizontal bar chart works. At this point, I'm looking for general suggestions, these two attachments are included only if it helps to better understand my question. Thank you for your input, David
... View more
11-25-2014
02:23 PM
|
0
|
1
|
3492
|
|
POST
|
Jake, Looks like it turned out to be an issue with Integer vs Float values in the pixels (I had used float). The correct values get added. I'm having trouble keeping the Footprint NoData value from converting into a 0, but looking into that now.. David
... View more
11-03-2014
01:58 PM
|
0
|
0
|
1335
|
|
POST
|
Jake, Thanks again, I've been looking into this. Changed locations to a UNC registered path. Seems to be something else. Will let you know when it finally works. Thanks again.
... View more
10-31-2014
09:23 AM
|
0
|
0
|
1335
|
|
POST
|
Jake, Thanks! After checking 'DRA' the legend min/max goes from -1.134274E+38 to 1.134274E+38 (before it went from 0 to 2094). Also, the image turns into a checkered grid. Ever seen this before? David
... View more
10-30-2014
12:43 PM
|
0
|
3
|
1335
|
|
POST
|
Hello, I'm having problems publishing a mosaic raster that has a time dimension. I have ArcGIS Image Extension installed, and am able to publish an image service, but the result doesn't carry over the pixel values (every cell is valued at 1.134274E+38). I followed the steps from ArcGIS Help 10.1 . I didn't register the underlying data, instead transferring everything (12 rasters) to the server. Here are some screen shots that might explain more: What I began with in an mxd (originalMosaicRasterMxdTimeDimension.png) Some of the parameters I had in the Service Editor (ConvertingToImageService.png) The result, when I drag the image service into an mxd, to view (ResultsNotCarryingOverValue.png). Would appreciate any help, or if more information is needed for a meaningful answer, let me know - I wasn't sure what parameters to include. David
... View more
10-29-2014
01:36 PM
|
0
|
5
|
3291
|
|
POST
|
Hello, I created a time enabled layer of 72 countries. While I can easily use the time slider when using graduated color symbology, I cannot do the same with graduated symbols or proportional symbols. The symbols remain at the initial size setting, even though the country values are updating correctly (If I identify a country at different years in the time slider, the variable value updates correctly). Has anyone else had this problem? Any thoughts on where to hunt down a solution? I'm using a file geodatabase with a country feature layer(72 records) and a table that has the variable value by country/date (1500+ records). I join the two in an mxd to create the time enable feature layer. David
... View more
07-31-2014
07:58 AM
|
0
|
0
|
4157
|
|
POST
|
Hello, I'm looking to make a dot density map with a DynamicMapServiceLayer (dynamic layer). While I've seen dynamic layers used in other rendering types (such as Class Breaks), I haven't seen one for dot density (the examples I have seen use a FeatureLayer instead). I've been testing a potential solution below. The following script is based on https://developers.arcgis.com/javascript/jssamples/renderer_dynamic_layer_change_attribute.html. The only change I made was to swap out the classbreaks function for a dot density function (to create a dot density renderer). My questions are: Have you seen any examples using a dot density renderer with a dynamic Layer? The Classbreaks function uses a generateRendererTask when setting up the LayerDrawingOptions. Does the dot density use the same Task? Thank you for your time, David
function getData() {
domStyle.set("loading", "visibility", "visible");
dotDensity();
}
function dotDensity() {
selectField = registry.byId("fieldNames").get("value") || "POP2007";
console.log(selectField);
var renderer = new DotDensityRenderer({
fields: [{
name: selectField,
color: new Color("#CC8800")
}],
dotValue: 3200,
dotSize: 1
});
applyRenderer(renderer); // this is one part I'm not sure of.
// do I need to put this in a GenerateRendererTask?
}
function applyRenderer(renderer) {
// dynamic layer stuff
var optionsArray = [];
var drawingOptions = new LayerDrawingOptions();
drawingOptions.renderer = renderer;
// set the drawing options for the relevant layer
// optionsArray index corresponds to layer index in the map service
optionsArray[2] = drawingOptions;
app.map.getLayer("us_counties").setLayerDrawingOptions(optionsArray);
app.map.getLayer("us_counties").show();
// create the legend if it doesn't exist
if ( ! app.hasOwnProperty("legend") ) {
createLegend();
}
}
... View more
06-02-2014
11:54 AM
|
0
|
4
|
4193
|
|
POST
|
Hello, I'm using printTask and am having trouble breaking out of the print task itself. While I can identify the error (using the printTask.error event) I can't seem to stop the overall print function from continuing to run. My basic setup is: function createPrintTask () { // params = a bunch of parameters for the different templates..... printTask = new esri.tasks.PrintTask(location of print service); printTask.execute(params, printResult); printTask.on('error', function () { alert ("error"); return; //// This is where I'd like to get out of the printTask execution } } function printResult(result) { // handles print result } In order to exit, I've tried using 'break;' and 'return false;' . What I'd like to happen is that the printTask would stop executing. Any ideas on how to do this? What do I need to actually stop: the printTask object, or the createPrintTask function? David
... View more
02-24-2014
10:01 AM
|
0
|
0
|
735
|
|
POST
|
Ganesh, Thanks for the help! Have you done any work with PrintTask, instead of Print dijit? David
... View more
01-09-2014
11:16 AM
|
0
|
0
|
3255
|
|
POST
|
Russell, Thanks! I like the way you incorporate a user defined map title into the print result. I'll plan on incorporating that, thank you. Have you seen examples that use PrintTask, rather than Print dijit? I'm curious to see how others have used this tool. David
... View more
01-09-2014
11:13 AM
|
0
|
0
|
3255
|
|
POST
|
Hello, There don't seem to be too many examples of how to use the Print Task on the ESRI site. I'm curious to see what others have done. Below is one I cobbled together based on some online resources (https://github.com/slead/jsapi/blob/master/printTask/printTask.html) . The script below has a drop down list that opens up a new window with the print result (not the most elegant, but does the job). I'm curious, though, to see what PrintTask is capable. Seems like the possibilities should be endless. What have others done? What options have you been able to give the end user in designing the print result? Have you been able to avoid the popup blocker (pretty inherent in the example I give)? Either sample scripts, or links to scripts that use print task would be appreciated. Just trying to see what is possible. David [HTML]<!doctype html> <html> <head> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> <meta http-equiv="x-ua-compatible" content="IE=9" > <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title>Print Task Test</title> <script> var dojoConfig = { async : true }; </script> <link rel="Stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/tundra/tundra.css" /> <link rel = "stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css" /> <script src="http://js.arcgis.com/3.7/" type="text/javascript"></script> <style> html, body, #window, #map { height: 100%; width: 100%; margin: 0; padding: 0; font-family:arial, helvetica, sans-serif; } #buttons{ position: absolute; top: 10px; right: 18px; height: 20px; z-index:100; box-shadow: none; font-size:13px; } </style> </head> <body class="tundra"> <div id="window"> <div id="map" ></div> <div id="buttons"> <button id="prnt" class="topButton" data-dojo-type="dijit/form/DropDownButton" ><span>Print</span> <div dojoType="dijit/Menu"> <div id="png" data-dojo-type="dijit/MenuItem" label="Image(.png)" style='font-size: 13px;'></div> <div id="landscape" data-dojo-type="dijit/MenuItem" label="Landscape(PDF)" style='font-size: 13px;'></div> <div id="portrait" data-dojo-type="dijit/MenuItem" label="Portrait(PDF)" style='font-size: 13px;'></div> </div> </button> </div> </div> </body> <script> var map; var PrintTask; //var layerResults; require ([ "dojo/on", "dojo/_base/connect", "dojo/dom", "dojo/query", "dojo/parser", "esri/map", "esri/dijit/Scalebar", "esri/arcgis/utils", "esri/dijit/Print", "esri/tasks/PrintTask", "esri/tasks/PrintTemplate", "esri/dijit/Popup", "esri/dijit/Attribution", "dojo/dom-construct", "dojo/dom-class", "dojo/mouse", "dijit/form/Button", "dijit/Menu", "dijit/layout/BorderContainer", "dojo/domReady!" ], function (on, connect, dom, query, parser, Map, Scalebar, arcgisUtils, Print, PrintTask, PrintTemplate, Popup, esriConfig, Attribution, domConstruct, domClass, mouse, Button, Menu, BorderContainer){ parser.parse(); var ext = new esri.geometry.Extent({ "xmin": -17529487, "ymin": 1874364, "xmax": -5084316, "ymax": 7500129, "spatialReference": { "wkid": 102100} }); map = new esri.Map("map", { extent: ext, showAttribution: false, }); var tiled = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"); map.addLayer(tiled); // connect the dropdown list with options for the print template on(dom.byId("png"),'click', function () { printTaskSetup("MAP_ONLY", "png32"); }) on(dom.byId("landscape"),'click', function () { printTaskSetup("A4 Landscape", "PDF"); }) on(dom.byId("portrait"),'click', function () { printTaskSetup("A4 Portrait", "PDF"); }) // create print task function printTaskSetup(layout, format){ var template = new esri.tasks.PrintTemplate(); template.format = format; template.layout = layout; template.layoutOptions = { "scalebarUnit": "Miles", "copyrightText": "", "showAttribution": false } template.preserveScale = true; var params = new esri.tasks.PrintParameters(); params.map = map; params.template = template; printTask = new esri.tasks.PrintTask("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"); printTask.execute(params, printResult); } function printResult(result) { window.open(result.url, "_blank") } function printError(error) { alert(error); } } ); </script> </html>[/HTML]
... View more
12-26-2013
01:54 PM
|
1
|
8
|
11290
|
|
POST
|
I've been working with ArcGIS 10.1, with service pack one. Is that what is meant by 10.11? The code provided by Kelly still doesn't work for me: no difference in printout whether I set showAttribution to true or false. Have people found that this property works in 10.2? David
... View more
11-19-2013
07:21 AM
|
0
|
0
|
1993
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-26-2013 01:54 PM | |
| 1 | 06-03-2015 10:23 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-15-2021
04:04 PM
|