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;
    }
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;
    }
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 ; }
Encode a feature group.

@param GeoJson $geoJson The layer group.
@param Encoder $encoder The builder.

@return bool
Encode a feature group .