|
POST
|
Hello all. I want to place programmatically a div on the screen and I need its top left corner to be at a certain coordinate location (Lat/Long). How do I calculate the div's left and top property (in px) based on the lat/long? So, what I am looking for is convert lat/long to px, so I can set the div's left and top position. I tried this but didn't work. div's id is "box" const screenPoint = view.toScreen(point);
document.getElementById('box').style.position = "absolute"
document.getElementById('box').style.left = screenPoint.x +"px"
document.getElementById('box').style.top = screenPoint.y+"px" Thank you.
... View more
08-17-2023
03:52 PM
|
0
|
5
|
3238
|
|
POST
|
Thank you. I will change my script to use combobox. Currently, I don't see any advantages for using dropdown over combobox.
... View more
08-15-2023
08:27 AM
|
0
|
0
|
1337
|
|
POST
|
I have a group of dropdown. Only one item can be selected from all groups.However, I cannot display a single selection since clicking on a different group it will display the selection for that group. So, to remove it, I have to use selection-mode= none. However, by doing so, I cannot get the selected innerText. Is there a way to allow the display of only one selection from all groups? if not, how can I get the selecteditem if I use selection-mode="none"? I also experiment with using selection-mode="single" and place it at the calcite-dropdown to cover both groups. However, it seems that after selecting few times, it records the selection from one group only. Thank you. Codepen @KittyHurley
... View more
08-11-2023
12:15 PM
|
0
|
2
|
1432
|
|
POST
|
In JS API 3.x we could get easily the scale for a box drawn on the map after you define its 4 corners. In the matrix for the migration from 3.x to 4.x, it states that there are no plans for the scaleUtils to be migrated. So, what's the best option to get the scale in 4.x? var scale = esri.geometry.scaleUtils.getScaleForBox(
box,
map.getSpatialReference()
);
... View more
08-02-2023
03:14 PM
|
0
|
1
|
1081
|
|
POST
|
Thank you @LaurenBoyd . It would be helpful for the developers if a note was posted at the printtask page that says "Printtask is deprecated since version 4.24"
... View more
08-01-2023
11:56 AM
|
0
|
1
|
1600
|
|
POST
|
I use a reference to printtask https://totalapis.github.io/api-reference/esri-tasks-PrintTask.html but a console.log gives errors: When I access directly the printask script at: https://js.arcgis.com/4.27/esri/tasks/PrintTask.js I get this:
... View more
08-01-2023
11:35 AM
|
3
|
3
|
1619
|
|
POST
|
Thank you for the response. Does the print plus work with JS 4.x ?
... View more
07-21-2023
02:55 PM
|
0
|
0
|
828
|
|
POST
|
I have two shell panels for each side of the app. I'd like to use the end panel with an adjustable height. So the script is like this: <calcite-shell content-behind>
<calcite-shell-panel slot="panel-start" collapsed id="shell-panel-start" position="start" width-scale="l" display-mode="dock">
----
-----
</calcite-shell-panel>
<calcite-shell-panel slot="panel-end" position="end" resizable width-scale="l" display-mode="float">
<div style="height:500px"><p>THis is a test</p></div>
</calcite-shell-panel>
</calcite-shell> https://codepen.io/lkoumis1/pen/BaGJeaK In addition, I'd like to use the the features widget and see the popup in the start panel without overlapping the map. Thanks to @KittyHurley I was informed to see the popup without overlapping the map, I will need to remove the content-behind from the calcite-shell. However, when I remove content-behind, the end panel height changes to 100% even though it is set to display-mode to "float" Suggestions? @KittyHurley @BenElan
... View more
07-21-2023
09:26 AM
|
0
|
1
|
1605
|
|
POST
|
I posted the question of how to use the features widget with a feature layer (fL) added to the map (link ) and @LaurenBoyd responded that you have to define the fL's popupTemplate before you can fetch the features. That was the correct response. However, in my case I have hundreds of layers that can be added to the map as the discretion of the user, therefore I'd like to use a default popup display for all layers. Prior version 4.12, you could simply use popupTemplate: {
title: "Title",
content: "*"
} to define the popuptemplate. Since then, ESRI stated that: "As of version 4.12, content can no longer be set using a wildcard, e.g. *. Instead, set the Popup's defaultPopupTemplateEnabled property to true." To use the defaultPopupTemplateEnabled you must first set the view.popup.popupEnabled = true However, to use the features widget, you must set the above property to false. So, to display all attributes of a fL in a popup I wrote this script (see below) to get all the fields of the feature layer and set the popuptemplate with those fields. It works but the format of the display is not satisfactory. See this codepen link and click on a feature to see the popup display. I'd love to get the table style format to display the results. Any ideas? reactiveUtils.on(
() => view,
"click",
(event) => {
featuresWidget.open({
location: event.mapPoint,
fetchFeatures: true
});
view.map.layers.map(function (lyr) {
if (lyr.type === "feature"){
let content =""
console.log(lyr.fields)
console.log(lyr)
lyr.fields.forEach((field) => {
let alias = field.alias
let name = field.name
content += "<p>" + alias + ":{" + name + "}</p><br>"
})
console.log(content)
var popupTemplate = { // autocasts as new PopupTemplate()
title: lyr.title,
content: content
};
lyr.popupTemplate = popupTemplate;
}
})
}
);
... View more
07-12-2023
02:01 PM
|
0
|
1
|
1267
|
|
POST
|
I am trying to use the new Features widget to have the popup info posted on the side panel. There is an example at https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-features that it uses a featurelayer from the portal. Below, I modified the above example by removing the webmap and added a feature layer. But I can't see the popup info if you click on a feature. What am I missing? Thank you. https://codepen.io/lkoumis1/pen/BaGwrde?editors=1000
... View more
07-06-2023
05:14 PM
|
0
|
1
|
1093
|
|
POST
|
Sorry it was a Friday and not thinking right. Didn't realized that I had the content-behind on the calcite-shell tag.
... View more
07-05-2023
05:56 PM
|
0
|
0
|
1326
|
|
POST
|
The example for the features widget shows how the widget can be placed outside of the view inside the shell panel. https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Features.html I don't understand why it is out of the view. If I place a shell panel on the end, it overlays the map. https://codepen.io/lkoumis1/pen/MWzmGmx Why? Am I missing something? @LaurenBoyd @KittyHurley
... View more
06-30-2023
06:16 PM
|
0
|
2
|
1408
|
|
POST
|
I created a widget to duplicate the functionalities of the filtering of the AT in WAB. This is the main core of the widget. For the selected layer, I have a dropdown listing all fields and another dropdown for all values of the selected field where the user can create their SQLwhere statement. I hope it helps. const getQuery = async (SQLwhere) => {
let thelayer = theselectedlayer;
let query = thelayer.createQuery();
query.where = SQLwhere;
let thevalues = [];
// query.orderByFields = selectedField;
query.outFields = ["*"];
query.returnDistinctValues = false;
query.returnGeometry = true;
thelayer
.queryFeatures(query)
.then((results) => {
console.log(results);
if (results.features.length === 0) {
document.getElementById("Message_html").innerHTML =
"Query returned no features.";
return;
}
if (featureTable) {
featureTable.selectRows(results.features);
}
... View more
06-26-2023
09:20 AM
|
1
|
0
|
1464
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-19-2025 10:13 PM | |
| 3 | 02-06-2026 10:44 AM | |
| 1 | 01-08-2026 12:50 PM | |
| 1 | 01-05-2026 01:35 PM | |
| 1 | 12-30-2025 10:18 AM |
| Online Status |
Online
|
| Date Last Visited |
yesterday
|