Get Map Styles
curl --request GET \
--url https://b.hudhud.sa/v1/maps/stylesimport requests
url = "https://b.hudhud.sa/v1/maps/styles"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://b.hudhud.sa/v1/maps/styles', 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://b.hudhud.sa/v1/maps/styles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://b.hudhud.sa/v1/maps/styles"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://b.hudhud.sa/v1/maps/styles")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.hudhud.sa/v1/maps/styles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"center": [
123
],
"id": "<string>",
"layers": [
{
"id": "<string>",
"source": "<string>",
"type": "<string>"
}
],
"metadata": {},
"name": "<string>",
"sources": {},
"version": 123,
"zoom": 123
}{}{}{}{}{}{}{}Maps
Get Map Styles
Returns a MapLibre-compliant style JSON for the given variant and language.
Retryable errors
Retry these errors with exponential backoff and jitter:
500,503, and504.429with the coderate_limit_exceeded. Wait the number of seconds in theRetry-Afterheader.
Do not retry other errors, which fail again unchanged. A 429 with the code daily_limit_exceeded succeeds after the limit resets at 00:00 UTC; one with trial_limit_reached does not succeed again.
GET
/
maps
/
styles
Get Map Styles
curl --request GET \
--url https://b.hudhud.sa/v1/maps/stylesimport requests
url = "https://b.hudhud.sa/v1/maps/styles"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://b.hudhud.sa/v1/maps/styles', 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://b.hudhud.sa/v1/maps/styles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://b.hudhud.sa/v1/maps/styles"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://b.hudhud.sa/v1/maps/styles")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.hudhud.sa/v1/maps/styles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"center": [
123
],
"id": "<string>",
"layers": [
{
"id": "<string>",
"source": "<string>",
"type": "<string>"
}
],
"metadata": {},
"name": "<string>",
"sources": {},
"version": 123,
"zoom": 123
}{}{}{}{}{}{}{}Retrieve MapLibre-compliant style JSON objects to render vector maps in your application.
Publishable Key
This endpoint uses your Publishable Key (pk_...) via the api_key query parameter. This allows you to securely embed maps in frontend applications without exposing your Secret Key.
Rendering with MapLibre GL JS
To correctly render Arabic text and ligatures, you must use the MapLibre RTL plugin.// 1. Initialize the RTL plugin
maplibregl.setRTLTextPlugin(
'https://unpkg.com/@mapbox/[email protected]/dist/mapbox-gl-rtl-text.js',
true // Lazy-load
);
// 2. Initialize the map
const map = new maplibregl.Map({
container: 'map',
style: 'https://b.hudhud.sa/v1/maps/styles?variant=light&lang=ar&api_key=pk_your_publishable_key',
center: [46.6753, 24.7136], // Riyadh
zoom: 12
});
Style Variants
- Light: Optimized for standard daytime navigation and POI display.
- Dark: A high-contrast dark mode variant for nighttime use or specialized dashboards.
Language Support
Thelang parameter allows you to toggle between Arabic (ar) and English (en) for all labels on the map.