9 votes
Accepted

Automate testing of web app based on ArcGIS JS API

You cannot capture selecting a feature template and creating a feature on the map using, for instance, with Selenium IDE. This is because those things don't happen at the client side, and the testing ...
user avatar
8 votes
Accepted

Error Multiple Define when loading base script

This error is caused by having jquery/jqueryUI loading at the same time from Esri's Dojo configuration and in our script. Per the thread here, putting the Esri script at the bottom of the page after ...
user avatar
  • 251
7 votes

How to Hide InfoWindow/Popup when "no information available" or when buffering?

This question is a year old but this alternate solution may be helpful to others. If you are using the Popup class you can set the Popup to a global variable so that you can set it not to show the ...
user avatar
  • 316
7 votes

Using own basemap with ArcGIS API for Javascript?

For arcgis javascript SDK version 3.x you can use esri/basemaps class to declare and register custom basemaps and use with your map: https://developers.arcgis.com/javascript/3/jsapi/esri.basemaps-amd....
user avatar
  • 201
7 votes
Accepted

How to synchronously execute a queryTask

In instances like this, the API returns deferred objects in case you're interested in identifying when more than one request to a server has resolved, but its not something your application logic has ...
user avatar
  • 5,053
7 votes
Accepted

How to reference the ArcGIS Server JS API using RequireJS

