public function encodeGeoJson(GeoJson $geoJson, Encoder $encoder)
    {
        $buffer = sprintf(
            '%s = L.geoJson(%s, %s);',
            $encoder->encodeReference($geoJson),
            $encoder->encodeValue($geoJson->getInitializationData()),
            $encoder->encodeValue($geoJson->getOptions())
        );

        foreach ($geoJson->getLayers() as $layer) {
            $buffer .= "\n" . sprintf(
                '%s.addLayer(%s);',
                $encoder->encodeReference($geoJson),
                $encoder->encodeReference($layer)
            );
        }

        return $buffer;
    }