|
POST
|
This may be a bug in the SDK. One might expect the algorithm to calculate the azimuth first, and then calculate the reverse azimuth off of that value by simply adding or subtracting 180 (depending on whether the calculated azimuth is less than 180 or not, respectively), but that's definitely not the case here, because the SDK is calculating them independently of each other (for the most part). Since it appears the azimuth value is correct, you can just fix the reverseAzimuth value manually after the fact: const bearing = geodesicUtils.geodesicDistance(point1Wgs84, point2Wgs84, "kilometers");
//fix the reverseAzimuth value
bearing.reverseAzimuth = ((bearing.azimuth >= 180) ? bearing.azimuth - 180 : bearing.azimuth + 180);
... View more
12-09-2024
03:54 PM
|
1
|
2
|
731
|
|
POST
|
Yes, the downloads are often available before a link is posted, and a link to 4.31 is here. This can also be determined by opening your developer tools, and examining the requests that take place when downloading a version that is available (like 4.30). The first request retrieves a JSON response with the URL to the actual download, and then a request is made from that URL. All you have to do is change the version numbers of the requests in the URLs (e.g. from 4.30 to 4.31) and paste them into your address bar.
... View more
12-06-2024
09:14 AM
|
0
|
0
|
552
|
|
POST
|
That step is no longer necessary because Dojo was removed beginning with version 4.20. The download package comes with an install.html file that contains the steps necessary for setting the SDK up on your web server.
... View more
12-02-2024
09:37 AM
|
0
|
0
|
456
|
|
POST
|
Instead of: roomUseLayer.setDefinitionExpression = query.objectIds You probably want: roomUseLayer.setDefinitionExpression(roomUserLayer.objectIdField + " IN(" + ids.join(",") + ")");
... View more
11-26-2024
02:20 PM
|
0
|
1
|
1899
|
|
POST
|
I see...yes, this approach will not work with MODE_SELECTION since the graphics array won't be populated unless something is selected, and even then, only the selected features will be present in the graphics array. Based on the info provided, a suitable workaround might be to use a MODE_ONDEMAND layer, with the definition expression set to only show rooms for the current floor. See also getDefinitionExpression and setDefinitionExpression.
... View more
11-26-2024
12:02 PM
|
0
|
3
|
4544
|
|
POST
|
This seems to do it: function manageDynamicSymbology(featureLayer, map) {
if (featureLayer.loaded)
manageDynamicSymbology2(featureLayer, map);
else {
featureLayer.on("load", function() {
manageDynamicSymbology2(featureLayer, map);
});
}
}
function manageDynamicSymbology2(featureLayer, map) {
require(["esri/renderers/jsonUtils", "esri/symbols/jsonUtils"], function(rendererJsonUtils, symbolJsonUtils) {
var originalRenderer = featureLayer.renderer;
featureLayer.on("update-end", function() {
var infos = [];
featureLayer.graphics.forEach(function(graphic) {
if (map.extent.intersects(graphic.geometry)) {
var info = originalRenderer.getUniqueValueInfo(graphic);
if (info)
infos.push(info);
}
});
var uniqueValueInfos = [];
var defaultSymbol = null;
var defaultLabel = null;
infos.forEach(function(uniqueValueInfo) {
if (!uniqueValueInfo) {
if ((defaultSymbol === null) && (originalRenderer.defaultSymbol)) {
defaultSymbol = symbolJsonUtils.fromJson(originalRenderer.defaultSymbol.toJson());
defaultLabel = originalRenderer.defaultLabel;
}
} else if (!uniqueValueInfos.includes(uniqueValueInfo))
uniqueValueInfos.push(uniqueValueInfo);
});
var newRenderer = rendererJsonUtils.fromJson(featureLayer.renderer.toJson());
newRenderer.infos = uniqueValueInfos.sort(function(a, b) {return originalRenderer.infos.indexOf(a) - originalRenderer.infos.indexOf(b);});
newRenderer.defaultSymbol = defaultSymbol;
newRenderer.defaultLabel = defaultLabel;
featureLayer.setRenderer(newRenderer);
});
});
}
... View more
11-26-2024
09:39 AM
|
0
|
5
|
2664
|
|
POST
|
I ran into this today, and solved the problem by using UNION ALL instead of UNION, because I didn't have to worry about duplicate records, which was an impossible situation in this case. At a high level, the problem occurred because a record had a SHAPE value of NULL.
... View more
11-21-2024
02:58 PM
|
0
|
0
|
430
|
|
POST
|
According to the documentation for layerInfos, addEnabled, updateEnabled, and deleteEnabled are properties of the LayerInfo objects, not the Editor itself: const editor = new Editor({
view: view,
layerInfos: [
layer: editConfigPolyLayer,
addEnabled: false,
updateEnabled: false,
deleteEnabled: true
]
});
... View more
11-21-2024
10:10 AM
|
0
|
0
|
510
|
|
POST
|
I thought you were asking specifically about the replacement for dojo's Deferred module. To migrate the whole function, you'll also need to update the use of FeatureLayer and Graphic for compatibility with 4.x: function _applyAdds (featureLayer, propertiesArr)
{
return new Promise(function(resolve, reject) {
require (['esri/Graphic'], function (Graphic)
{
var graphicsArr = [];
propertiesArr.forEach (function (properties)
{
graphicsArr.push (new Graphic ({attributes:properties}));
});
featureLayer.applyEdits({addFeatures:graphicsArr}).then(
function (results)
{
console.log (results);
resolve();
}, // callback
function (error)
{
console.log ('ERROR!', error);
reject(error);
}// errorback
);
});
});
}
... View more
11-20-2024
02:44 PM
|
2
|
17
|
1669
|
|
POST
|
You should use the native Promise object instead. Here is what the above code would look like using it: function _applyAdds (featureLayer, propertiesArr)
{
return new Promise(function(resolve, reject) {
require (['esri/graphic'], function (Graphic)
{
var graphicsArr = [];
propertiesArr.forEach (function (properties)
{
graphicsArr.push (new Graphic (null, null, properties));
});
featureLayer.applyEdits (
graphicsArr, null, null,
function (a, u, d)
{
console.log (a, u, d);
resolve();
}, // callback
function (error)
{
console.log ('ERROR!', error);
reject(error);
}// errorback
);
});
});
}
... View more
11-20-2024
10:11 AM
|
1
|
19
|
1682
|
|
POST
|
Ok...yeah, I was mistaken about what you meant by uid. In that case, your use of "setAttribute" is correct. However, it's not recommended to use the "_items" array since it's undocumented, and the layer probably wouldn't notice that anything had changed if you manipulate it. If you change a graphic's properties and/or attributes, you may want to call remove on the collection, and then add it back. This would properly inform the layer instance that something has changed. If you use this alternate workflow, and it still doesn't work, then it's possible it could be a React issue. I don't use that though, so I couldn't say for certain.
... View more
11-18-2024
03:45 PM
|
0
|
0
|
737
|
|
POST
|
The uid property of a Graphic is set when it is instantiated, and cannot be changed afterwards. If for some reason you need a graphic with a different uid, but the same info, you should use clone. There is no method for setting the visible property, but no method is necessary. Just set the property value instead: graphic.visible = false;
... View more
11-18-2024
02:41 PM
|
0
|
2
|
743
|
|
POST
|
I believe that if you replace line 43 with this, it will maintain their original order: newRenderer.uniqueValueInfos = uniqueValueInfos.sort(function(a, b) {return originalRenderer.uniqueValueInfos.indexOf(a) - originalRenderer.uniqueValueInfos.indexOf(b);}); Otherwise, you can implement the sort function according to how you want.
... View more
11-18-2024
09:31 AM
|
1
|
1
|
2731
|
|
POST
|
You could use something like this, which appears to do the trick. Basically, after every time the layer redraws, a new renderer is created with only the symbology visible in the view, and then assigned to the layer. Just pass in references to your featureLayer and view and it does the rest: function manageDynamicSymbology(featureLayer, view) {
featureLayer.when(function() {
view.whenLayerView(featureLayer).then(function(layerView) {
var originalRenderer = featureLayer.renderer;
var ignoreRendererSet = false;
layerView.watch("updating", function(newValue, oldValue, propertyName, target) {
if ((!newValue) && (oldValue)) {
if (ignoreRendererSet)
ignoreRendererSet = false;
else {
ignoreRendererSet = true;
var query = layerView.createQuery();
query.geometry = view.extent;
layerView.queryFeatures(query).then(function(featureSet) {
if (featureSet.features.length === 0)
featureLayer.renderer = originalRenderer;
else {
var promises = [];
featureSet.features.forEach(function(feature) {
promises.push(originalRenderer.getUniqueValueInfo(feature));
});
Promise.all(promises).then(function(infos) {
var uniqueValueInfos = [];
var defaultSymbol = null;
var defaultLabel = null;
infos.forEach(function(uniqueValueInfo) {
if (!uniqueValueInfo) {
if (defaultSymbol === null) {
defaultSymbol = originalRenderer.defaultSymbol.clone();
defaultLabel = originalRenderer.defaultLabel;
}
} else if (!uniqueValueInfos.includes(uniqueValueInfo))
uniqueValueInfos.push(uniqueValueInfo);
});
var newRenderer = featureLayer.renderer.clone();
newRenderer.uniqueValueInfos = uniqueValueInfos;
newRenderer.defaultSymbol = defaultSymbol;
newRenderer.defaultLabel = defaultLabel;
featureLayer.renderer = newRenderer;
});
}
}, function(e) {
featureLayer.renderer = originalRenderer;
});
}
}
});
});
});
}
... View more
11-15-2024
04:25 PM
|
1
|
16
|
2789
|
|
POST
|
Actually, cancel that previous message; looks like you can still download it here.
... View more
11-06-2024
02:13 PM
|
1
|
0
|
506
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-09-2025 09:35 AM | |
| 2 | 12-09-2025 09:06 AM | |
| 1 | 11-26-2025 12:29 PM | |
| 3 | 11-26-2025 09:11 AM | |
| 1 | 10-02-2025 01:14 PM |