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 ...
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 ...
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 ...
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....
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 ...
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',
'...
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'...
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 ...
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/...
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
}
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 ...
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....
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 ...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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(...
5
votes
Accepted
Changing the cursor on an ESRI map
You can use
map.setMapCursor("url(custom.cur),auto")
Here is the api reference
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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();
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. ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
arcgis-javascript-api × 2005arcgis-server × 452
javascript × 319
dojo × 141
feature-layer × 116
arcgis-online × 83
arcgis-10.1 × 68
arcgis-javascript-api-4 × 59
printing × 58
popup × 52
arcgis-10.2 × 48
configurable-map-viewer × 47
arcgis-web-appbuilder × 45
web-mapping × 43
coordinate-system × 42
legend × 37
arcgis-10.0 × 35
geoprocessing-service × 33
arcgis-online-basemaps × 31
editing × 28
proxy × 28
symbology × 27
arcgis-rest-api × 27
arcgis-desktop × 26
wms × 26