We are building a small demo for a devoplment team in our organisation:
The first iteration of the demo works with a normal map service:
// set up map layer
var METlayer = new MapImageLayer(
portalItem: // autocasts as esri/portal/PortalItem
id: "f36bf4a27f1e487b8895452bf745da21" // Portal ID for the working map service
,
sublayers:[
id: 0,
definitionExpression: "L_Opname_ligging = 'GPS ingemeten'", // filter based on attribute
popupTemplate: popupTemplate //apply pop up
,
id: 1,
definitionExpression: "L_Opname_ligging = 'GPS ingemeten'",
popupTemplate: popupTemplate
]
);
The idea is to filter each layer by gemeente using an attribute field (and not a spatial query).
There will be 8 layers in the service.
Solved! Go to Solution.
Hi there,
It should work without any issues. Seems like the issue specific to your case and a reproducible case would be better to find a solution.
The following code snippet sets a definitionExpression on a sublayer for a time-enabled MapImageLayer and it works as expected.
const layer = new MapImageLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Earthquakes_Since1970/MapServer",
sublayers:[{
id: 0,
definitionExpression: "magnitude >= 8"
}]
});
Hi there,
It should work without any issues. Seems like the issue specific to your case and a reproducible case would be better to find a solution.
The following code snippet sets a definitionExpression on a sublayer for a time-enabled MapImageLayer and it works as expected.
const layer = new MapImageLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Earthquakes_Since1970/MapServer",
sublayers:[{
id: 0,
definitionExpression: "magnitude >= 8"
}]
});
Indeed it was an issue with the service. Native publishing was ok but when it went through our automated deployment something changed. We will publish this service manually for now.
Thank you for your help.