Layers API

The Layers API gives you access to the map layers within your Fulcrum account.

Properties

PropertyTypeRequiredReadonlyDescription
namestringyesnoThe name of the layer.
typestringyesnoThe layer type (geojson, xyz).
sourcestringyesnoThe layer source.
descriptionstringnonoOptional layer description.
boundsarraynoyesThe layer bounds.
centernumbernoyesThe layer center.
maxzoomnumbernoyesThe layer maximum zoom.
minzoomnumbernoyesThe layer minimum zoom.
access_tokenstringyesnoThe layer access token.
idstringnoyesThe id of the layer.
created_atstringnoyesTimestamp when the layer was created.
updated_atstringnoyesTimestamp when the layer was last updated.
file_sizenumbernoyesThe file size (for mbtiles).

Validations

The following properties must be included in order to create/update a layer object in our system. Any validation errors will return a 422 and an object with a list of validation errors.

Required Properties

PropertyTypeDescriptionExample
namestringThe name of the layer."USGS Topo"
typestringThe layer type (geojson, xyz)."xyz"
sourcestringThe layer sourc (URL or inline GeoJSON)."http://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{z}/{y}/{x}"

Example validation response if type is not included:

{
  "layer": {
    "errors": {
      "type": ["must be one of xyz, geojson"]
    }
  }
}

Notes

  • The entire layer object is required when making an update. Omitting fields with existing data will result in data loss! The typical workflow for updating an existing layer is to fetch the layer object, modify it, and then submit the PUT request.

Sample Response

{
  "layer": {
    "name": "USGS Topo",
    "description": "USGS Topo Base Map - Primary Tile Cache (http://viewer.nationalmap.gov/example/services/serviceList.html)",
    "source": "http://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{z}/{y}/{x}",
    "bounds": null,
    "center": null,
    "maxzoom": null,
    "minzoom": null,
    "access_token": null,
    "id": "18e95686-b125-4baa-a263-b9bef2f9fee7",
    "created_at": "2014-10-22T17:07:53Z",
    "updated_at": "2014-10-24T19:21:05Z",
    "type": "xyz",
    "file_size": 0
  }
}