Skip to content

Configuration

API Key

The API key is read from the <script> tag's key parameter at load time:

<script src="https://sdk.woosmap.com/map/map.js?key=YOUR_API_KEY&callback=initMap"></script>

Two key formats are supported:

  • UUID keys (e.g., 550e8400-e29b-41d4-a716-446655440000) — modern format, key is sent via headers
  • Legacy keys — appended as ?key=... query parameter to all API requests

The Config singleton (window.woosmap.config) manages global configuration and URL construction.

Map Options

The Map constructor accepts an options object:

var map = new woosmap.map.Map(document.getElementById("map"), {
    center: {lat: 43.3, lng: 3.883},
    zoom: 2,
    gestureHandling: "cooperative",
    styles: null,
    disableDefaultUI: false,
    disableTilt: false,
    disable3dBuilding: false,
});
Option Type Default Description
center LatLng \| LatLngLiteral {lat: 43.3, lng: 3.883} Initial map center
zoom number 2 Initial zoom level
tilt number 0 Map tilt in degrees
heading number 0 Map heading in degrees
gestureHandling string "cooperative" Gesture mode (see below)
styles MapStyleSpec[] null Custom map styling
disableDefaultUI boolean false Hide all default controls
disableTilt boolean false Prevent tilt and rotation interaction (touch and keyboard)
disable3dBuilding boolean false Disable 3D building extrusions
enableMarkerAccessibleNavigation boolean false Keyboard navigation for markers

Gesture Handling

Controls how the map responds to touch and scroll gestures:

Mode Behavior
"cooperative" Requires Ctrl+scroll to zoom on desktop, two-finger pan on mobile
"greedy" Map captures all gestures directly
"none" Disables all gesture interaction
"auto" Uses cooperative if the page is scrollable, greedy otherwise

Build Environments

The WOOSMAP_ENV environment variable controls API and asset URLs at build time:

Environment API Base URL Assets Base URL
local http://api.ringum.net http://blitz.local:8082
develop https://develop-api.woosmap.com https://develop-sdk.woosmap.com/map
prod https://api.woosmap.com https://sdk.woosmap.com/map

Feature Flags

Flags can be passed via the script tag:

<script src="...?key=KEY&flags=google_zoom_levels,map_feature_debug"></script>

Allowed flags:

Flag Description
google_zoom_levels Use Google-compatible zoom level mapping
map_feature_debug Enable map feature debugging output