Posts

Image
Google Maps with Autocomplete and Location Enable/ Disable I n this blog, I will show you how to integrate google map into our application and display maps depending on enabling and disabling of location on your mobile/system. Also change the location dynamically when user enters a location in google autocomplete text box. 1)Add Google API Key as shown below: <script src=" https://maps.googleapis.com/maps/api/js?libraries=places&key= API KEY "></script> 2) Add angular directive( googleplace ) for autocomplete in App.js: MY_APP.directive('googleplace', function() { return { require : 'ngModel', link : function(scope, element, attrs, model) { var options = { types : [] }; scope.gPlace = new google.maps.places.Autocomplete(element[0], options); google.maps.event.addListener(scope.gPlace, 'place_changed', function() { scope.$apply(function() {