RegisterPackage after RegisterScript


I have a package that requires Google Map library. And I implemented it like this in the view.

<?php Yii::app()->clientScript->registerScriptFile('' . Yii::app()->language . '&region='.Yii::app()->language, CClientScript::POS_HEAD); ?>

<?php Yii::app()->clientScript->registerPackage('somelibrary'); ?>

But in the output, the package is always placed above the google maps.

<script type="text/javascript" src="/project/assets/74e60422/somelibrary.js"></script>

<script type="text/javascript" src=";language=id&amp;region=id"></script>

Is there any solution to make the google maps library as the package dependency? Or, at least, how to place the ‘somelibrary’ package right after the google maps (not far below).?


I also posted here :)