if (!navigator.geolocation) {
//no access to read location data
}
else{
navigator.geolocation.getCurrentPosition(function(position) {
var latitude = position.coords.latitude ;
var longitude = position.coords.longitude ;
//send these cordinates to backend.
}.bind(this),function(error){
//ignore the error .. something wrong with lcaiton service
}.bind(this));
}
select
(NEW ST_POINT('POINT(25.261515 55.366487)',4326).ST_DISTANCE(NEW ST_POINT('POINT(25.201272 55.274903)',4326),'meter'))/1000 as Distance
from dummy ;
METHOD get_customers_nearby BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT using KNA1 .
LT_KNA1_DATA =
select KUNNR ,
LZONE ,
NAME1 ,
NAME2 ,
cast( NEW ST_POINT('POINT(' || ZLAT || ' ' || ZLONG || ')',4326).
ST_DISTANCE(NEW ST_POINT('POINT(' || :LATITUDE || ' ' || :LONGITUDE || ')',4326)) as integer )
as DISTANCE_IN_M
from KNA1 where LZONE = :ROUTE and ZLAT != '' and ZLONG != '';
LT_KNA1 = select KUNNR ,
LZONE ,
NAME1 ,
NAME2 ,
DISTANCE_IN_M
from :LT_KNA1_DATA
where
DISTANCE_IN_M <= :DISTANCEINM
order by DISTANCE_IN_M asc;
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 |