private function doVectorEncode($type, Vector $vector, Encoder $builder)
    {
        return sprintf(
            '%s = L.%s(%s, %s);',
            $builder->encodeReference($vector),
            $type,
            $builder->encodeArray($vector->getLatLngs()),
            $builder->encodeValue($vector->getOptions())
        );
    }