mirocow\yandexmaps\Api
mirocow\yandexmaps\Map
mirocow\yandexmaps\Canvas
mirocow\yandexmaps\JavaScript
mirocow\yandexmaps\Placemark
mirocow\yandexmaps\Polyline
- TODO: Geo XML
- TODO: GeoObject
- TODO: Balloon
- TODO: Hint
- TODO: Clusterer
Application components which register scripts.
Usage
Attach component to application (e.g. edit config/main.php):
'components' => [
'yandexMapsApi' => [
'class' => 'mirocow\yandexmaps\Api',
]
],
Map instance.
Usage
$map = new YandexMap('yandex_map', [
'center' => [55.7372, 37.6066],
'zoom' => 10,
// Enable zoom with mouse scroll
'behaviors' => array('default', 'scrollZoom'),
'type' => "yandex#map",
],
[
// Permit zoom only fro 9 to 11
'minZoom' => 9,
'maxZoom' => 11,
'controls' => [
"new ymaps.control.SmallZoomControl()",
"new ymaps.control.TypeSelector(['yandex#map', 'yandex#satellite'])",
],
]
);
This is widget which render html tag for your map.
Usage
Simple add widget to view:
use mirocow\yandexmaps\Canvas as YandexMaps;
echo YandexCanvas::widget([
'htmlOptions' => [
'style' => 'height: 400px;',
],
'map' => $map,
]);
for (var i in map_point) {
points[i] = new ymaps.GeoObject({
geometry : {
type: 'Point',
coordinates : [map_point[i]['lat'],map_point[i]['lng']]
},
properties : {
balloonContentBody : map_point[i]['body']
// hintContent : 'подробнее'
}
},
{
iconImageHref: '/i/' + map_point[i]['spec']+'.png',
iconImageSize: [29,29],
balloonIconImageHref: '/i/' + map_point[i]['spec']+'.png',
balloonIconImageSize: [29,29],
hasBalloon: true
});
}
var clusterer = new ymaps.Clusterer();
clusterer.add(points);
map.geoObjects.add(clusterer);