Ir al contenido
getgeolens.com

Use GeoLens layers in ArcGIS Online

Esta página aún no está disponible en tu idioma.

ArcGIS Online reads GeoLens through its OGC API, tile layer and vector tile support. Nothing needs installing. These steps were measured against Map Viewer, Scene Viewer, ArcGIS Dashboards and the ArcGIS Maps SDK for JavaScript 4.32. Replace https://geolens.example.com with your GeoLens instance’s URL in every example.

  1. In Map Viewer, choose Add layer and then Add layer from URL.

  2. Set the type to OGC feature layer and enter your instance’s API root:

    https://geolens.example.com/api
  3. Map Viewer lists every collection, including the records catalog and raster collections. Pick a feature collection.

Map Viewer strips a trailing slash and requests /api. From 1.32.0 the browser reads that URL directly. On 1.31.0 and earlier the browser refuses the request, because the redirect from /api to /api/ carries no CORS header, and ArcGIS Online falls back to its own server-side proxy. That only works when the GeoLens host is reachable from the Internet. Otherwise the dialog reports “Service does not exist or is inaccessible.”

ArcGIS asks for one page of up to 5,000 features per map tile and does not follow the next link, so a tile draws only the first page GeoLens returns.

From 1.32.0 the page ceiling ogc_items_max_page_size is 5,000 by default, which is what ArcGIS asks for, and a page of large, detailed polygons still holds all of them. An instance where an admin already set the ceiling keeps its value.

On 1.31.0 and earlier the default is 1,000, and a tile that holds more features draws only the first 1,000. Raise the ceiling to 5,000 there. In the admin settings, open the Network tab and set OGC Features Max Page Size (items limit ceiling). Through the API:

Terminal window
curl -X PUT https://geolens.example.com/api/settings/ \
-H "X-Api-Key: <admin key>" \
-H "Content-Type: application/json" \
-d '{"settings": {"ogc_items_max_page_size": 5000}}'

See Settings for the setting itself.

  1. On the dataset page, open Connect and choose Copy XYZ Tile URL. The URL has this shape:

    https://geolens.example.com/raster-tiles/<dataset-id>/tiles/{z}/{x}/{y}.png?v=<n>&pv=<n>
  2. In Map Viewer, choose Add layer from URL and paste it. Map Viewer detects a Tile layer from the {z}/{x}/{y} placeholders and asks for a title and an attribution.

  3. Zoom to the data first, then turn on Set tile extent to the current extent of the map. ArcGIS then stops requesting tiles outside the data.

From 1.32.0 GeoLens sends a Cache-Control header on the empty tiles it returns outside a raster’s footprint, so repeated requests for them are cached. See Tile endpoints for the URL and its cache parameters.

Esri’s vector tile layer reads only a plain string sprite, and it drops a query string typed into the style URL. To load a GeoLens map in ArcGIS Online Map Viewer or the ArcGIS Maps SDK for JavaScript, request its style with sprite=url:

https://geolens.example.com/api/maps/<map-id>/style.json?sprite=url

In the SDK, pass it as customParameters: {sprite: "url"} on the layer, because the layer drops a query string typed into the style URL. In web map JSON the layer takes "customParameters": {"sprite": "url"}. This form points Esri’s layer at a copy of the GeoLens sprite whose icon names match the style’s. The sprite=url parameter needs GeoLens 1.32.0 or newer.

Esri’s layer ignores heat map layers in a style without reporting an error. See Style JSON export and import for the document itself.

An OGC feature layer can’t be the data source of a dashboard element. ArcGIS Dashboards shows “Layer not accessible.”, although the map element draws the layer. Add the dataset to the web map as a GeoJSON layer instead, using the dataset’s GeoJSON export URL:

https://geolens.example.com/api/datasets/<dataset-id>/export?format=geojson

GeoJSON layers work as element data sources. An OGC items URL with f=json loads only its first page, 10 features unless you add limit (up to the instance’s page ceiling, 5,000 by default), so use it only for a dataset that fits in one page; the export URL always holds every feature.

A CSV layer needs latitude and longitude columns. For a point dataset, add xy=true to the CSV export URL (from 1.32.0) to get longitude and latitude columns ArcGIS can place; without it the export writes geometry as WKT, which ArcGIS can’t place. See Exports for the formats.

Esri’s print service fetches tiles from its own servers. The GeoLens host has to be reachable from the Internet for GeoLens layers to appear in a print from Map Viewer.