Questions tagged [arcgis-javascript-api-4]

For when 4.x is version of ArcGIS API for JavaScript that you are using

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Creating Polygon Feature using ArcGIS API for JavaScript

I am trying to use ArcGIS API for JavaScript Sandbox this sample to add polygon feature, i also use codes taking from here https://community.esri.com/thread/224031-how-to-create-a-polygon-js-api-49?...
0
votes
1answer
20 views

Update z-index of new graphic layer

I am creating/drawing a new polyline successfully; the only problem is it's going under my other graphic layers. Is there any ability to set the z-index of this to bring it above the over layers? I ...
0
votes
0answers
12 views

Making two Featurelayers in bookmarks and legend separately in ArcGIS API for JavaScript [closed]

I am using ArcGIS API for JavaScript 4.14. I have two Featurelayers: Polygon and points. I want to make bookmarks by the polygon's one so that view can zoom by select marks, the point's one to make ...
1
vote
0answers
9 views

Calculating distance from point to feature returned from layer query using ArcGIS API for JavaScript

I have a project where a user clicks on a map and I filter to show all features from a layer that are within a certain distance of the point clicked. That part of things works fine. What is not ...
1
vote
1answer
33 views

get a PolyLine path to go to center of screen

I am trying to draw a polyLine to the center of the screen (as the second path, point B) ... I tried referencing the below to get center: any pointers? coordinatesBx = map.extent.getCenter()....
0
votes
0answers
32 views

How can I get map coords (lat and long) on click [closed]

I am just trying to set a click function, when the map is clicked, anywhere on the map, and return simple lat and long values of where said click function occurred. Below is what I am trying: ...
-2
votes
1answer
29 views

Reading local GeoJSON file using ArcGIS API for JavaScript

I am using ArcGIS API for JavaScript 4.14. I change the "url" which only receive the "http"-start str to "data",but it didn't work. const geojsonLayer = new GeoJSONLayer({ data: "js/...
1
vote
1answer
22 views

Uncaught (in promise) TypeError: GraphicsLayer is not a constructor

import Map from "esri/Map"; import MapView from "esri/views/MapView"; import Graphic from "esri/Graphic"; import GraphicsLayer from "esri/layers/GraphicsLayer"; import webMercatorUtils from "esri/...
0
votes
1answer
16 views

Specific div elem for click event within view.when/view.on

view.when(function(){ view.on("click", function () { doSomething = !doSomething;}); }); The above works as a global click event. HOWEVER, I am trying to specify a specific div elem not a ...
1
vote
0answers
15 views

Creating left split for MapView Container with ArcGIS API for JavaScript

I want my webmap to look something like this: https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=layout_MapContainerSplitLeft However, rather than the map being on the right of ...
1
vote
1answer
129 views

Proper Way to Load WMSLayer in ArcGIS JSAPI 4.12

I'm getting #load() Failed to load layer TypeError: Cannot read property 'indexOf' of undefined error when I tried to load WMSLayer in my application. I've tried several different WMS service URLs ...
1
vote
0answers
45 views

Can Elevation Layers in WCS be Combined?

Some weeks ago, I began an effort at my company that required me to delve into the world of GIS. I've learned a lot since then, but there is one thing I'm not entirely clear on: is there is a way to ...
1
vote
2answers
26 views

How to symbolize points using a numbering system

Using the ArcGIS Server JavaScript API version 4, is it possible to symbolize points using a numbering system (1-n) as in this mockup? A simple marker symbol or picture marker symbol can be used to ...
1
vote
1answer
32 views

How to use ArcGIS Server JavaScript API inside a <form> tag?

I need to embed an ArcGIS Server JavaScript API (version 4) map in a client's Content Management System. For reasons unknown to me, the CMS developers said this results in the map's entire DOM being ...
0
votes
0answers
14 views

Error: TypeError: Cannot redefine property: geolocation - tracking ArcGIS JavaScript

I am implementing a tracking using esri/widgets/Track (https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html) and I want to create a new track after destroying the ...
0
votes
0answers
13 views

How to draw a geo tour by dynamic data in arcgis javascript 4.12

I am trying to draw a route of selected data and track the route using arcgis javascript 4.12 API This is a sample requirement, but it draws a static route, i am looking for a dynamic solution. https:...
1
vote
1answer
16 views

Getting maximum and minimum latitude and longitude of view

How can I retrieve the maximum and minimum latitude and longitude of the current view using the arcGIS javascript API (4.x)? I can get the center lat and lon by using: MapView.center.latitude and ...
1
vote
0answers
14 views

