|
POST
|
Is there a way to change the default size of a rectangle sketch single click? The size seems to be determined by the scale you are currently viewing the map at, the more you zoom in the smaller the single click rectangle is. For now I will default to freehand mode but, if possible, it would be nice to be able to change the size and behavior of a single click.
... View more
02-27-2024
09:04 AM
|
0
|
0
|
551
|
|
POST
|
I am trying to update some code, getting rid of deprecated items. I am trying to change my feature table selections from selectRows() to highlightIds.add(), but I am having trouble. I am guessing I am needing to add some more lines of code getting graphics first? Any help will be appreciated. https://codepen.io/mbdriscoll/pen/GReBgYd?editors=1000 parcelLayer.queryFeatures(query)
.then(function(response) {
// Open the popup with the queried features
theView.openPopup({
features: response.features,
featureMenuOpen: true,
featuresPerPage: 100,
});
addButtonToContainer();
if(response.features.length === 0){
alert("Search query found no results.");
return
}else{
for(let iii=0; iii < response.features.length; iii++){
//console.log(response.features[iii])
//featureTable.selectRows(response.features[iii]);
featureTable.highlightIds.add(response.features[iii]);
console.log(featureTable.highlightIds.add(response.features[iii]))
featureTable.filterBySelection();
}
};
});
... View more
02-26-2024
07:18 AM
|
0
|
1
|
654
|
|
POST
|
Print export is not including any labels. I set forceFeatureAttributes to true. What am I missing? // Style the label
var labelClass = {
symbol: {
type: "text", // autocasts as new TextSymbol()
color:[254, 252, 203], //"white",//[230, 224, 0],
haloColor: "Black",
haloSize: 2,
lineWidth:55,
font: {
// autocast as new Font()
family: "Avenir Next LT Pro Medium",
size: 8,
weight: "bold"
}
},
labelExpressionInfo: {
expression: singleLine
},
labelPlacement: "always-horizontal",
minScale: 7500
};
parcelLayer.labelingInfo = [labelClass];
... View more
02-15-2024
01:43 PM
|
0
|
0
|
532
|
|
IDEA
|
It would be nice if the ability to print tables, including the feature menu tables. As I understand it, this is coming to the print widget, but it would be nice to have it with the actual tables. See my solution to this here https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-popup-feature-menu-and-feature-tables/m-p/1367472#M83601.
... View more
02-15-2024
09:24 AM
|
1
|
1
|
661
|
|
POST
|
When I use a search query, it only loads the first 20 results initially into the feature menu. It then loads the next 20 as I scroll, ect.. So when I go to print the results I only get those results, but I need all results. I understand this is by design with good reason, but does anyone have an idea on how to get around this? See codepen below for an example. https://codepen.io/mbdriscoll/pen/GReBgYd
... View more
02-08-2024
11:53 AM
|
0
|
1
|
869
|
|
POST
|
Here is my solution to printing the popup feature menu. https://codepen.io/mbdriscoll/pen/GReBgYd <html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<title>Feature Layer Popup Test</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.28/esri/themes/dark/main.css" />
<script src="https://js.arcgis.com/4.28/"></script>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/Basemap",
"esri/layers/TileLayer",
], (Map,MapView,FeatureLayer,Basemap,TileLayer) => {
const aerial2022 = new Basemap({
baseLayers: [
new TileLayer({
url: "https://www.jfksgis.us/image/rest/services/Aerials/Aerials_2022_cache/MapServer",
title: "Basemap"
}),
],
title: "2022 Aerial",
visible: true,
});
const parcelLayer = new FeatureLayer({
url: "https://www.jfksgis.us/server/rest/services/BaseLayers/JFKSBaseMapLayers/MapServer/3",
title: 'Search Results',
popupTemplate : createPopupTemplate(),
listMode: "hide",
outFields:["*"]
});
const theMap = new Map({
basemap : aerial2022,
layers : [parcelLayer]
});
const theView = new MapView({
container : "viewDiv",
map : theMap,
center : [-95.3804157, 39.2315224],
highlightOptions: {
color: [64, 247, 244],
fillOpacity: 0.2,
},
popup: {
visibleElements: {
closeButton: true,
},
dockEnabled: true,
dockOptions: {
autoOpenEnabled: false,
position: "bottom-right",
breakpoint: false,
buttonEnabled: false,
},
},
});
function createPopupTemplate(){
const urlTax = "https://ks1418.cichosting.com/ttp/tax/Search/search_tax_results.aspx?";
const urlRC = "https://www.jfksgis.us/prc/"
var parInfo = 'https://www.jfksgis.us/JFKSParcelSearch/parcelInformation.html';
var platy = "Replace($feature.Plat_HL, ' ', '%20')"
return{
title:
"<b>Owner:</b> {PartyName_1} " +
"<br /><b>Address: </b> {PropertyAddress}" +
"<br><b>Property Number: </b> {PropertyNumber}" +
"<br><b>Appraisal:</b> ${RP_AprTot}",
outFields: ["*"],
content:
[
{
type: "fields",
fieldInfos:[
{
fieldName: "QuickRefID",
label: "Quick Ref ID",
},
{
fieldName: "ACRES",
label: "Acres",
format:{
places: 2,
}
},
]
},
{
type: "text",
text: "<a class='hyperlinkURL' target='_blank' href=" + parInfo + "?PropertyID={PropertyID}&PID={PID}&PropNum={PropertyNumber}>Parcel Information</a>      <a class='hyperlinkURL' target='_blank' href=" + urlTax + "PID={PID}>Tax Information</a>"
},
{
type: "text",
text: "<a class='hyperlinkURL2' target='_blank' href=https://{expression/platlinked}>View Plat</a>      <a class='hyperlinkURL' href=" + urlRC + "{PropertyNumber}.pdf>Property Record Card</a>",
},
],
expressionInfos:[
{
name: "platlinked",
expression: platy,
},
],
fieldInfos:[{
fieldName: "RP_AprTot",
label: "Total Appraised Value",
format: {
places: 2,
digitSeparator: true,
}
},
],
}
};
function addButtonToContainer() {
const isElementLoaded = async selector => {
while (document.querySelector(selector) === null) {
await new Promise(resolve => requestAnimationFrame(resolve));
}
};
// Wait for the feature menu container to be fully loaded
isElementLoaded('.esri-popup__main-container').then(() => {
console.log("Feature menu container loaded");
let myDiv = document.querySelector('.esri-popup__main-container');
let button = document.createElement('button5');
button.innerText = "Print";
button.style.position = "absolute";
button.style.top = "5px";
button.style.right = "5px";
button.style.zIndex = "9999"; // Set a high z-index value
button.style.backgroundColor = "white";
button.style.color = "black";
button.style.fontWeight = "bold";
button.style.padding = "3px 3px";
button.style.cursor = "pointer";
button.addEventListener("click", printDiv);
myDiv.appendChild(button);
});
}
function printDiv(){
const isElementLoaded = async selector => {
while (document.querySelector(selector) === null) {
await new Promise(resolve => requestAnimationFrame(resolve));
}
}
isElementLoaded('.esri-popup__main-container').then(() => {
console.log("Feature menu loaded");
var printContent = document.querySelector('.esri-popup__main-container').innerHTML;
const modifiedContent = printContent.replace(/Back/g, '').replace(/Owner/g, '<br><br><br>Owner');
printWindow = window.open('', '_blank');
printWindow.document.write(modifiedContent);
printWindow.document.close();
// Wait for a short period before printing
setTimeout(function() {
printWindow.print();
}, 100);
})
};
let query = parcelLayer.createQuery();
query.where = "PartyName_1 LIKE '%driscoll%'";
query.outFields = [ "*" ];
parcelLayer.queryFeatures(query)
.then(function(response) {
// Open the popup with the queried features
theView.openPopup({
features: response.features,
featureMenuOpen: true,
featuresPerPage: 100,
}),
addButtonToContainer();
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
... View more
02-07-2024
12:24 PM
|
0
|
0
|
1423
|
|
POST
|
You were correct. I used the graphics not the layer. https://codepen.io/mbdriscoll/pen/GReBgYd
... View more
02-06-2024
07:42 AM
|
0
|
0
|
1325
|
|
POST
|
The layer does have a title, see below. I do add graphics directly, but the popup template is on the feature layer. I will play around with it. Is there a way to just not show the heading at all? \ const parcelLayer = new FeatureLayer({
url: "https://www.jfksgis.us/server/rest/services/BaseLayers/JFKSBaseMapLayers/MapServer/3",
title: "parcel Layer",
popupTemplate : createPopupTemplate(),
listMode: "hide",
outFields:["*"]
});
... View more
02-06-2024
06:22 AM
|
0
|
0
|
1333
|
|
POST
|
Both examples given use the exact same code. function createPopupTemplate(){
const urlTax = "https://ks1418.cichosting.com/ttp/tax/Search/search_tax_results.aspx?";
const urlRC = "https://www.jfksgis.us/prc/"
var parInfo = 'https://www.jfksgis.us/JFKSParcelSearch/parcelInformation.html';
var platy = "Replace($feature.Plat_HL, ' ', '%20')"
return{
title:
"<b>Owner:</b> {PartyName_1} " +
"<br /><b>Address: </b> {PropertyAddress}" +
"<br><b>Property Number: </b> {PropertyNumber}" +
"<br><b>Appraisal:</b> ${RP_AprTot}",
outFields: ["*"],
content:
[
{
type: "fields",
fieldInfos:[
{
fieldName: "QuickRefID",
label: "Quick Ref ID",
},
{
fieldName: "ACRES",
label: "Acres",
format:{
places: 2,
}
},
]
},
{
type: "text",
text: "<a class='hyperlinkURL' target='_blank' href=" + parInfo + "?PropertyID={PropertyID}&PID={PID}&PropNum={PropertyNumber}>Parcel Information</a>      <a class='hyperlinkURL' target='_blank' href=" + urlTax + "PID={PID}>Tax Information</a>"
},
{
type: "text",
text: "<a class='hyperlinkURL2' target='_blank' href=https://{expression/platlinked}>View Plat</a>      <a class='hyperlinkURL' href=" + urlRC + "{PropertyNumber}.pdf>Property Record Card</a>",
},
],
expressionInfos:[
{
name: "platlinked",
expression: platy,
},
],
fieldInfos:[{
fieldName: "RP_AprTot",
label: "Total Appraised Value",
format: {
places: 2,
digitSeparator: true,
}
},
],
}
};
... View more
02-05-2024
12:04 PM
|
0
|
3
|
1358
|
|
POST
|
*edit for more context There seems to be a new item of heading in the search feature menu popup. How do I change that from "Untitled" to something else or to get rid of it completely? 4.21 - Link Example - 4.21 4.28 - Link Example - 4.28
... View more
02-05-2024
09:28 AM
|
0
|
4
|
1432
|
|
POST
|
Are there any examples. When I use featureTable.print() I get the error that it is not a function. The link shows how to print from the export/print widget. I would like to print direct from the custom option newMenuItem to print the table. If I use a newMenuItem to open a new window to print the table using print(), it loses all the grids that make it a table. The HTML2DCanvas seems promising, I will work on testing that out.
... View more
01-11-2024
07:54 AM
|
0
|
0
|
1505
|
|
POST
|
Is there a print option for the popup feature menu? Also is there a print option for feature table? If anyone has done this I appreciate any tips you have.
... View more
01-04-2024
10:30 AM
|
0
|
3
|
1560
|
|
POST
|
Creation Mode is continuous by default. Use single. const sketch = new Sketch({
layer: sketchGraphicsLayer,
view: mapView,
creatioMode: "single"
})
... View more
12-07-2023
12:34 PM
|
0
|
0
|
622
|
|
POST
|
I have two hosted service tables, table 1 is the production for a old and newly created permits. Table 1 uses an index number field for its values. Table 2 has the index number field and a description values field. Is it possible to replace the description values, queried from table 2, to use as the value in replacement for a column in a Feature Table of table 1? Essential I need to users to see the description in that column instead of the index number.
... View more
12-07-2023
12:02 PM
|
0
|
0
|
530
|
|
POST
|
@GKmieliauskas is correct you need to use the IGPResult. Below is how I access python results in the cs. public async Task<IGPResult> ExecuteModel()
{
var progDlg = new ProgressDialog("Running Geoprocessing Tool", "Cancel");
progDlg.Show();
var progsrc=new CancelableProgressorSource(progDlg);
var pathPython = System.IO.Path.GetDirectoryName((new System.Uri(Assembly.GetExecutingAssembly().CodeBase)).AbsolutePath);
pathPython = Uri.UnescapeDataString(pathPython);
System.Diagnostics.Debug.WriteLine(pathPython);
var tool_path = System.IO.Path.Combine(pathPython, @"YourPythonScript.pyt\Tool");
var parameters = Geoprocessing.MakeValueArray();
IGPResult gp_result = await Geoprocessing.ExecuteToolAsync(tool_path, parameters, null, new CancelableProgressorSource(progDlg).Progressor);
return gp_result;
}
... View more
11-13-2023
06:41 AM
|
0
|
1
|
1840
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | a week ago | |
| 1 | 2 weeks ago | |
| 1 | 04-12-2021 09:58 AM | |
| 2 | 03-18-2025 10:32 AM | |
| 1 | 07-28-2020 11:56 AM |
| Online Status |
Offline
|
| Date Last Visited |
7 hours ago
|