|
POST
|
Sorry, I just saw your message. Probably, there is a better solution for this but for a faster response, you can return after reading one row only. As we know, shapefile geometry should be consistent for all the records on the attribute table. The solution above reads all rows before returning the geometry.
... View more
12-21-2021
10:42 AM
|
0
|
1
|
6889
|
|
POST
|
@Wolf Thank you for your reply but those links are broken on my end. I used @Aashis link and worked fine. I appreciate your help though. https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Geodatabase#geodatabases-and-datastores
... View more
11-08-2021
08:45 AM
|
0
|
1
|
3482
|
|
POST
|
@Aashis Yes, I can. Thanks, I have been looking for this for a long time.
... View more
11-08-2021
08:42 AM
|
0
|
0
|
3483
|
|
POST
|
I need to read a field's values from a Feature Class specifically it is a Feature Class in an enterprise geodatabase. The values will be populated as a Search Box suggestion source. I can do that by creating a FeatureLayer via LayerFactory.Instance.CreateFeatureLayer and using RowCursor using (ArcGIS.Core.Data.Table ProposedBoundariesTable = FLayer.GetTable())
{
using (RowCursor rowCursor = ProposedBoundariesTable.Search())
{
//collect the information
}
} However, in some cases, I want end-users would be able to do make a quick search without creating a Feature Layer or project item. Is there a way to do that in ArcGIS Pro SDK?
... View more
11-08-2021
05:27 AM
|
0
|
5
|
3516
|
|
POST
|
I am creating some tools nested in a Dockpane. I would like to see if I can detect the status of the Dockpane. Whether Dockpane is on and in the main view or not turned on at all and it needs to be turned on via Add-In tab. When a user initiates it, some layers will be added to TOC automatically. However, if it is already on and ready user will load the layers manually via a button maybe. My idea is to give a better experience to end-users. When a user initiates the Dockpane s/he most likely to use those layers however if the Dockpane is on when Pro started it does not mean a user will utilize those layers or the tools within the Dockpane. Please let me know if you have a better/alternative way to handle this type of situation.
... View more
11-03-2021
06:19 AM
|
0
|
2
|
2044
|
|
POST
|
Hi @KenBuja is it possible to access to attribute table with the event? Where can I get the properties of an event? I could not find any resource. I would like to implement an action that opening attribute table but can not do it alert(event.item.layer.isTable) returns false
... View more
09-08-2021
07:10 AM
|
0
|
0
|
1718
|
|
POST
|
I am trying to open an attribute table but I get something else : It tries to create an infinite number of tables. Do you have any idea why that happens? Code: let layerList = new LayerList({
view: view,
container:"sideDiv",
listItemCreatedFunction: defineActions
});
function defineActions(event) {
// The event object contains an item property.
// is is a ListItem referencing the associated layer
// and other properties. You can control the visibility of the
// item, its title, and actions using this object.
var item = event.item;
item.actionsSections = [
[
{
title: "Go to full extent",
className: "esri-icon-zoom-out-fixed",
id: "full-extent"
},
{
title: "Attribute Table",
className: "esri-icon-table",
id: "attribute-table"
},
{
title: "Layer information",
className: "esri-icon-description",
id: "information"
}
],
];
view.when(function() {
layerList.on("trigger-action", function(event) {
// The layer visible in the view at the time of the trigger.
// Capture the action id.
var id = event.action.id;
activeLayer = event.item.layer
if (id === "full-extent") {
// If the full-extent action is triggered then navigate
// to the full extent of the visible layer.
view.goTo(activeLayer.fullExtent);
} else if (id === "attribute-table") {
// If the table action is triggered, then
// open the attribute table
var featureTable = new FeatureTable({
view: view, // make sure to pass in view in order for selection to work
layer: activeLayer,
container: "tableDiv"
});
} else if (id === "information") {
// If the information action is triggered, then
// open the item details page of the service layer.
window.open(activeLayer.url);
};
});
});
}
});
</script>
... View more
09-05-2021
12:07 PM
|
0
|
0
|
1050
|
|
POST
|
I am trying to implement an action that zooms to layer's full entent. Is there a way to access the related layer? I found some info: https://totalapis.github.io/api-reference/esri-widgets-LayerList-ListItem.html but could not implement it. For instance, I am trying to access the layer shown with the arrow mark when actions (3 dots) triggered let layerList = new LayerList({
view: view,
container:"sideDiv",
listItemCreatedFunction: defineActions
});
var item = event.item;
item.actionsSections = [
[
{
title: "Go to full extent",
className: "esri-icon-zoom-out-fixed",
id: "full-extent"
},
],
];
view.when(function() {
layerList.on("trigger-action", function(event) {
// The layer visible in the view at the time of the trigger.
// Capture the action id.
var id = event.action.id;
activeLayer = layerList.layer //this does not work
if (id === "full-extent") {
// If the full-extent action is triggered then navigate
// to the full extent of the visible layer.
view.goTo(activeLayer.fullExtent); //this either
}
}); Thanks
... View more
09-01-2021
12:07 PM
|
0
|
2
|
1800
|
|
POST
|
It would be nice to have pre-set actions for frequently used options such as displaying table, zoom to, renaming a layer etc. Maybe, I find it difficult because I am new to ArcGIS JS API. I found this list which helps me to call icons even though I need to create my own behavior. http://www.narutogis.com/apis/arcgisjs4.10sdk/latest/guide/esri-icon-font/index.html
... View more
08-31-2021
12:07 PM
|
0
|
1
|
2630
|
|
POST
|
Thank you! I was able to add actions. Now, I am trying to customize them. I would like to come something like this Is there a source showing all available action ids/classes. I checked here https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html and some other places but no luck 😞
... View more
08-31-2021
07:29 AM
|
0
|
4
|
2656
|
|
POST
|
I wrote this code: <html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<title>TEST ArcGIS JS </title>
<style>
html,
body {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
#viewDiv {
position: absolute;
right: 0;
left: 40%;
top: 0;
bottom: 0;
}
#sideDiv {
position: absolute;
left:5%;
width: 35%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.20/esri/themes/light/main.css" />
<script src="https://js.arcgis.com/4.20/"></script>
<script>
require(["esri/config","esri/views/MapView", "esri/WebMap", "esri/widgets/LayerList"],
function(esriConfig, MapView, WebMap, LayerList) {
esriConfig.apiKey = "APIKey"
esriConfig.portalUrl = "portalURL"
var webmapids = ["12345"];
var webmaps = webmapids.map(function(webmapid) {
return new WebMap({
portalItem: {
// autocasts as new PortalItem()
id: webmapid
}
});
});
var view = new MapView({
map: webmaps[0],
container: "viewDiv"
});
let layerlist = new LayerList({
view: view,
container:"sideDiv"
});
});
</script>
</head>
<body>
<div id="viewDiv" class="esri-widget"></div>
<div id="sideDiv" class="esri-widget"></div>
</body>
</html> I would like to display layers on a side bar but layer options do not appear. The eye sign is visible and working fine but options not. Do you have any idea what I am doing wrong?
... View more
08-31-2021
06:05 AM
|
0
|
6
|
2685
|
|
POST
|
Awesome! it works now. I tried function setExtent(layer){ view.extent = layer.fullExtent; }; view.then(setExtent(layer)) previously but did not work. Do you know the difference between .then and .when?
... View more
08-17-2021
01:30 PM
|
0
|
0
|
5667
|
|
POST
|
I created a map and a layer. I would like to zoom to the layer's extent as soon as MapView loaded. I found this reference from the API https://totalapis.github.io/api-reference/esri-layers-FeatureLayer.html#fullExtent but could not work it out. Do you have any idea? <html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title> ArcGIS API for JavaScript Tutorials: Add a feature layer</title>
<style>
html, body, #viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.20/esri/themes/light/main.css">
<script src="https://js.arcgis.com/4.20/"></script>
<script>
require([
"esri/config",
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer"
], function(esriConfig,Map,MapView,FeatureLayer)
{
esriConfig.apiKey = "MyAPIKey";
const map = new Map({
basemap: "arcgis-topographic"
});
var view = new MapView({
map: map, // References a Map instance
container: "viewDiv" // References the ID of a DOM element
});
//data needs to be public to access them without authorization
var fl = new FeatureLayer({
url: url });
map.add(fl); // adds the layer to the map
view.extent = fl.fullExtent; //this doesn't work
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
... View more
08-17-2021
01:04 PM
|
0
|
3
|
5676
|
|
POST
|
Hi @GKmieliauskas I don't understand what is going on maybe there is problem with the dataset itself. Thank you for trying this, now I know the issue is not a bug.
... View more
07-26-2021
05:04 AM
|
0
|
0
|
1529
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-23-2021 02:29 PM | |
| 1 | 09-25-2024 03:31 PM | |
| 1 | 02-26-2024 06:48 AM | |
| 1 | 02-11-2020 02:18 PM | |
| 1 | 07-20-2022 08:51 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|