Yandex Maps ¶
Yii Yandex Maps addition to allowing sozlavat map with labels and lines.
Installation and Setup ¶
Place the extension files in a directory 'extensions' of your application. For example, in a folder yandexmap
'ext.yandexmap.YandexMap'
Use ¶
$this->widget('ext.yandexmap.YandexMap',array(
'id'=>'map',
'width'=>600,
'height'=>400,
'center'=>array(55.76, 37.64),
'placemark' => array(
array(
'lat'=>55.8,
'lon'=>37.8,
'options'=>array(
'balloonContentHeader'=>'header',
'balloonContentBody'=>'body',
'balloonContentFooter'=>'footer',
)
)
),
'polyline' => array(
array('lat'=>55.80,'lon'=>37.30),
array('lat'=>55.80,'lon'=>37.40),
array('lat'=>55.70,'lon'=>37.30),
array('lat'=>55.70,'lon'=>37.40),
'options'=>array(
'strokeWidth'=> 5 // ширина линии'
)
),
));
Use Placemark ¶
Placemark (labels) - can be passed as a single item or a group of elements.
...
'placemark' => array(
'lat'=>55.8,
'lon'=>37.8,
'options'=>array(
'balloonContentHeader'=>'header',
'balloonContentBody'=>'body',
'balloonContentFooter'=>'footer',
)
),
...
group
...
'placemark' => array(
array(
'lat'=>55.8,
'lon'=>37.8,
'options'=>array(
'balloonContentHeader'=>'header',
'balloonContentBody'=>'body',
'balloonContentFooter'=>'footer',
)
),
array(
'lat'=>55.8,
'lon'=>37.8,
'options'=>array(
'balloonContentHeader'=>'header',
'balloonContentBody'=>'body',
'balloonContentFooter'=>'footer',
)
),
),
...
Use Polyline ¶
Polyline (broken lines) - you can peredevat as one item or as Grumm elements. Tocher coordinates given arrays, and can be infinite.
...
'polyline' => array(
array('lat'=>55.80,'lon'=>37.30),
array('lat'=>55.80,'lon'=>37.40),
array('lat'=>55.70,'lon'=>37.30),
array('lat'=>55.70,'lon'=>37.40),
'options'=>array(
'strokeWidth'=> 5 // ширина линии
)
)
...
group
...
'polyline' => array(
array(
array('lat'=>55.80,'lon'=>37.30),
array('lat'=>55.80,'lon'=>37.40),
array('lat'=>55.70,'lon'=>37.30),
array('lat'=>55.70,'lon'=>37.40),
'options'=>array(
'strokeWidth'=> 5 // ширина линии
)
),
array(
array('lat'=>55.80,'lon'=>37.30),
array('lat'=>55.80,'lon'=>37.40),
array('lat'=>55.70,'lon'=>37.30),
array('lat'=>55.70,'lon'=>37.40),
'options'=>array(
'strokeWidth'=> 5 // ширина линии
)
),
),
...
error looks like fine missing...
file_get_contents(C:\wamp\www\demo\/api-maps.yandex.ru/2.0-stable/?load=package.full&lang=ru-RU) [function.file-get-contents]: failed to open stream: No such file or directory
error looks like fine missing...
which line / situation is this error? in addition are not using the file_get_contents
error looks like fine missing...
sorry just change the / to \ in this line and no error so far but also nothing show up on screen.
$cs->registerScriptFile("\\api-maps.yandex.ru\2.0-stable\?". implode("&", $url) );
Still trying to resolve it if there is some thing Im doing wrong.
error looks like fine missing...
API components can be loaded via HTTP, and for HTTPS. If the site supports for both protocols, you can omit the explicit scheme in the src attribute of the element script.
I corrected this flaw to indicate full reference (default http), please download the latest version from github.com
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.