getStyleUrl static method

String getStyleUrl(
  1. String name
)

Returns the complete style URL for MapLibre based on the given style name.

Supported names: 'th', 'en', 'dark', 'gray'.

Implementation

static String getStyleUrl(String name) {
  if (!styles.containsKey(name)) {
    throw PowerMapException(
      code: PowerMapException.invalidRequest,
      message:
          'Invalid style name: "$name". Supported styles are: ${styles.keys.join(", ")}',
    );
  }
  final styleName = styles[name]!;
  return '${PowerMapSDK.baseUrl}/api/v2/map/vtile/styles?name=$styleName&apikey=${PowerMapSDK.mapApiKey}';
}