My Blog

Menu

Google Maps

Posted: November 24, 2021. | By: Admin

Google Maps

i)Get Gps location (https://ionicframework.com/docs/native/geolocation/)
    1)Install Plugins
        a)ionic cordova plugin add cordova-plugin-geolocation     
        b)npm install --save @ionic-native/geolocation    
    2)Get Current Location Latitude and lagintude like below
       this.geolocation.getCurrentPosition().then((resp) => {resp.coords.latitude; resp.coords.longitude;}).catch((error) => {console.log('Error getting    location', error);});
    3)Convert Geocode to Address
        this.geocoder.geocode({'location': latlng }, function (results, status) {if (status == google.maps.GeocoderStatus.OK) {
        var address = (results[0].formatted_address);console.log(results);(document.getElementById('Address')).value = address;}});


ii)Check Location Enable or not (https://ionicframework.com/docs/native/diagnostic/)        
    4)Checks whether device hardware features are enabled or available to the app, e.g. camera, GPS, wifi
        a)ionic cordova plugin add cordova.plugins.diagnostic
        b)npm install --save @ionic-native/diagnostic
    5)Find location enabled or not by following function 
        cordova.plugins.diagnostic.isLocationEnabled(function(enabled){if (enabled != true) {}else{}

About

Aapthi Technologies,Hyderabad offers a complete range of web solutions including web designing, developing, web hosting, Internet marketing and many more. With our electrifying presence, we have swirled the scenario of web solutions. We consistently invigorate our skill-set and tech-expertise and work with a high-level of integrity. Our keen-eye on emerging trends of online business as well as technical spheres has empowered us to render the most innovative solutions. Persistent development is the key drive of Aapthi Technologies, be it in terms of infrastructure, skill-set or technology. Team Aapthi Technologies, is fully committed to render back hundred percent value for the money paid by client.

Social Links

Our Bunker

Plot No -596, Near Reliance Fresh,
Vivekananda nagar colony, Kukatpally,
Hyderabad - 500072, India.