{"size": 1044, "ext": "js", "max_stars_repo_path": "resources/assets/js/home.js", "max_stars_repo_name": "JanAsaulenko/418", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/assets/js/home.js", "max_issues_repo_name": "JanAsaulenko/418", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "resources/assets/js/home.js", "max_forks_repo_name": "JanAsaulenko/418", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.6774193548, "max_line_length": 74, "alphanum_fraction": 0.5842911877}
import $ from 'jquery';
import GoogleMaps from 'google-maps';

GoogleMaps.KEY = 'AIzaSyA05esJ-MwwOjDViI7mZBvbt-wUPkrEoXg';

GoogleMaps.load((google) => {
    const mapNode = document.getElementById('map_interactive');
    if (!mapNode) return;
    const vinnytsia = new google.maps.LatLng(49.234741, 28.472035);
    const map = new google.maps.Map(mapNode, {
        center: vinnytsia,
        zoom: 12,
    });
    let infoWindow = new google.maps.InfoWindow({map: map});
    let geoloc = function () {
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(function (position) {
                let pos = {
                    lat: position.coords.latitude,
                    lng: position.coords.longitude
                };
                console.log(pos);
                infoWindow.setPosition(pos);
                infoWindow.setContent('Location found.');
                map.setCenter(pos);
            })
        }
    };
    document.getElementById("geo").addEventListener("click", geoloc);
});
