|
POST
|
Hi all, I have one issue on my map, when i add feature layer on map after generated it from expression i goTo result, it works fine, but when i want to zoom in or zoom out or move side, extent updates automatically and returns me back to first generated extent. when i remove TARGET and ZOOM code does not work. how can i stop continuously updating my extent? Thanks. here is code snippet i use to goTo() layer: view.whenLayerView(xaro).then(function(layerView) {
layerView.watch("updating", function(value) {
if (!value) {
layerView
.queryFeatures()
.then(function(results) {
// do something with the resulting graphics
graphics = results.features;
view.goTo({target: graphics, zoom: 15})
});
}
});
});
... View more
02-20-2022
11:49 PM
|
0
|
2
|
1326
|
|
POST
|
Thanks, but it does not work form me. I took another way to solve my issue. Thanks again.
... View more
02-20-2022
11:41 PM
|
0
|
1
|
2045
|
|
POST
|
Hi guys, I have four layers ( names: csvLayer, csvLayer1, csvLayer2, csvLayer3) on my map which have same fields and i have custom html table where i add features selected on map using polygon, but i can add features only from one layer, which is selected in code. In this code i can path one layer, but how can i path all four layers to select features from them? Here is code i use for selecting fatures: let features = [];
let csvLayerView;
csvLayer.when(() => {
view.whenLayerView(csvLayer).then(function (layerView) {
csvLayerView = layerView;
});
})
.catch(errorCallback);
// polygonGraphicsLayer will be used by the sketchviewmodel
// show the polygon being drawn on the view
const polygonGraphicsLayer = new GraphicsLayer();
map.add(polygonGraphicsLayer);
// add the select by rectangle button the view
//view.ui.add("select-by-rectangle", "top-left");
const selectButton = document.getElementById("select-by-rectangle");
// click event for the select by rectangle button
selectButton.addEventListener("click", () => {
view.popup.close();
sketchViewModel.create("polygon");
});
// add the clear selection button the view
//view.ui.add("clear-selection", "top-left");
//document.getElementById("clear-selection").addEventListener("click", () => {
//featureTable.clearSelection();
//featureTable.filterGeometry = null;
//polygonGraphicsLayer.removeAll();
//});
// create a new sketch view model set its layer
const sketchViewModel = new SketchViewModel({
view: view,
layer: polygonGraphicsLayer
});
// Once user is done drawing a rectangle on the map
// use the rectangle to select features on the map and table
sketchViewModel.on("create", async (event) => {
if (event.state === "complete") {
// this polygon will be used to query features that intersect it
const geometries = polygonGraphicsLayer.graphics.map(function(graphic){
return graphic.geometry
});
const queryGeometry = await geometryEngineAsync.union(geometries.toArray());
selectFeatures(queryGeometry);
}
});
// This function is called when user completes drawing a rectangle
// on the map. Use the rectangle to select features in the layer and table
function selectFeatures(geometry) {
if (csvLayerView) {
// create a query and set its geometry parameter to the
// rectangle that was drawn on the view
const query = {
geometry: geometry,
outFields: ["*"]
};
// query graphics from the csv layer view. Geometry set for the query
// can be polygon for point features and only intersecting geometries are returned
csvLayerView.queryFeatures(query)
.then((results) => {
//const raro = [];
if (results.features.length === 0) {
clearSelection();
} else {
// მონიშნული ობიექტებისთვის მონაცემების წამოღება და ცხრილში ასახვა
results.features.forEach((feature)=>{
var tablemili = document.getElementById("tablemili");
newRow = tablemili.insertRow(tablemili.length),
cell1 = newRow.insertCell(0),
cell2 = newRow.insertCell(1),
cell3 = newRow.insertCell(2),
cell4 = newRow.insertCell(3),
cell5 = newRow.insertCell(4),
cell1.innerHTML = feature.attributes["milis_ID"];
cell2.innerHTML = feature.attributes["diametri"];
cell3.innerHTML = feature.attributes["dasaxeleba"];
cell4.innerHTML = feature.attributes["masala"];
cell5.innerHTML = feature.attributes["qselis_kategoria"];
});
polygonGraphicsLayer.removeAll();
}
})
.catch(errorCallback);
}
}
function errorCallback(error) {
console.log("error happened:", error.message);
}
... View more
02-15-2022
02:13 AM
|
0
|
3
|
2097
|
|
POST
|
Hi guys, I have custom menu in my application. I have layer which definition expression should change after i check or uncheck menu check Box: if (document.getElementById("wyaldeni_tbilisi").checked == true) {
csvLayer.definitionExpression = "Pipeline_Subtype = 3";
}
else
{
csvLayer.definitionExpression = "";
}; check works fine, but when i uncheck box nothing happens, definitionExpression stays same. What i do wrong? Thanks in advance
... View more
01-18-2022
04:10 AM
|
0
|
1
|
1221
|
|
POST
|
also check this, might be helpfull for you: https://developers.arcgis.com/javascript/latest/find-length-and-area/
... View more
01-13-2022
10:03 AM
|
1
|
0
|
5768
|
|
POST
|
Hi @Anonymous User You might help this sample https://developers.arcgis.com/javascript/latest/sample-code/highlight-features-by-geometry/
... View more
01-11-2022
01:09 PM
|
1
|
1
|
5833
|
|
POST
|
Hi Guys, @Kishore I want to slecet multiple features using Control key press + mouse left click. I found this sample, but it is little bit complicated, i want simple mouse click with Ctrl Key. Any sample or idea how can i do this? Thanks.
... View more
01-11-2022
05:45 AM
|
0
|
0
|
699
|
|
POST
|
Thanks Kishore, But after i do other features selection, it returns previous selection + current selection, i want to get only current selection 😞
... View more
12-27-2021
05:34 AM
|
0
|
0
|
3313
|
|
POST
|
Hi guys, I am going to use this sample to select features on my map and display attributes in my custom html table, so for the first step i want to show selected results in console.log(). In 269 line i added console.log(results.features.attributes.unit_name) , but it returns undefined. How can i get selected features attributes? Thanks
... View more
12-27-2021
04:50 AM
|
0
|
6
|
3337
|
|
POST
|
Hi Guys, need help. I try add GeoServer wms layer on my webmap. It was working good about few days ago, but now i get error: Access to fetch at 'http://nv1.reestri.gov.ge/geoserver/wms?SERVICE=WMS&REQUEST=GetCapabilities' from origin 'http://10.0.124.10' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. (See PIC) I use standard code to add layer: const registrirebuli_nakvetebi = new WMSLayer({
url: "http://nv1.reestri.gov.ge/geoserver/wms",
title: "xxx",
visible: true,
sublayers: [
{
name: "LR_PARCELS"
}
]
});
map.add(registrirebuli_nakvetebi) How can i handle this? Geoserver is not on my hand, so i can not enable/disable CORS.
... View more
12-17-2021
12:53 AM
|
0
|
4
|
7843
|
|
POST
|
Hi Dan, 1) Question: what did the print statement produce? Answer: Print statement should produce list of database connections i have in TOC. (See pic. please) 2) Question: where in your code did you set your workspace to start the search? Answer: I set workspace at the beginning of my code, after Import arcpy and import os. I might on wrong way and try to achieve wrong result, but i thought this is a right way :(.
... View more
10-29-2021
02:03 AM
|
0
|
0
|
4080
|
|
POST
|
Hi guys, I want to get list of my database connections (see pic.) in Arcpy to display them in my tool dropdown list, i try next code: workspaces = arcpy.ListWorkspaces("*", "SDE")
for workspace in workspaces:
print workspace but it does not give any result. How can i do that? Thank you
... View more
10-29-2021
12:02 AM
|
0
|
5
|
4089
|
|
POST
|
Thank you Tomasz, you save me ❤️ I simply integrated your code in my code and now it works fine. Thanks
... View more
10-27-2021
06:48 AM
|
0
|
0
|
1623
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-22-2022 11:57 PM | |
| 1 | 08-31-2022 12:41 AM | |
| 1 | 08-23-2022 02:49 AM | |
| 1 | 05-10-2022 05:12 AM | |
| 1 | 01-13-2022 10:03 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-13-2025
03:20 AM
|