POST
|
I tried setting the imageSpatialReference property but it gave another error this time: "Error: [accessor] cannot access unknown property 'layerDefinitions' on instance of esri.layers.support.ImageParameters." So I also tried setting layerDefinitions as well, but I still got the same 'layerDefinitions' error. Maybe I will wait until the 4.0 API is more complete. I hope that they add a bit more documentation to the geoprocessing section as well. Maybe more example snippets would help. Thanks for your help. Charlie
... View more
06-14-2016
03:11 PM
|
0
|
0
|
461
|
POST
|
Thanks for the reply Kristian. I tried as you suggested by setting to an instance of SpatialReference, however when I run it, I still get the same error. If I look at the result in Firebug, it shows that the result image has a SpatialReference of 102008 (NAD_1983_Albers). I suspect that because my base map (and 3D view) are Web Mercator (102100), that it will not display and will give me the "TypeError: d.spatialReference is undefined" message when I try to do map.add(resultImage); Is there another way around this? Thanks, Charlie
... View more
06-14-2016
01:52 PM
|
0
|
2
|
461
|
POST
|
I am using the JS 4.0 API and am trying to get the return result from an asynchronous service, but I keep getting the error: TypeError: d.spatialReference is undefined on the result. When I created the GP task I set the output spatial reference to that of the base map ... gp = new Geoprocessor(testURL); gp.outSpatialReference = { wkid: 102100 }; However, when I try to get the result image, I get the error stating that spatialReference is undefined. I am getting the result as follows: var resultImage = gp.getResultImageLayer(result.jobId, "myImage", imageParams); Is there any way to force or set the spatialReference on the return result image? Maybe in the "imageParams"? But the docs on imageParameters don't really seem to say that I can set the spatialReference. Is it possible? Thanks, Charlie
... View more
06-14-2016
09:20 AM
|
0
|
5
|
1990
|
POST
|
Thanks Kristian. Now that I know the reasoning behind it, I will adjust accordingly. Thanks for the information. Charlie
... View more
06-13-2016
09:18 AM
|
0
|
0
|
456
|
POST
|
I have been working with the latest Javascript API 4.0, and have noticed that when you launch the web page and click to get a z value, it is incorrect depending on your initial zoom level. If you set the zoom level at 7 or less (or about 1:4,000,000), the z value of a point is incorrect, but if the zoom level is at 8 or higher, then it is correct. Also, if you launch the web page with a zoom level of 7 or less, and zoom in by one level (ie. to 8), then back out to 7, it reports the correct z value. It seems that it depends on the initial zoom level when starting the application. Is this a bug? Sample code is attached. Thanks, Charlie
... View more
06-09-2016
08:40 AM
|
0
|
2
|
2874
|
POST
|
I have an application where I need to switch out layers when a user makes a selection from a dropdownlist. I have the switching of the layers working fine, but I cannot get the LayerList to refresh with the newly selected layer. The LayerList works fine when the application loads, but when a layer is switched it does not work. I have tried to use the refresh method but that does not seem to work. Perhaps I am doing something wrong. I have a simplified version of what I am trying to do in the Javascript code below. I am using JS API version 3.16. Thanks, Charlie require([ "dojo/dom", "dojo/parser", "dojo/on", "dojo/query", "dojo/dom-class", "dojo/dom-style", "dojo/dom-construct", "esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "dijit/registry", "esri/dijit/LayerList", "dijit/form/Button", "dijit/layout/BorderContainer", "dijit/layout/TabContainer", "dijit/layout/ContentPane", "dijit/TitlePane", "dijit/Dialog", "dijit/form/TextBox", "dijit/form/ComboBox", "dojo/domReady!" ], function( dom, parser, on, query, domClass, domStyle, domConstruct, Map, ArcGISDynamicMapServiceLayer, registry, LayerList ) { parser.parse(); // Define layers and URL variables var dynamicLayer; var staticLayer; var dynLayerURL; var staticURL = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/NapervilleShelters/MapServer"; var layer1URL = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/MapServer"; var layer2URL = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/CommercialDamageAssessment/MapServer"; // Get the layer drop down list var selectedLayer = registry.byId('layerDropDown'); selectedLayer.on('change', setLayer); // Start out with layer selected in dropdownList var layerValue = selectedLayer.get('value'); if (layerValue == '1') { dynLayerURL = layer1URL; } else if (layerValue == '2') { dynLayerURL = layer2URL; } map = new Map("mapPanel", { center: [-98.2, 40.05], zoom: 5, basemap: "national-geographic" }); // Define layers as ArcGISDynamicMapServiceLayers dynamicLayer = new ArcGISDynamicMapServiceLayer(dynLayerURL, { visible: true }); staticLayer = new ArcGISDynamicMapServiceLayer(staticURL, { visible: true }); // Add the LayerList var layerList = new LayerList({ map: map, showLegend: true, layers: [ {layer: staticLayer, id: "Shelters", sublayers: true}, {layer: dynamicLayer, id: "Assessment", sublayers: true}] }, "legendDiv"); layerList.startup(); layerList.on('load', function(){ expandLayerList(); }); // ADD the LAYERS map.addLayers([staticLayer, dynamicLayer]); function loadDynamicLayer() { // Remove the current dyamicLayer map.removeLayer(dynamicLayer); // Point the new Dynamic Layer URL to the dynamicLayer dynamicLayer = new ArcGISDynamicMapServiceLayer(dynLayerURL, { visible: true }); map.addLayer(dynamicLayer); // REFRESH the layerList (DOES NOT WORK) // If I click on the layerList checkboxs, it gives me the error: // TypeError: t.byId(...) is null ??? layerList.refresh(); } function setLayer() { var lyrValue = selectedLayer.get('value'); if (lyrValue == '1') { dynLayerURL = layer1URL; } else if (lyrValue == '2') { dynLayerURL = layer2URL; } // Load the newly selected dynamic layer loadDynamicLayer(); } function expandLayerList() { query('.esriLayer').forEach(function(node){ domClass.add(node, "esriListExpand"); }); query('.esriToggleButton').forEach(function(node){ domClass.replace(node, "esri-icon-down", "esri-icon-right"); }); } });
... View more
05-11-2016
02:42 PM
|
0
|
1
|
2078
|
POST
|
I had been using version 3.2 of the API for a long time, and just recently started using version 3.16 of the API. I didn't realize that you could do that with the dynamic map service layer. I see that it was added at version 3.10. Great! Thanks again Robert.
... View more
05-06-2016
07:47 AM
|
0
|
0
|
673
|
POST
|
Ok, I see. That makes sense. I wanted to use a FeatureLayer because I wanted to be able to click to identify on a point to bring up more information, and have the layerlist. It looks like the tradeoff is either to use a FeatureLayer for "identify" and no layerlist, or an ArcGISDynamicMapService with a "layerlist" but no identify capabilities. Doesn't look like you can have both capabilities, unless there is some other way to get around it.
... View more
05-06-2016
07:30 AM
|
0
|
1
|
673
|
POST
|
Thanks Robert! That worked great. The esri layerlist works fine for a layer created as an ArcGISDynamicMapService. However, I have a service that has a main layer with several sublayers. eg. MainLayer (0) SubLayerA (1) SubLayerB (2) If I define my layer as a FeatureLayer in JavaScript using this service (ex ...myservice/MapServer/0 ), it does not work. I have to point the FeatureLayer to one of the SubLayers (1 or 2) in order for the esri layerlist to work. And then it only works for that one layer. Is there any way to make the esri layerlist show all of the sublayers when using a FeatureLayer instead of an ArcGISDynamicMapService? I have sublayers set to "true" but that does not seem to work for anything defined as a FeatureLayer. Thanks.
... View more
05-06-2016
06:36 AM
|
0
|
3
|
673
|
POST
|
I am using the esri dijit LayerList to display the layers and legend, however the text that shows the layer names is very faint and is difficult to see. Is there any way to make it darker or change the color of the text to black. Not sure why the default text color is a very faint gray ... really seems like a stupid default setting. I am using javascript api v 3.16.
... View more
05-05-2016
03:22 PM
|
0
|
6
|
2162
|
POST
|
I also agree with Donnie. With so many different JavaScript libraries available now, it is sad that ESRI has placed this limitation on its users. If there is a workaround, then please document it.
... View more
03-28-2014
08:38 AM
|
0
|
0
|
384
|
POST
|
Thanks for the info. I will try the IdentifyTask to see what it provides. Currently I am using version 3.2 so I won't be able to take advantage of the ArcGISImageServiceLayer yet. I will need to upgrade other components of my site as well to move to the latest version of the JS API. Thanks, Charlie P.S. I tried to give both Steve and Jian credit for their answers but it only let's me select one. 😞
... View more
12-20-2013
03:38 AM
|
0
|
0
|
828
|
POST
|
Jian, I am not trying to create an elevation profile. All I want to do is click a point on the map and get the elevation of that point. It seems like it should be as simple and basic as getting the latitude and longitude of a point on the map. Layers 1 and 2 of the World Topo Map service indicate that they are Elevation (m) and Elevation (ft). One would think that this service could be used for getting the elevation. However, if that is not the case, and the elevation profile service is the answer then how does one get the elevation of a single point? That service does not seem to provide that. Thanks, Charlie
... View more
12-19-2013
10:51 AM
|
0
|
0
|
828
|
POST
|
I am trying to use the Elevation Layer (either m or ft) from the World Topo Map service (http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer) to get elevation values. However, this is a Raster layer, and I don't see any way in the JavaScript API to get or query the values. Maybe I have missed something, and sure would like to know about it. Everything I have seen so far uses Feature Layers to query or retrieve data. This is easy to do in ArcMap, but I can't see how to do it using the JavaScript API. Does anyone have information that would help with this problem? Thanks for your time! Charlie
... View more
12-19-2013
07:23 AM
|
0
|
14
|
1694
|
POST
|
Jake, Thanks for the information on converting to python and publishing to ArcGIS Server. Once I have the model in python, is it possible to add some code to the python script that will write some data out to a CSV file? Would it then be possible to follow your instructions on publishing to ArcGIS Server, and have this run as a Geoprocessing Service? Thank you, Charlie
... View more
08-28-2013
07:04 AM
|
0
|
0
|
277
|
Online Status |
Offline
|
Date Last Visited |
06-29-2023
02:14 AM
|