Commit 342529c43d04b9e7b4ac6522b69a8aaac1d4428d
1 parent
4a6b261f
gmap
Showing
3 changed files
with
20 additions
and
37 deletions
Show diff stats
frontend/assets/AppAsset.php
... | ... | @@ -21,15 +21,15 @@ |
21 | 21 | 'css/custom.css', |
22 | 22 | ]; |
23 | 23 | public $js = [ |
24 | - 'js/jquery.cookie.js', | |
25 | - 'js/waypoints.min.js', | |
26 | - 'js/jquery.counterup.min.js', | |
27 | - 'js/jquery.parallax-1.1.3.js', | |
28 | - 'js/front.js', | |
29 | - 'js/owl.carousel.min.js', | |
30 | - '//maps.google.com/maps/api/js?key=AIzaSyCgyPQhOmGEwyAdZ0uS6fJLLvnNxgncfy0', | |
24 | + '/js/jquery.cookie.js', | |
25 | + '/js/waypoints.min.js', | |
26 | + '/js/jquery.counterup.min.js', | |
27 | + '/js/jquery.parallax-1.1.3.js', | |
28 | + '/js/front.js', | |
29 | + '/js/owl.carousel.min.js', | |
31 | 30 | '/js/gmaps.init.js', |
32 | - 'js/script.js', | |
31 | + '//maps.google.com/maps/api/js?key=AIzaSyCmojIzU4lFDnNUQymI35wxbiNDME-4l_Y', | |
32 | + '/js/script.js', | |
33 | 33 | ]; |
34 | 34 | public $depends = [ |
35 | 35 | 'yii\web\YiiAsset', | ... | ... |
frontend/web/css/custom.css
frontend/web/js/gmaps.init.js
1 | -$( | |
2 | - function() { | |
3 | 1 | |
4 | - function initMap() { | |
5 | - var myLatLng = { | |
6 | - lat: parseFloat(window.lat), | |
7 | - lng: parseFloat(window.lon) | |
8 | - }; | |
9 | - | |
10 | - var map = new google.maps.Map( | |
11 | - document.getElementById('map'), { | |
12 | - center: myLatLng, | |
13 | - scrollwheel: false, | |
14 | - zoom: 14 | |
15 | - } | |
16 | - ); | |
17 | - | |
18 | - var marker = new google.maps.Marker( | |
19 | - { | |
20 | - position: myLatLng, | |
21 | - map: map, | |
22 | - title: 'Hello World!' | |
23 | - } | |
24 | - ); | |
25 | - | |
26 | - } | |
27 | - | |
28 | - window.initMap = initMap(); | |
29 | - } | |
30 | -); | |
2 | +function initMap() { | |
3 | + var uluru = {lat: 50.4416887, lng: 30.5175961}; | |
4 | + var map = new google.maps.Map(document.getElementById('map'), { | |
5 | + zoom: 4, | |
6 | + center: uluru | |
7 | + }); | |
8 | + var marker = new google.maps.Marker({ | |
9 | + position: uluru, | |
10 | + map: map | |
11 | + }); | |
12 | +} | |
31 | 13 | \ No newline at end of file | ... | ... |