Select platform: [Android](https://developers.google.com/maps/documentation/android-sdk/utility/kml.md.txt "View this page for the Android platform docs.") [iOS](https://developers.google.com/maps/documentation/ios-sdk/utility/kml.md.txt "View this page for the iOS platform docs.") [JavaScript](https://developers.google.com/maps/documentation/javascript/kml.md.txt "View this page for the JavaScript platform docs.")

<br />

> [!WARNING]
> **[Deprecated:](https://developers.google.com/maps/deprecations.md.txt)**
> The `KmlLayer` functionality in the Maps JavaScript API is no longer
> available. Use alternative methods to display KML data on the map. See the
> [KML Layer Migration Guide](https://developers.google.com/maps/comms/kml-layer-migration.md.txt) for
> details.

## Data-driven styling for datasets

You can upload your KML data as a dataset and use data-driven styling to
display it on the map. This approach offers better performance and more
styling options.

To get started with datasets, read the [Datasets Overview](https://developers.google.com/maps/documentation/javascript/dds-datasets/overview.md.txt).

## Third-party libraries

You can also use third-party libraries to parse KML files in the browser and
display the data using the Maps JavaScript API's
[Data layer](https://developers.google.com/maps/documentation/javascript/datalayer.md.txt) or other overlays.

Popular third-party libraries for parsing KML include:

- [togeojson](https://github.com/mapbox/togeojson) (converts KML to GeoJSON)
- [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser)

Once you have converted the KML data to GeoJSON, you can load it into the
Data layer using `map.data.addGeoJson()`.