> For the complete documentation index, see [llms.txt](https://docs.mapbox.com/android/ja/maps/llms.txt)

# Raw Source/Layer

![Use a JSON string as an Source/Layer.](https://docs.mapbox.com/android/ja/assets/ideal-img/maps-examples-raw-source-layer.6867fc3.480.png)

This example demonstrates the conversion of raw source and layer JSON objects with the **Mapbox Maps SDK for Android**.

The code below parses a [`GeoJSON`](https://docs.mapbox.com/help/glossary/geojson/) source and a circle layer that represents a [`Point`](https://docs.mapbox.com/help/glossary/point/) and converts them both to a `Value` object, using the [`Value.fromJson`](https://docs.mapbox.com/android/maps/api/latest/mapbox-maps-android/com.mapbox.bindgen/-value/from-json.html) function. This creates a circle layer at a specified set of coordinates, while giving the ability to create a circle layer with certain styling properties such as color and radius.

> **Note: Android Examples App Available**
> 
> This example code is part of the **Maps SDK for Android Examples App**, a working Android project [available on GitHub](https://github.com/mapbox/mapbox-maps-android/tree/v11.35.2/). Android developers are encouraged to run the examples app locally to interact with this example in an emulator and explore other features of the Maps SDK.
> 
> See our [Run the Maps SDK for Android Examples App](https://docs.mapbox.com/help/tutorials/maps-sdk-android-examples-app/) tutorial for step-by-step instructions.

**Kotlin**

Title: `RawSourceLayerActivity.kt`

[View on GitHub](https://github.com/mapbox/mapbox-maps-android/blob/v11.35.2/app/src/main/java/com/mapbox/maps/testapp/examples/RawSourceLayerActivity.kt)

```kt
package com.mapbox.maps.testapp.examples

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.mapbox.bindgen.Value
import com.mapbox.geojson.Point
import com.mapbox.maps.CameraOptions
import com.mapbox.maps.MapView
import com.mapbox.maps.Style

/**
 * Example showcasing raw source/layer json conversion support through the Value API.
 *
 * Source:
 * ```
 * {
 *    "type": "geojson",
 *    "data": {
 *        "type": "Feature",
 *        "geometry": {
 *        "type": "Point",
 *          "coordinates": [-77.032667, 38.913175]
 *        },
 *        "properties": {
 *          "title": "Mapbox DC",
 *          "marker-symbol": "monument"
 *        }
 *    }
 * }
 * ```
 *
 * Layer:
 * ```
 * {
 *    "id": "custom",
 *    "type": "circle",
 *    "source": "source",
 *    "source-layer": "",
 *    "layout": {},
 *    "paint": {
 *        "circle-radius": 20,
 *        "circle-color": "#FF3300",
 *        "circle-pitch-alignment": "map"
 *    }
 * }
 * ```
 */
class RawSourceLayerActivity : AppCompatActivity() {

  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    val mapView = MapView(this)
    setContentView(mapView)
    mapView.mapboxMap.apply {
      setCamera(
        CameraOptions.Builder()
          .center(Point.fromLngLat(-77.032667, 38.913175))
          .zoom(16.0)
          .build()
      )
      loadStyle(Style.STANDARD) { addGeoJsonSource(it) }
    }
  }

  private fun addGeoJsonSource(style: Style) {
    val source = Value.fromJson(
      """
        {
          "type": "geojson",
          "data": {
            "type": "Feature",
            "geometry": {
              "type": "Point",
              "coordinates": [-77.032667, 38.913175]
            },
            "properties": {
              "title": "Mapbox Garage",
              "marker-symbol": "monument"
            }
          }
        }
      """.trimIndent()
    )

    if (source.isError) {
      throw RuntimeException("Invalid GeoJson:" + source.error)
    }

    val expected = style.addStyleSource("source", source.value!!)
    if (expected.isError) {
      throw RuntimeException("Invalid GeoJson:" + expected.error)
    }

    val layer = Value.fromJson(
      """
        {
            "id": "custom",
            "type": "circle",
            "source": "source",
            "source-layer": "",
            "layout": {},
            "paint": {
                "circle-radius": 20,
                "circle-color": "#FF3300",
                "circle-pitch-alignment": "map"
            }
        }
      """.trimIndent()
    )

    if (layer.isError) {
      throw RuntimeException("Invalid GeoJson:" + layer.error)
    }

    val expectedLayer = style.addStyleLayer(layer.value!!, null)

    if (expectedLayer.isError) {
      throw RuntimeException("Invalid GeoJson:" + expectedLayer.error)
    }
  }
}
```