Get Current Latitude Longitude

Faizeal Mohamed
Tera Guru

Hi,

Can we get the current position latitude and longtude through scripts?

I can see geolocation is getting the current location, but i need to get lat long through script

Any idea?

 

Thanks,

7 REPLIES 7

Here also we need to pass the streetname as paramater  in the API to get the lat long.

The google geocoding service does the best it can with the information passed to it (I think it does a pretty good job honestly).  Here are some actual responses from their geocoding api in this format [searchPassedToApi]:  latitude, longitude;

 

1100 Congress Ave, Austin, TX United States: 30.2747025, -97.7403448
Congress Ave, Austin, TX United States: 30.2718005, -97.74143319999999
Austin, TX United States: 30.267153, -97.7430608
TX United States: 31.9685988, -99.9018131
United States: 37.09024, -95.712891

Can you clarify a little more what you are trying to do?  In your original question; is current location the location of a user (their device or browser) or is current location the cmn_location record that is associated with the user?

Hi,

 

As we are using Field Services, when the user do update the task in mobile device we need to grab the location automatically. Its not abou cmn_location.

As i can see when user logged in to mobile, the system capture the mobile device infomation in the table sys_mobile_devices with latitude /longiture where the device logged in, the same logic i want to get the latitude longitude when we do update the task on mobile

For geolcation API we need to pass the street name to get Lat/Long.

I need is there any OOB script available to get the latitude longitude ?