Get map

https://maphub.net/api/1/map/get

Get all information about single map, including GeoJSON.

Arguments

  • map_id (required): the id of the map. To find out a map's id, please use the list maps endpoint.

Response

The response returns the following keys:

  • id: The id of the map.

  • url: The full URL of the map.

  • owner: The map owner's username.

  • short_name: The short name of the map, used in the URL.

  • title: The title of the map.

  • description: The description of the map.

  • geojson: The GeoJSON for the map. This includes information related to groups, custom icons and images as well.

  • basemap: The basemap used by the map.

  • visibility: The visibility mode of the map. One of public, unlisted, private, select.

  • collaborate: Whether collaboration is enabled/disabled for the map. True/False

  • viewer_users: The list of specified viewers, if visibility mode is select .

  • editor_users: The list of editors, if collaboration is enabled.

  • created_date: The date when the map was created. ISO datetime string in UTC timezone.

  • modified_date: The date when the map was last updated. ISO datetime string in UTC timezone.

  • images: The list of image ids present in the map's GeoJSON.

  • markers: The list of marker ids present in the map's GeoJSON. Markers = custom icons on the web interface.

Code example

curl

curl https://maphub.net/api/1/map/get \
    --header 'Authorization: Token <api_key>' \
    --data-raw '{"map_id": 12345}'

Python

import requests

url = 'https://maphub.net/api/1/map/get'

api_key = '<api_key>'

args = {
    'map_id': 12345,
}

headers = {'Authorization': 'Token ' + api_key}
r = requests.post(url, json=args, headers=headers)

print(r.json())