Maps

Add Layer Endpoint

Add a layer to a map.

Declared on both slash variants directly so neither emits a 307. FastAPI's default redirect_slashes builds a relative Location header that resolves against the request's Host header, leaking the in-container api:8000 hostname through Vite's dev proxy. The canonical (OpenAPI-published) form is the no-slash sub-collection convention documented in the GeoLens API guide (https://docs.getgeolens.com/guides/api/); the trailing-slash form is a hidden alias for callers that send the slash.

post/maps/{map_id}/layers

Request

  • The document declares no server URL.
  • Auth: one of:
    • OAuth 2 (password, token URL /api/auth/login)
    • API key in header X-Api-Key
    • API key in query parameter api_key

Path parameters

map_idstring uuid required

Request body

idstring uuid nullable

Existing layer id to update in place (full-save reconcile)

dataset_idstring uuid required
sort_orderinteger

Draw order (lower draws first)

visibleboolean
opacitynumber

Layer opacity 0.0-1.0

paintobject nullable

MapLibre paint properties override

layoutobject nullable

MapLibre layout properties override

display_namestring nullable

Label shown in the layer list

label_configobject nullable

Text label configuration. Accepted keys: allowOverlap, column, fontSize, haloColor, haloWidth, maxZoom, minZoom, placement, textAnchor, textColor, textOffset, textOpacity. Unknown keys are dropped when the map is exported as a MapLibre style. See https://docs.getgeolens.com/guides/api/publishing-from-desktop-gis/

style_configobject nullable

Data-driven and builder UI style configuration. Accepted top-level keys: breaks, builder, categories, classCount, colorLabel, colors, column, heatmapPaint, legendLabel, method, mode, ramp, render_mode, reversed, savedCirclePaint, sizeLabel, sizeRange, sizes, symbol, target; other top-level keys are dropped when the map is exported as a MapLibre style. Builder-only state lives under builder, whose interpreted keys are arrow_color, arrow_size, arrow_spacing, cluster_color, cluster_color_ramp, cluster_max_zoom, cluster_radius, cluster_show_counts, cluster_text_color, cluster_text_size, colormap, extrusion_min_zoom, extrusion_opacity, fill_color_saved, fill_disabled, fill_opacity_saved, folder_group_expanded, folder_group_id, folder_group_name, heatmap_ramp, heatmap_reversed, heatmap_weight_column, height_column, height_scale, hypso_enabled, hypso_ramp, hypso_reversed, lineGradient, outline_color, outline_width, outline_width_saved, pmax, pmin, sigma, stretch, stroke_disabled, symbol. Other builder keys are stored and exported unchanged but have no effect. See https://docs.getgeolens.com/guides/api/publishing-from-desktop-gis/

layer_typestring nullable

Auto-detected from record_type if omitted

show_in_legendboolean

Whether to include in the map legend

Response

Successful Response

idstring uuid required
dataset_idstring uuid required
dataset_namestring required
dataset_geometry_typestring nullable required
dataset_table_namestring required
dataset_extent_bboxnumber[] nullable required
dataset_column_infoobject[] nullable
dataset_feature_countinteger nullable
dataset_sample_valuesobject nullable
display_namestring nullable
sort_orderinteger required
visibleboolean required
opacitynumber required
paintobject required
layoutobject required
layer_typestring
dataset_record_typestring nullable
label_configobject nullable
style_configobject nullable
show_in_legendboolean
is_3dboolean nullable
is_demboolean nullable
dem_vertical_unitsstring nullable
band_countinteger nullable
tile_versioninteger nullable
publication_versioninteger nullable
dataset_visibilitystring nullable
dataset_statusstring nullable
dataset_attributionstring nullable

Changes

No recorded changes to this operation across all 50 revisions of this API.