Get Visitor Location(lat/long) Using Geolocation in Any Application

  Рет қаралды 1,223

Tech Probie

Tech Probie

2 жыл бұрын

Blog Link: thapliyalravi80.blogspot.com/...
#Geolocation #javascript #API #google console #tutorials #geolocationAPI
*****JS Code ****
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError);
} else {
alert("Geolocation is not supported by this browser.");
}
}
function showPosition(position) {
apex.item("PAGE_ITEM_LAT").setValue(position.coords.latitude)
apex.item("PAGE_ITEM_LONG").setValue(position.coords.longitude)
function geocode_api(){
var latitude = position.coords.latitude
var longitude = position.coords.longitude
var key = "API_KEY"
$.post('maps.googleapis.com/maps/api/..., //get this line code from comment section and replace it with this line as in description it is taking it as link.
function(data, status){
var address = JSON.parse(JSON.stringify(data.results[0].formatted_address))
apex.item("PAGE_ITEM_LOCATION").setValue(address)
// alert("Data: " + data + "
Status: " + status);
});
};
geocode_api();
}
function showError(error) {
switch(error.code) {
case error.PERMISSION_DENIED:
alert("User denied the request for Geolocation.")
break;
case error.POSITION_UNAVAILABLE:
alert("Location information is unavailable.geolocation app tutorial, geolocation, javascript, location")
break;
case error.TIMEOUT:
alert("The request to get user location timed out.")
break;
case error.UNKNOWN_ERROR:
alert( "An unknown error occurred.")
break;
}
}
razorpay payment gateway integration || payment gateway for website
• razorpay payment gatew...
Shopify API Tutorial | Shopify tutorial for beginners || Shopify API get all products || postman API
• shopify API Tutorial |...
PayPal smart payment button for website | PayPal account Kaise banaye | PayPal business account
• How to create paypal a...
oracle apex tutorial for beginners in hindi || step-by-step from starting || oracle apex ✔️
• oracle apex tutorial f...

Пікірлер: 3
@TechProbie
@TechProbie 2 жыл бұрын
$.post('maps.googleapis.com/maps/api/geocode/json?latlng='+latitude+','+longitude+'&key='+key+'',
@usmanAli-hw5xu
@usmanAli-hw5xu Жыл бұрын
sir do we need to buy api key ?
@franzverrelli6500
@franzverrelli6500 2 жыл бұрын
𝕡𝕣𝕠𝕞𝕠𝕤𝕞 👀
Geolocation - Finding Device Location In Oracle APEX
11:18
Tech Mining
Рет қаралды 2,1 М.
HAPPY BIRTHDAY @mozabrick 🎉 #cat #funny
00:36
SOFIADELMONSTRO
Рет қаралды 17 МЛН
THEY made a RAINBOW M&M 🤩😳 LeoNata family #shorts
00:49
LeoNata Family
Рет қаралды 42 МЛН
Scary Teacher 3D Nick Troll Squid Game in Brush Teeth White or Black Challenge #shorts
00:47
Geolocation in Adalo
15:57
adalocado
Рет қаралды 8 М.
Location matters! Map Visualization for APEX developers
1:00:44
Oracle Developers
Рет қаралды 9 М.
How to get GPS Location Latitude and Longitude in Oracle Apex
13:17
APEX EXPRESS
Рет қаралды 1,6 М.
Add geolocation to .NET: Find your client's location easily
10:35
I Melted Wood With Friction
8:44
The Action Lab
Рет қаралды 757 М.
Get GEO Location and Show Map in Oracle Apex # xfactor Oracle Apex
8:55
Oracle APEX - Google Location tracking
13:53
Oracle APEX BD
Рет қаралды 8 М.
HAPPY BIRTHDAY @mozabrick 🎉 #cat #funny
00:36
SOFIADELMONSTRO
Рет қаралды 17 МЛН