You would do this requirejs.config({ 'paths': { 'esri': 'http://js.arcgis.com/3.12/esri', 'dojo': 'http://js.arcgis.com/3.12/dojo', 'dojox': 'http://js.arcgis.com/3.12/dojox', '...
user avatar
7 votes
Accepted

Automating Pop up configuration of web app in ArcGIS for Portal?

If you're using Portal for ArcGIS or ArcGIS Online you can manage your configuration files via the ArcGIS Online Assistant. Login with your Portal or ArcGIS Online credentials and select 'View an Item'...
user avatar
  • 10.6k
6 votes

Moveable ArcGIS Identify Popup Window (Dojo)

This blog has an excellent example of how to make the window draggable and hide the arrow using dojo: https://gavinr.com/2015/04/13/arcgis-javascript-draggable-infowindow Here's the key javascript ...
user avatar
  • 431
6 votes
Accepted

ArcGIS Javascript API Query & Add features without map using REST API

Finally I have the answer for my Query: Here is the solution... (I am posting this; it might help someone) Thank You for your Help and Support. <!DOCTYPE html> <html xmlns="http://www.w3.org/...
user avatar
  • 163
6 votes
Accepted

Hide zoom buttons in ArcGIS

Pass in slider: false as an option when creating the map. Here is the Map Options API Reference. map = new Map("map", { basemap: "streets", slider: false }
user avatar
6 votes
Accepted

Remove Geometry from map using ArcGIS API for JavaScript?

If the Graphic is added directly to the map, you can just call map.graphics.remove(the_graphic), where the_graphic is the graphic that you want to remove. You can also call map.graphics.clear(); to ...
user avatar
6 votes

How to set center of map in ArcGIS API for JavaScript using Lat Long?

the centerAt() method expects a point geometry object. //pass long,lat and don't forget to load the appropriate AMD module map.centerAt(new Point(-118.15, 33.80)); //or map.centerAt(new Point(-118....
user avatar
  • 5,053
6 votes
Accepted

No legend showing at all in ArcGIS Server print task (MapExport)

I spent hours trying to figure out the same issue. I was passing the LegendLayer objects with the layerId as it is defined in the arcgis MapServer service, and no legend showing at all. Finally, I ...
user avatar
  • 76
6 votes

Automate testing of web app based on ArcGIS JS API

I just found this post, from your post here and wanted to share some Python code I wrote that helps select a given feature in a JavaScript app. This code is obviously very specific to the Selenium and ...
user avatar
  • 15.2k
6 votes
Accepted

Change the symbology of a dynamic map service in client

the two most common gotchas for Dynamic Layers are: the service itself doesn't support requests to alter symbology. (make sure Supports Dynamic Layers is true in the service metadata) the index ...
user avatar
  • 5,053
6 votes
Accepted

Zooming to ArcGIS JavaScript API graphic feature, but not to full extent?

In the Extent class there's an expand(factor) method: So, I tried: var extent = graphicsUtils.graphicsExtent(map.graphics.graphics).expand(4) map.setExtent(extent); And it's exactly what I wanted.
user avatar
  • 9,011
6 votes

How to get Symbol from a feature layer

in 4.x of our ArcGIS API for JavaScript, its as easy as checking FeatureLayer.renderer. in 3.x, besides looping through individual graphics, you can also find the renderer documented in the service ...
user avatar
  • 5,053
5 votes
Accepted

Adding feature layer to ArcGIS Online from REST API?

I've checked requests which were sent in ArcGIS Online to add Feature Service with Chrome dev tools and found that it uses 4 requests: Create Service - create feature service with REST API without ...
user avatar
  • 66
5 votes
Accepted

Changing map projection and adding graphic features in projected coordinate system using ArcGIS API for JavaScript?

The map object will take on the projection of the first layer you add to it, in the case of your code, the streets basemap is 102100 (web mercator). You have two options to solve this: Use your own ...
user avatar
5 votes
Accepted

export map state as JSON: Web_Map_as_JSON

This is not directly available through the API. The PrintTask can be used to get the Web_Map_as_JSON. map.on("load", function(){ require(["esri/tasks/PrintTask", "dojo/_base/json"], function(...
user avatar
5 votes
Accepted

Changing the cursor on an ESRI map

You can use map.setMapCursor("url(custom.cur),auto") Here is the api reference
user avatar
  • 6,122
5 votes

ArcGIS Web AppBuilder widget config?

In the Web AppBuilder for ArcGIS (Developer Edition), after modifying the configuration of the Coordinate Widget in a local application and ensuring that you've saved your work, the settings can be ...
user avatar
  • 5,053
5 votes
Accepted

Getting value coded of domain from map layer with arcgis javascript api

You can get this from the FeatureLayer class. There is an attribute called fields, which is an array of Field objects. The Field class has domain attribute. The following will output the domains in ...
user avatar
  • 1,078
5 votes
Accepted

Set custom spatial reference to base map in arcgis javascript api

The spatial reference for a map is defined either by the extent passed to the map constructor or by the first layer added to the map. Checkout the any projection sample to see how to specify different ...
user avatar
5 votes
Accepted

ArcGIS Javascript API AMD require syntax and Dojo ContentPane compatibility

Include the dojo/parser and dojo/domReady! modules. Just like in this example https://developers.arcgis.com/javascript/jssamples/widget_basemap.html domReady will ensure that your DOM is loaded, the ...
user avatar
5 votes
Accepted

Adding image watermark to map via ArcGIS API for JavaScript?

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 ...
user avatar
  • 66
5 votes
Accepted

Esri Javascript API Graphics Removal

You are creating a new empty graphics layer gl but when you then call map.removeLayer(gl) it won't do anything as that new empty layer hasn't been added to the map yet. I'm guessing you wanted to ...
user avatar
  • 456
5 votes
Accepted

ArcGIS JavaScript API won't recognize ArcGIS online material that isn't shared publicly

I think you need to use IdentityManager from the API that allows you to sign in with your arcgis.com account and then receive access to the data. Whatever users from your organization that have ...
user avatar
  • 1,185
5 votes
Accepted

Closing InfoTemplate Programmatically in ArcGIS API for JavaScript?

You'll have to have a reference to the map object in your event handler (do this using scope binding), but once you do you can do: map.infoWindow.hide();
user avatar
  • 2,193
5 votes

Retrieving geoprocessing results in ArcGIS JavaScript API

Here's a copy paste of a sample I use to get a file as output from a gp service to make it available for download. (It grabs text from a user and inserts it into a textfile, then returns the textfile. ...
user avatar
  • 15.2k

Only top scored, non community-wiki answers of a minimum length are eligible