Chevron DownAPI Reference

KMLLoader

The KMLLoader parses KML files into GeoJSON.

LoaderCharacteristic
File Extension.kml
File TypeText
File FormatKML
Data FormatGIS
Decoder TypeSynchronous
Worker Thread SupportNo
Streaming SupportNo

Usage

import {KMLLoader} from '@loaders.gl/kml';
import {load} from '@loaders.gl/core';

const data = await load(url, KMLLoader, options);

Options

OptionTypeDefaultDescription
useLngLatFormatBooleantrueKML longitudes and latitudes are specified as [lat, lng]. This option "normalizes" them to [lng, lat].
useColorArraysBooleantrueConvert color strings to arrays.

Limitations

  • Currently XML parsing is only implemented in browsers, not in Node.js. Check KMLLoader.supported to check at run-time.