Координаты при инициализации карты
This commit is contained in:
parent
df18afd519
commit
4e05436a39
|
|
@ -64,6 +64,9 @@ class IndexController extends Controller
|
|||
App::setConfig('title', $res['pointsCount'] . ' или даже больше поводов не сидеть дома');
|
||||
self::addVar('pointsCount', $res['pointsCount']);
|
||||
|
||||
self::addVar('pointLat', 0);
|
||||
self::addVar('pointLng', 0);
|
||||
|
||||
if (isset($_GET['point']) && $_GET['point'] && is_numeric($_GET['point']))
|
||||
{
|
||||
$id = (int) $_GET['point'];
|
||||
|
|
@ -75,6 +78,9 @@ class IndexController extends Controller
|
|||
$point->descriptionHtml .= ' #wikipoints';
|
||||
|
||||
$og = Helper::buildOG($point);
|
||||
|
||||
self::addVar('pointLat', $point->lat);
|
||||
self::addVar('pointLng', $point->lng);
|
||||
} else if (isset($_GET['point']) && $_GET['point'] && strtolower($_GET['point']) == 'random')
|
||||
{
|
||||
$og = array();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,12 @@ categories.im = L.icon({
|
|||
ymaps.ready(function () {
|
||||
lat = ymaps.geolocation.latitude;
|
||||
lng = ymaps.geolocation.longitude;
|
||||
|
||||
if (pointLat == pointLng) {
|
||||
init(lat, lng);
|
||||
} else {
|
||||
init(pointLat, pointLng);
|
||||
}
|
||||
|
||||
points.im = L.marker([lat, lng], {icon: categories.im, title: 'Вы здесь'});
|
||||
points.im.addTo(myMap);
|
||||
|
|
|
|||
Loading…
Reference in New Issue