Tag Info

New answers tagged

0

The problem was that the setTool() method was being called before startup(). It appears that starting with 3.13 you must call startup() before setTool(). My application was built in a way where setTool() was being called to disable the measurement tool, even if it was not active. Prior to 3.13 that worked fine, but it seems that has changed.


0

i counted three problems with your code: you reference esri.layers.ArcGISFeatureLayer in your code, which threw an error in the console. Uncaught TypeError: undefined is not a function The actual class is esri.layers.FeatureLayer and needed to be added to the list of AMD modules esri/layers/FeatureLayer. the second error i hit in ...


0

After beating my head against the wall and wondering why I could not get the results back from the gp.getResultData, I went back to the documentation. As it turns out, this method is only valid for Asynchronous tasks. So, to solve this I had to do two things: Python function: def someFunc(*args): # do stuff arcpy.SetParameter(3, out_url) #this ...


1

To clarify Rorro's answer, the layer id is not the same as the layer name. You can save yourself a lot of time using the following code (where mylayer references your map service layer): var legendLayer = new esri.tasks.LegendLayer(); legendLayer.layerId = mylayer.id; The layer id will differ depending on how you consume the service. E.g. Rorro said his ...


2

[I'm sure I've posted this answer somewhere before, but I can't find it] I'd really recommend against parsing the output messages. For one, it'll be tedious. And more importantly, 2, you have INFO level messages on. INFO level displays path information to resources on the Server machine. Many people would consider this a security risk (leaving this level of ...


1

The modules in your require are not matching with the variables in the function. You need to move the modules "dijit/layout/BorderContainer", "dijit/layout/ContentPane", and "dijit/TitlePane" to after "esri/symbols/SimpleFillSymbol"


0

the callback param is included automatically by the JSAPI because it assumes that the server does not support CORS. starting with version 3.0 both an automatic CORS check and the ability to declare CORS enabled servers manually were introduced. all that said, there something must be wrong with your request or the instance of ArcGIS Server though, because ...


0

you need to make sure the fields[] array associated with your featureLayer includes any field you'd like to render on. an alternative example, in which the entire featureLayer is created from a featureCollection, and information about the schema of the table is supplied via a layerDefinition, can be found here.


0

solution: in the map.js we replaced all of the myLayer.on('update-end', buildLayerList); with on(map, "update-end", buildLayerList); then in the above code we created a array that called on the checkbox id if it was checked then nothing was done. function buildLayerList() { require(["dojo/on", "dojo/dom", "dijit/form/CheckBox", ...


0

awhile back someone else reported a similar problem that ended up being tied to a particular account. can you reproduce the same behavior using different login credentials? https://twitter.com/geogangster/status/558696890615607296


0

I think this example from the docs is doing what you want, or am i wrong? https://developers.arcgis.com/javascript/jssamples/fl_featureCollection.html


0

Fixed this myself eventually. What I ended up doing: Get the xmin, ymin of the graphic on create and save this in the graphic attributes (got this from the graphic ring). Whenever the object gets moved with the Esri Editor widget I updated the xmin and ymin by hooking into the 'graphic-move-stop' event. Next to that I defined the width,height and rotation ...


3

Inside your map DIV tag, add another DIV tag with the image inside. You can set the transparency and float anywhere inside. Or since using a PNG, make it semi-transparent in advance. Example without CSS part below. <div id='map'> <div id='floating'> <img src="image.png"> </div> </div>


1

This help article seems to answer your question. Specifically this section: "The PrintingTools service can print layouts that use multiple data frames. The service only replaces the map in the active data frame; however, if the data frames have some relationship between them, such as an extent rectangle, that relationship is honored by PrintingTools."


0

your assumption is correct. the JSAPI switches to POST automatically when required. If the request is interpreted as being sent to a different domain than where the application resides and either the service handling the query or browser don't support CORS, a proxy is required. https://developers.arcgis.com/javascript/jshelp/ags_proxy.html


1

According to the documentation for the layer "update-end" event, it fires every time the layer finishes updating. Every time the user pans, zooms in or out, this event will be triggered. The problem is, the layerInfo.defaultVisibility that you use to define the checkbox state doesn't change when you change the visibility of the layer. It only shows whether ...


0

if you open the browser developer tools, you can see that the line of code below is throwing an error in the console. dom.byId('execute').on("click", search()); >>Uncaught TypeError: undefined is not a function after adding a reference to "dojo/on", a suitable replacement would be on(dom.byId("execute"), "click", search); the reason for this is ...


2

up until yesterday you would have had to invoke a web request to a geometry service to validate the topological correctness of your feature before passing the edit, but as of 3.13 you can now use the local geometry engine and call simplify()


0

This is the same answer I provided in the cmv gitter chat. Probably the simplest is to use dojo's topic.publish and topic.subscribe. That's how a number of the core cmv widgets communicate with each other. The simplest case you will probably find is when another widget (like the locator) sends info to the Growler widget. To get the concept of how topics ...


0

In the ArcGIS JavaScript API, the projection/tile layers of the map are controlled by the first tiled layer loaded. There's no easy way to swap that out on the fly. That being said, there are two approaches you could take. In the ArcGIS JavaScript API, call map.destroy() to delete the map instance, and reload all the layers, including the new basemap, onto ...


-1

If you apply a function jitter to your data points, it will provide that effect.


0

It might work this way: at layerInfos you should add as layer your wmsLayer and not the 'results': layerInfos: [{ layer: wmsLayer, title: "P_00_2013" }]


2

Do you have the WKT (Well-Known Text)? If so, you may be able to brute force parse looking for "UNIT". EDIT: Here's a hack for you. You can retrieve the WKT from a WKID by going to this address: http://spatialreference.org/ref/epsg/{wkid}/esriwkt/ For example, http://spatialreference.org/ref/epsg/2283/esriwkt/ returns: PROJCS["NAD83 / Virginia North ...


1

Have you looked at the Spatial Reference class on the API? This has a isWebMercator() method. Can you explain what you mean by "units"?


1

edit: amended answer because ray kendo was on the right track and i gave incorrect information initially. paths can either be composed of an array of Point objects or raw coordinate pairs. we assume wgs84 when no spatial reference is provided for individual points, but you need to declare the spatialReference of the empty polyline as WGS84 as well if you'd ...


2

When you're adding one layer, as you're doing, the map triggers the layer-add event. When adding a list of layers through map.addLayers(), it triggers the layers-add-result event. If you know you're going to be adding more layers, and want to use the map.addLayers() method to load them all at once, then you can do as Dan suggested: ...


2

Since you are listening for the layers-add-result event, you need to add layers with the addLayers method (not addLayer). So change this: map.addLayer(wmsLayer) To this: map.addLayers([wmsLayer])


1

I contacted Esri tech support about this question. They reminded me that the setExtentfunction takes two input variables: setExtent(extent, fit?). The fit variable is set to false by default, but according to the function documentation, it guarantees any map with tiled map service layers will "fit" on the screen. So, I have been able to fix this issue ...


0

Try this: function makeMoveable(identifyDiv) { var title_bar = query('div.titlePane', identifyDiv.domNode)[0]; var dnd = new dojo.dnd.Moveable(dojo.byId(identifyDiv), {skip: true, handle: title_bar}); } makeMoveable("identifyDiv");


1

Having trouble adding a comment from my phone, so posting here... I would recommend that you become familiar with JSON, if not already. I would develop your service to return a JSON object that contains key/value pairs that hold the results of your calculation. That JSON object can be easily parsed in your javascript, placed into existing html or used to ...


4

This is the precise use case for a geoprocessing service. Write your script and add it to a geoprocessing toolbox on the server as a script tool. You can test it on the server while developing the script by hard coding the parameters. Once you're comfortable with your code, replace those hard coded parameters with arcpy.GetParameterAsText(), add to a ...


1

I found the cause: I had to enable "Active Scripting" in Tool -> Internet Options -> Security Tab -> Custom Level I also had to run-as-administrator IE to be able to change those settings. I'm surprised that there wasn't an issue when running version 3.1 of ESRI's API.


-1

You're not passing in a callback function into your selectFeatures function. You need to set it up like: function search(){ var queryTask = new QueryTask("https://services1.arcgis.com/SIYkiqjmENweC50g/arcgis/rest/services/Connectory/FeatureServer/0"); var query = new esri.tasks.Query(); //var value = dom.byId('company').value; ...


0

this was a bug in ArcGIS Server 10.1 SP1. identical queries will fail every other time. https://geonet.esri.com/thread/64835 you can intercept the request and modify it with a nonsense and unique parameter to work around the problem, but bumping to 10.2 (or better yet, 10.3) is a lot less trouble.


0

From what I gather about your responses, it looks like you're trying to do things to the map before it is ready. You need to test whether the map has loaded its first layer before you can add your feature layers, etc. Here's how I would go about working with it. var map; function onMapLoad() { // when function called, do whatever you need to do to your ...


-1

var mymap; arcgisUtils.createMap(id,"map").then(function(response){ mymap = response.map;



Top 50 recent answers are included