Is it possible to display this ImageServer layer by a specific date?

214
1
03-04-2026 05:46 AM
Antigravity
New Contributor

The following ImageServer layer:
https://sampleserver6.arcgisonline.com/arcgis/rest/services/ScientificData/SeaTemperature/ImageServe... 

Is it possible to display the data for a specific date (e.g., June 14, 2014) in a Flutter app using the ArcGIS Maps SDK?

If so, how can I set the time parameter to show data for that date only?

0 Kudos
1 Reply
ChanganShi1
Regular Contributor

Hi, 

You can display the data for a specific date by setting MapViewController.timeExtent. Here are some codes for your reference:

 Future<void> onMapViewReady() async{
    _imageServiceRaster = ImageServiceRaster(
      uri: Uri.parse(
        'https://sampleserver6.arcgisonline.com/arcgis/rest/services/ScientificData/SeaTemperature/ImageServer',
      ),
    );
    _imageServiceLayer = RasterLayer.withRaster(_imageServiceRaster);
    await _imageServiceLayer.load();

    _fullTimeExtent = _imageServiceLayer.fullTimeExtent!;
    final map = ArcGISMap.withBasemapStyle(BasemapStyle.arcGISOceansLabels);
    map.operationalLayers.add(_imageServiceLayer);
    map.initialViewpoint = Viewpoint.fromTargetExtent(
      _imageServiceLayer.fullExtent!,
    );
    _mapViewController.arcGISMap = map;
  }

  // Update the map's time extent based on the slider value
  void updateTimeExtent(double value) {
    final startTime = _fullTimeExtent?.startTime?.add(Duration(days: value.round()));
    if (startTime != null) {
      _mapViewController.timeExtent = TimeExtent(
        startTime: startTime,
        endTime: startTime.add(const Duration(days: 10)),// Set a fixed time window of 10 days for demonstration
      );
    }
  }
0 Kudos