diff --git a/frontend/assets/AppAsset.php b/frontend/assets/AppAsset.php index a838146..9bf2a13 100644 --- a/frontend/assets/AppAsset.php +++ b/frontend/assets/AppAsset.php @@ -21,15 +21,15 @@ 'css/custom.css', ]; public $js = [ - '/js/jquery.cookie.js', - '/js/waypoints.min.js', - '/js/jquery.counterup.min.js', - '/js/jquery.parallax-1.1.3.js', - '/js/front.js', - '/js/owl.carousel.min.js', + 'js/jquery.cookie.js', + 'js/waypoints.min.js', + 'js/jquery.counterup.min.js', + 'js/jquery.parallax-1.1.3.js', + 'js/front.js', + 'js/owl.carousel.min.js', + '//maps.googleapis.com/maps/api/js?key=AIzaSyCgyPQhOmGEwyAdZ0uS6fJLLvnNxgncfy0&callback=initMap', '/js/gmaps.init.js', - '//maps.google.com/maps/api/js?key=AIzaSyCmojIzU4lFDnNUQymI35wxbiNDME-4l_Y', - '/js/script.js', + 'js/script.js', ]; public $depends = [ 'yii\web\YiiAsset', diff --git a/frontend/web/js/gmaps.init.js b/frontend/web/js/gmaps.init.js index 52511a4..ec262ef 100644 --- a/frontend/web/js/gmaps.init.js +++ b/frontend/web/js/gmaps.init.js @@ -1,12 +1,30 @@ +$( + function() { -function initMap() { - var uluru = {lat: 50.4416887, lng: 30.5175961}; - var map = new google.maps.Map(document.getElementById('map'), { - zoom: 4, - center: uluru - }); - var marker = new google.maps.Marker({ - position: uluru, - map: map - }); -} \ No newline at end of file + function initMap() { + var myLatLng = { + lat: 50.4416887, + lng: 30.5175961 + }; + + var map = new google.maps.Map( + document.getElementById('map'), { + center: myLatLng, + scrollwheel: false, + zoom: 16 + } + ); + + var marker = new google.maps.Marker( + { + position: myLatLng, + map: map, + title: 'Hello World!' + } + ); + + } + + window.initMap = initMap(); + } +); -- libgit2 0.21.4