LayerLoader class

Helper utility to dynamically load map styles and inject authorization.

Constructors

LayerLoader()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

appendApiKey(String url, String? xApiKey) → String
Appends the API key query parameter to a given url if apiKey is provided. Preserves any template variables (e.g. {z}, {x}, {y}) without percent encoding.
appendQueryParam(String url, String key, String value) → String
Appends a query parameter to a given url if the parameter is not already present. Preserves any template variables (e.g. {z}, {x}, {y}) without percent encoding.
applyPoiMinZoom(Map<String, dynamic> styleJson, {double? minZoom}) → void
Overrides only the minimum zoom of layers on the business POI source. Without an explicit value, preserve the backend style exactly.
clearCache() → void
Clears the in-memory cache of processed style JSON strings.
generateHmacCredential({required String method, required Uri uri, required String apiKey, required String secretKey, String? body}) → String
Generates the dynamic HMAC base64 credential string.
getSymbolLayerIdFromCode(String code) → String
Maps a layer code (e.g. 'vn-industrial-zones' or 'VN_INDUSTRIAL_ZONES') to the corresponding server-side symbol layer ID (e.g. 'sharemap-poi-industrial-zone'). Returns empty string if no mapping is found.
loadAndProcessStyle(String styleUrl, String? xApiKey, {String? secretKey, String? businessId, List<String>? layerCodes, int? tileCacheBuster, ShareMapMode mode = ShareMapMode.prod, double? minZoom, String? languageCode}) → Future<String>
Fetches style JSON from styleUrl, updates custom layer tiles and optional minzoom, and returns the modified style as a raw JSON string. The style request uses xApiKey in its header; MapLibre's transformRequest authenticates resources requested after the style has loaded.