---
title: "decode(_:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkgeojsondecoder/decode(_:)"
---

# decode(_:)

Decodes the provided data into native MapKit types that a map can display.

## Declaration

```swift
func decode(_ data: Data) throws -> [any MKGeoJSONObject]
```

## Parameters

- `data`: An doc://com.apple.documentation/documentation/Foundation/NSData object that contains the JSON to decode.

## Return Value

Return Value An array of MKGeoJSONObject objects, or an error if the decoder encounters an issue.