Finding all points from a csvLayer within a circle with ArcGIS JavaScript

I am new to GIS and I am trying to develop a webpage using the ArcGIS JavaScript API. I am currently trying to figure out how to select all of the points from a CSV that are within a circle. I have ...
1
vote
0answers
20 views

Configurable Map Viewer Basemaps in Dropdown With Different Projections

I am trying to allow the user to select a series of aerial basemaps from the dropdown menu on the CMV map. The aerials however are in a different projections than the default basemap, i.e., satellite, ...
1
vote
1answer
35 views

Using the Sketch Widget for ArcGIS JavaScript API, can you manually toggle between the reshape and transform?

I am using the sketch widget for ArcGIS JavaScript: https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html I am building a custom toolbar with additional tools and ...
-1
votes
2answers
44 views

Manually triggering delete using Sketch Widget for ArcGIS JavaScript API

I am using the sketch widget for ArcGIS JavaScript: https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html There is a "delete" button after you have selected one or ...
1
vote
1answer
36 views

Getting SearchWidget result to JavaScript variable?

I'm using the following searchWidget and it works fine, I need to know how can I get location details, once I type something and hit enter. Lets I search for New York and hit enter, then search data ...
0
votes
1answer
66 views

Using requirejs with ArcGIS API for JavaScript v 4 API from CDN?

ArcGIS API for JavaScript Quick Start guides show "all-in-a-single-html" approach which is good for examples. However how about bigger apps? I added comment on older issue (closed) at https://github....
0
votes
1answer
47 views

Returning a promise from a function in ArcGIS API JavaScript version 4.x

