Select to view content in your preferred language

MapImageLayer with a time enabled map service?

403
2
Jump to solution
04-04-2023 04:53 AM
AnnetteFarrell
New Contributor II

We are building a small demo for a devoplment team in our organisation:

  • ArcGIS Enterprise 10.9.1 
  • Javascript api 4.26

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
]
);

  • This approach works with different map services.

 

  • However when I replace the service with a time enabled map service the basemap appears but not the time enabled service.
    If I remove Time from the same service the MapImageLayer call does work.

 

  • Question 1: This leads me to believe that MapImageLayer does not support time enabled map services. Is this correct?

 

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.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

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"
  }]
});

View solution in original post

0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

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"
  }]
});
0 Kudos
AnnetteFarrell
New Contributor II

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.

0 Kudos