Map
Get the project map state
Requires scope: session.
GET
/
sessions
/
{id}
/
map
Get the project map state
curl --request GET \
--url https://api.mapxagent.com/api/v1/sessions/{id}/map \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mapxagent.com/api/v1/sessions/{id}/map"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mapxagent.com/api/v1/sessions/{id}/map', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mapxagent.com/api/v1/sessions/{id}/map",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mapxagent.com/api/v1/sessions/{id}/map"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mapxagent.com/api/v1/sessions/{id}/map")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mapxagent.com/api/v1/sessions/{id}/map")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"center": [
123
],
"zoom": 11,
"bearing": 123,
"pitch": 42.5,
"basemap": {
"style": "<string>",
"categories": {}
},
"countryMask": {
"countryCode": "<string>",
"countryName": "<string>",
"visible": true,
"color": "<string>"
},
"customMask": {
"geojson": "<string>",
"color": "<string>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
Personal API key (mkx_...) created from the MapX account.
Path Parameters
Project UUID.
Response
Current map state (center, zoom, bearing, pitch, basemap).
Current map viewport and basemap state.
Map center as [lng, lat].
Required array length:
2 elementsMap zoom level, 0-22.
Required range:
0 <= x <= 22Map rotation in degrees.
Map pitch in degrees, 0-85.
Required range:
0 <= x <= 85Basemap style and per-category overrides.
Show child attributes
Show child attributes
Inverted-polygon mask that hides the basemap outside a country. Omitted or null means no country mask.
Show child attributes
Show child attributes
Custom polygon mask built from arbitrary GeoJSON. Omitted or null means no custom mask.
Show child attributes
Show child attributes
⌘I
Get the project map state
curl --request GET \
--url https://api.mapxagent.com/api/v1/sessions/{id}/map \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mapxagent.com/api/v1/sessions/{id}/map"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mapxagent.com/api/v1/sessions/{id}/map', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mapxagent.com/api/v1/sessions/{id}/map",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mapxagent.com/api/v1/sessions/{id}/map"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mapxagent.com/api/v1/sessions/{id}/map")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mapxagent.com/api/v1/sessions/{id}/map")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"center": [
123
],
"zoom": 11,
"bearing": 123,
"pitch": 42.5,
"basemap": {
"style": "<string>",
"categories": {}
},
"countryMask": {
"countryCode": "<string>",
"countryName": "<string>",
"visible": true,
"color": "<string>"
},
"customMask": {
"geojson": "<string>",
"color": "<string>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"details": "<unknown>"
}
}