How would I return a promise from a queryTask from a function in ArcGIS API version 4.x? function getPromise() { require(["esri/tasks/support/Query", "esri/tasks/QueryTask"], function (Query, ...
0
votes
0answers
14 views

Doing a query on results from a previous query in ArcGIS API JavaScript version 4.x

How would you perform a query on results from a previous query? queryTask.execute(query).then(function(results)) { // perform another spatial query using another layer on the results } I can ...
1
vote
2answers
83 views

ESRI JS API multiple groupByFieldsForStatistics columns and having clause

I'm trying to query some data using ESRI JS API version 4.0. The data table that looks like a longer version of this: +-------------------------------------+ | Object_ID | Item_ty_co | Serv_grade | +-...
0
votes
1answer
43 views

Authenticating using only token in ArcGIS API for JavaScript?

I am trying to embed a web map from ou ArcGIS Online on our corporate web app. I implemented a server-side token generator, since our app users do not have (and should not have) an ArcGIS Online ...
1
vote
1answer
62 views

Controlling position of popup's actions?

Using the ArcGIS Server JavaScript API v4.12, how can I control the position of the popup's Actions pane? To illustrate, see the sample at https://developers.arcgis.com/javascript/latest/sample-code/...
0
votes
2answers
103 views

Map contents don't print when using CSS media print queries in a Bootstrap modal

My goal is to show an ArcGIS Server JavaScript v4 map in a Bootstrap modal popup (displayed over a page containing other content), and to print only the contents of the Bootstrap modal popup. I'm ...
2
votes
1answer
28 views

View on update event listener in the ArcGIS API for JavaScript 4.x

In the ArcGIS API for JavaScript version 3.x, there is a an event listener for ArcGISDynamicMapServiceLayer. In version 4.x of the API, I found that the MapImageLayer is almost the same as the ...
0
votes
2answers
54 views

Using ColorPicker in ArcGIS JavaScript API 4.12?

I can only find ColorPicker in ArcGIS JavaScript API 3.X, but I'm working on a project using 4.12. I'm trying to implement ColorPicker to my map to let users to choose colors for Sketch objects. I'...
0
votes
0answers
40 views

ArcGIS JS API 4.11, 4.12 Incorrect work GraphicsView2D (from esri/views/2d/layers/grapics/GraphicsView2D) hitTest method

ArcGIS JS API 4.11, 4.12 GraphicsView2D (from esri/views/2d/layers/grapics/GraphicsView2D) hitTest method return only one feature (graphic) with zero index. Better to be return all graphics. Is it ...
0
votes
0answers
35 views

ArcGIS map with basemap toggle and simplemarker pointer

I am using ArcGIS map which gives me an error: Below is my function which i am using to implementing the map on my application: function handlerForVariableB (latt, longt, complaintid) { // ...
0
votes
0answers
88 views

ArcGIS geometryEngine.intersect always returns null

I am using the ArcGIS JavaScript API with the geometryEngine.intersect() method but I cannot get it to work on feature layers. In my code you can see how I can create and intersect 2 square ...
0
votes
0answers
67 views

Adding 3x4 table in popup template using ArcGIS API for JavaScript 4?

I'm building an arcgis application rendering a csvLayer. I've added a popup template like so: var template = { title: "{SensorTitle}", content: [ { ...
2
votes
1answer
37 views

ESRI Directions widget version 4. Adding Stops?

Is there a way to add stops programatically to the latest Directions widget, or must I use the widget GUI? (I see that it is still 'beta') Version 3 of the JS API has this function: Version 3 add ...
0
votes
0answers
171 views

ArcGIS API 4.11 JavaScript Feature Table Alternative

I cannot find a simple/basic example online of adding a feature table to the bottom of a map in ArcGIS API 4.11 from a Feature layer (using JavaScript). So the functionality would allow you to click ...
0
votes
0answers
19 views

ArcGIS API not visible FeatureLayer

function myFunc (){ if ((document.getElementById('MP').checked)&(document.getElementById('wom').checked)&(document.getElementById('child').checked)) { ...
0
votes
1answer
29 views

How to implement search in a graphics layer?

There is a method that accepts JSON data. Based on this data, points are created and added to the graphics layer. How to implement search in a graphics layer? I found an example of how to implement ...
0
votes
1answer
27 views

Have GraphicsLayer working but now need to put it in or convert to FeatureLayer (JavaScript)

I have a GraphicsLayer working for "Regions" and the corresponding popup template information for the staff within each region (below). function fillRegionMarkers() { // Create ...
0
votes
0answers
33 views

WMTSLayers seems not working in EPSG:25830

WMTSLayer in Javascript API 4.11 seems not work when spatialReference EPSG:25830 is selected. The problem is that the request is generating by the API is incorrect, Tilerow parameter is wrong. The ...
1
vote
1answer
67 views

SNAPSHOT mode of Feature Layer in ArcGIS JavaScript API 4.x

Is there any posibility to set Feature Layer in "SNAPSHOT mode", as it was in ArcGIS JS API 3.x? The main goal is to fetch features once to the client and avoid additional queries at each map pan/zoom ...
3
votes
1answer
362 views

Emitting map click using ArcGIS API for JavaScript?

I am trying to emit a map click from the MapView object using its emit method. I have successfully done this in the 3x API from the Map object. This same method, however, is not working for me in the ...
0
votes
1answer
700 views

ArcGIS JS API Failed to load feature layer

I want to add test feature on my ArcGIS map using feature layer. I create layer using Graphic as a source. After a lot of googling I create my point the following way: require([ "esri/Map", "esri/...
0
votes
1answer
232 views

ArcGIS JS API SimpleMarkerSymbol is not a subclass of Layer

I have polar ArcGIS map and want to display my own data on it. I will get data using AJAX REST queries to my server. As I understand, it isn't commonly used way to get data in ArcGIS, but presenting ...
1
vote
1answer
168 views

Disable wheel scroll zooming with ArcGIS Javascript API 4.11

I want to disable wheel scroll zooming so the viewer can scroll down the page without losing the cursor in the map. But this code freezes scrolling altogether, so when the cursor is over the map, ...
0
votes
0answers
58 views

Submitting GP service fail

I want to download the feature layer which I input as a string parameter to my GP service. When I run the script I got the following errors. First time when I run it: job-submitted gp_service_run2....
0
votes
1answer
88 views

Getting Search Widget response's lat long in ArcGIS API for Javascript 4.x?

How would I retrieve the lat/long of the city/location selected using the Search Widget? I do not need to display this location on a map. All examples I have so far come across attach the Widget to ...
0
votes
0answers
23 views

Referencing active widgets in ArcGIS API V4.x

How can I reference an active widgets in a view (map or scene) in ArcGIS JavaScript version 4.x Version 3.x widgets were dojo-widgets (mostly) so using "dojo/Registry" Registry.byId("widgetId") ...
0
votes
1answer
124 views

Get GeoJSON or simple WKT from a GPFeatureRecordSetLayer ArcGIS js API

Is it possible to get the GeoJson representation of a GPFeatureRecordSetLayer that is returned from GPServer task? I am able to draw the feature on the map (using the ArcGIS js API) with code like ...