|
POST
|
Please use the code formatting option that will improve the readability of large code blocks like this. Code formatting ... the Community Version - Esri Community var highlightHandle1 = null;
var highlightHandle2 = null;
var view = new SceneView({
container: "viewDiv",
map: webscene,
});
function buildingColor1() {
webscene.load().then(function () {
var officeSceneLayer = webscene.allLayers.filter(function (elem) {
return elem.title === "office layer";
}).items[0];
// Highlight is set on the layerView, so we need to detect when the layerView is ready
view.whenLayerView(officeSceneLayer).then(function (officeLayerView) {
const query = officeLayerView.createQuery();
officeLayerView.queryObjectIds(query).then(highlightBuildings1);
console.log("checking1");
function highlightBuildings1(objectIds) {
console.log("checking2");
officeLayerView.view.highlightOptions.color = "red";
highlightHandle1 = officeLayerView.highlight(objectIds);
}
});
})
}
function buildingColor2() {
webscene.load().then(function () {
var residentialSceneLayer = webscene.allLayers.filter(function (elem) {
return elem.title === "residential layer";
}).items[0];
// Highlight is set on the layerView, so we need to detect when the layerView is ready
view.whenLayerView(residentialSceneLayer).then(function (residentialLayerView) {
const query = residentialLayerView.createQuery();
residentialLayerView.queryObjectIds(query).then(highlightBuildings2);
function highlightBuildings2(objectIds) {
residentialLayerView.view.highlightOptions.color = "blue";
highlightHandle2 = officeLayerView.highlight(objectIds);
}
});
})
}
buildingColor1();
buildingColor2();
... View more
03-03-2021
06:50 AM
|
0
|
3
|
5082
|
|
POST
|
Please post your require statement parameters and function declaration. It should look like this (with your other requires listed as well). require(["esri/core/watchUtils"], function(watchUtils) {
/* code goes here */
});
... View more
02-24-2021
06:09 AM
|
0
|
0
|
2044
|
|
POST
|
It would be helpful to mention any error messages you are receiving. If there are no errors, then what is the incorrect behavior you're seeing?
... View more
02-23-2021
01:33 PM
|
2
|
0
|
5358
|
|
POST
|
Is that database connection registered with the Data Store on Server? Register your data with ArcGIS Server using Server Manager—ArcGIS Server | Documentation for ArcGIS Enterprise
... View more
02-23-2021
08:46 AM
|
1
|
1
|
1331
|
|
POST
|
This is correct. You'll need to add a parameter to your script tool that will present this input to the user in the geoprocessing tool window. If you specify the parameter data type as Boolean, it should show up as a simple check box.
... View more
02-22-2021
12:40 PM
|
2
|
0
|
2321
|
|
POST
|
Sorry if my original message was not clear enough. Here's an outline of what you need to code. Create toolbar html element (probably div) with input text elements to accept the X and Y values and buttons. Get the value entered into the text elements when the zoom button is clicked. Validate the input X,Y values and handle exceptions. Create a point geometry object, specifying the coordinates as appropriate to the spatial reference. Create a marker symbol for drawing the point. Create a graphic and add the geometry and symbol to it. Add the graphic to the view's graphics layer. The "Intro to Graphics" sample app demonstrates code for steps 4 - 7.
... View more
02-17-2021
02:18 PM
|
0
|
0
|
1949
|
|
POST
|
Just a couple small notes on ListFeatureClasses(). It returns the feature class names as strings in a list so you don't need to Describe() them. You can also exclude the wild_card parameter as the default will return everything.
... View more
02-17-2021
06:19 AM
|
1
|
0
|
5365
|
|
POST
|
You'll need to combine the sketch widget with buffer.
... View more
02-17-2021
06:10 AM
|
0
|
0
|
3198
|
|
POST
|
This would just be creating a graphic on the map at the specified coordinate. Check out the Intro to graphics sample app and follow what is done for the point graphic. Instead of hard coding the longitude, latitude of the point, populate those values from the input boxes shown in your screenshot. EDIT: You should also check out the sketch widget in case that is a better fit for your app.
... View more
02-17-2021
06:03 AM
|
1
|
0
|
1963
|
|
BLOG
|
02-12-2021
12:07 PM
|
1
|
0
|
5466
|
|
POST
|
Check out the hitTest() method of MapView. I think you can use it to do what you need. Here's a sample app with pointer-move event.
... View more
02-11-2021
10:50 AM
|
2
|
0
|
2419
|
|
POST
|
Please mention any error messages or results that the script is currently producing.
... View more
02-11-2021
06:08 AM
|
1
|
1
|
3636
|
|
POST
|
You'll need to use copy and delete to perform a "move" operation like you describe. If the two datasets have different coordinate systems, you'll first need to project the data.
... View more
02-10-2021
02:23 PM
|
2
|
0
|
5555
|
|
POST
|
The where_clause parameter is only that, the where clause portion of a full select statement. The fields and the table are implied with the other parameters. It looks like your intention is to select everything? Try this trick instead: query = "1=1" If you do intend to select something specific (instead of all records), just use the where clause, like: query = "someNameField = 'example' or someNumberField > 0"
... View more
02-05-2021
07:24 AM
|
3
|
0
|
7920
|
|
POST
|
Here's the basic format for using geodesicDistance() var firstPoint = new Point({
longitude: -111.022887,
latitude: 35.02741
});
var otherPoint = new Point({
longitude: -111.122887,
latitude: 35.12741
});
var distanceUnits = "kilometers";
var distanceResult = geodesicUtils.geodesicDistance(firstPoint, otherPoint, distanceUnits);
console.log(distanceResult.distance, distanceUnits); Again though, make sure you require "esri/geometry/support/geodesicUtils" and include geodesicUtils in the function parameters. EDIT: Sorry, forgot you'll also need to require "esri/geometry/Point" and include Point in the function parameters for this particular example. Here's a sample app. <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<title>Intro to MapView - Create a 2D map | Sample | ArcGIS API for JavaScript 4.18</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.18/esri/themes/light/main.css" />
<script src="https://js.arcgis.com/4.18/"></script>
<script>
require(["esri/Map", "esri/views/MapView", "esri/geometry/Point", "esri/geometry/support/geodesicUtils"],
function(Map, MapView, Point, geodesicUtils) {
// Set up basic map
var map = new Map({
basemap: "topo-vector"
});
var view = new MapView({
container: "viewDiv",
map: map,
zoom: 4,
center: [-111, 35] // longitude, latitude
});
// Define points for measurement
var firstPoint = new Point({
longitude: -111.022887,
latitude: 35.02741
});
var otherPoint = new Point({
longitude: -111.122887,
latitude: 35.12741
});
// Measure distance and output result to console log
var distanceUnits = "kilometers";
var distanceResult = geodesicUtils.geodesicDistance(firstPoint, otherPoint, distanceUnits);
console.log(distanceResult.distance, distanceUnits);
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
... View more
02-04-2021
12:15 PM
|
1
|
1
|
6284
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 1 | 10-23-2025 03:53 PM | |
| 1 | 04-28-2026 07:25 AM | |
| 1 | 03-19-2026 08:59 AM | |
| 1 | 02-12-2026 01:37 PM |