Getting an error :
Google Maps JavaScript API error: InvalidKeyMapError
https://developers.google.com/maps/documentation/javascript/error-messages#invalid-key-map-error
angular.module('myApp').
controller('dashboardController', function ($scope, $http, $sessionStorage, $window, $location, useragent) {
var apiUrl = "http://stagingserver:85/EBSApi";
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (p) {
var latlng = new google.maps.LatLng(p.coords.latitude, p.coords.longitude);
var geocoder = geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'latLng': latlng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[1]) {
$window.alert(
"Location: " + results[1].formatted_address +
"\nLatitude : " + p.coords.latitude +
"\nLongitude : " + p.coords.longitude);
}
}
});
});
} else {
alert('Geo Location feature is not supported in this browser.');
}
});