0

I'm working in angularjs. Yesterday map was showing location as well as marker to me. Today when I opened my map error thrown that "Unable to get location. Network location provider at 'https://www.googleapis.com/': returned error code 403. " My Html :

<div> 
    <ng-map class="MapStyle"
            id="map-canvas"
            center="[21.145800,79.088155]"  
            default-style="false"
            zoom="13"
    ></ng-map>
</div>

My Controllers js

var options ={enableHighAccuracy: true };
        navigator.geolocation.getCurrentPosition(function(pos) {
        $scope.position = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude);
        console.log(pos.coords.latitude);
        var pointA = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude),
        myOptions = {
           zoom: 8,
           center: pointA,
           mapTypeId: google.maps.MapTypeId.ROADMAP
        },
        map = new google.maps.Map(document.getElementById('map-canvas'), myOptions),
        markerA = new google.maps.Marker({
            position: pointA,
            title: "point A",
            label: "",
            map: map
        })              
        }, 
        function(error) {                    
        alert('Unable to get location: ' + error.message);
        }, options);

Please help me to fix. Thank you.

1 Answers1

0

Please add SSL certificate to your apache. I tried to open my file with both ways local host as well as Ip address. Difference is when i tried with ip address I got warning in console about certificate. Though add SSL certificate.