POST
|
Here is a working code pen using your same layer. Your area is just west of where my map loads. https://codepen.io/mbdriscoll/pen/gOyprmg?editors=1010
... View more
3 weeks ago
|
0
|
0
|
77
|
POST
|
What I did was add the highlight ids and filtered that. Below is a bigger picture. let queryBP = bldPermLayer.createQuery();
queryBP.where = finQueryBP
queryBP.outFields = ["*"];
// do the query
bldPermLayer
.queryFeatures(queryBP)
.then((response) => {
const graphics = response.features;
//console.log(response.features.length);
if(response.features.length === 0){
alert("Search query found no results.");
return
}else{
for(let iii=0; iii < response.features.length; iii++){
featureTable.highlightIds.add(response.features[iii].attributes.objectid);
featureTable.filterBySelection();
console.log("this is the search")
}
};
tabContain.style.visibility = "visible";
bpContain.style.display = "none";
});
// Attach the event listener outside of the featureTable.when callback
const grid = featureTable.container.querySelector("vaadin-grid");
if (grid) {
grid.addEventListener("cell-activate", cellActivateHandler);
} else {
console.log("Feature table grid not found.");
};
grid.removeEventListener("cell-activate", cellActivateHandler);
grid.addEventListener("cell-activate", cellActivateHandler);
... View more
3 weeks ago
|
1
|
3
|
74
|
POST
|
This is how I did it. The feature tables are vaadin-grids. // Attach the event listener
const grid = featureTable.container.querySelector("vaadin-grid");
if (grid) {
grid.addEventListener("cell-activate", cellActivateHandler);
} else {
console.log("Feature table grid not found.");
};
grid.removeEventListener("cell-activate", cellActivateHandler);
grid.addEventListener("cell-activate", cellActivateHandler); // Define the cellActivateHandler function
function cellActivateHandler(e) {
// Important to remove the event listener or it will hold on to the last query and iterate the next one.
// Then add it back so it can continue to listen on same table.
const feature = e.detail.model.item.feature;
const permitNump = feature.attributes.fldpermitnum;
const pidBPp = feature.attributes.fldcamanum_1_txt;
const datedatap = feature.attributes.fld_permitdate;
const newdatep = new Date(datedatap);
const finYearp = newdatep.getFullYear();
const query = new Query({
where: "PID = '" + pidBPp + "'",
outFields: ["*"],
returnGeometry: true,
});
// Check if the feature table is ready
if (featureTable && featureTable.container) {
if(BPhighlights){
BPhighlights.remove();
};
parcelLayer.queryFeatures(query).then(function (result){
if(result.features.length === 0){
alert("The PID for this permit no longer exists!")
return
};
BPhighlights = parcelLayerViewBP.highlight(result.features);
// Create a highlight graphic and add it to the graphics layer
result.features.forEach(function (feature){
var parcelExtent = feature.geometry.extent.clone().expand(1.5);
theView.goTo({
target: parcelExtent,
zoom: 15.75
});
});
});
} else {
// Feature table is not ready, handle accordingly
console.log("Feature table is not ready.");
};
}
... View more
3 weeks ago
|
0
|
5
|
87
|
POST
|
Maybe a Picture Marker Symbol? Maybe play around in the symbol builder? Honestly it might be easiest to create in Pro and host it.
... View more
3 weeks ago
|
0
|
0
|
60
|
POST
|
This works for me. const labelClass = {
// autocasts as new LabelClass()
symbol: {
type: 'text', // autocasts as new TextSymbol()
color: 'yellow',
haloColor: 'black',
haloSize: 1,
font: {
// autocast as new Font()
family: 'playfair-display',
size: 12,
weight: 'bold',
},
},
deconflictionStrategy: 'none',
maxScale: 0,
minScale: 15000,
labelPlacement: 'always-horizontal',
labelExpressionInfo: {
expression: '$feature.FID',
},
};
const SoilsLayer = new FeatureLayer({
url: 'https://services1.arcgis.com/uye9M5KkL8B18MZq/arcgis/rest/services/KS_Soils/FeatureServer/0',
//apiKey: apiKey,
//minZoom: 12, // Minimum zoom level of 12
//renderer: L.canvas({ pane: 'middle' }),
labelingInfo: [labelClass],
lablelsVisible: true,
style: {
color: 'yellow', // Grey border
weight: 1, // Border width
fillColor: 'none', // No fill
fillOpacity: 0,
},
})
map.add(SoilsLayer)
... View more
3 weeks ago
|
1
|
2
|
104
|
POST
|
You changed some class names in the html, so you need to do that in the javascript too. .category-item data-category const seasonsNodes = document.querySelectorAll(`.category-item`);
const seasonsElement = document.getElementById("seasons-filter");
// click event handler for seasons choices
seasonsElement.addEventListener("click", filterBySeason);
// User clicked on Winter, Spring, Summer or Fall
// set an attribute filter on flood warnings layer view
// to display the warnings issued in that season
function filterBySeason(event) {
console.log(document.querySelectorAll('.category-item'));
const selectedSeason = event.target.getAttribute("data-category");
floodLayerView.filter = {
where: "Category = '" + selectedSeason + "'"
};
}
... View more
3 weeks ago
|
0
|
1
|
65
|
POST
|
See this code pen for a working example. It replaces "," with " ZZZZ '. https://codepen.io/mbdriscoll/pen/gOyprmg
... View more
3 weeks ago
|
1
|
2
|
111
|
POST
|
Here is a working codepen example. I have the timeout set really high so you will need to wait around 15-30 seconds to see the opacity change on the 4th item in the legend. https://codepen.io/mbdriscoll/pen/XWQWexm
... View more
a month ago
|
1
|
1
|
67
|
POST
|
You need to change the opacity of the class esri-legend__symbol.
... View more
a month ago
|
0
|
2
|
73
|
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
a month ago
|
0
|
0
|
131
|
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
|
70
|
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
|
148
|
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
|
118
|
Title | Kudos | Posted |
---|---|---|
1 | 3 weeks ago | |
1 | 3 weeks ago | |
1 | 3 weeks ago | |
1 | 3 weeks ago | |
1 | a month ago |
Online Status |
Offline
|
Date Last Visited |
Tuesday
|