1

Using https://openlayers.org/en/latest/apidoc/ol.source.TileArcGISRest.html

After creating a map source using TileArcGISRest the params are not passed to the Arcgis Rest server.

  const source = new ol.source.TileArcGISRest({
      url: 'https://gisservices.information.qld.gov.au/arcgis/rest/services/PlanningCadastre/LandParcelPropertyFramework/MapServer',
      params: {
            'LAYERS':"show:2,4"
        },
      });

  }
  const layer =  new ol.layer.Tile({
      extent: [15238742.701475, -3469504.213328, 17340271.619744, -1022026.482164],
      source: source
    });

All the layers are displayed, not just the selected layers. Looking at the URL sent by the browser, "&LAYERS=" Expected to see "&LAYERS=2,4".

1

The problem is that ArcGISRest server has a different syntax to WMS servers.

      params: {
            'LAYERS':"show:2,4"
        },
      });

Has the desired result.

To be fair to openlayers, the TileArcGISRest API documens does refer to http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/

But it was not obvious and I could not find examples that select layers from an ArcGISRest source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.