Append map

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

Upload a file and append to an existing map.

The specifications for this endpoint are the same as for upload map, only the differences are listed here.

Arguments

  • map_id (required): the id of the existing map
  • file_type (required): one of kml, gpx, geojson. For ".kmz" files, use kml

Example

curl

curl https://maphub.net/api/1/map/append \
    --header 'Authorization: Token <api_key>' \
    --header 'MapHub-API-Arg: {"map_id": 28163, "file_type": "kml"}' \
    --data-binary @append.kml

Python

import json
import requests

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

api_key = '<api_key>'

args = {
    'map_id': 28158,
    'file_type': 'kml',
}

headers = {
    'Authorization': 'Token ' + api_key,
    'MapHub-API-Arg': json.dumps(args)
}

with open('append.kml', 'rb') as f:
    r = requests.post(url, headers=headers, data=f)

print(r.json())

results matching ""

    No results matching ""