Api:
---
Api stands for application programming interface.
fetch:
------
fetch is a predefine function in js,this fetch function having an argument like a
link : [Link] after convert into the json() then we can execute the data in our
loca system.
Ex:
---
fetch('[Link]
// [Link](R1)
[Link]((x)=>{
let p=[Link]('p')
[Link]=[Link]
[Link](p)
})
})
Ex:
---
fetch('[Link]
// [Link](R1)
[Link]((x)=>{
// [Link]([Link])
// if ([Link] == )
let l1=[Link]('li')
[Link]=[Link]
[Link](l1)
})
})
geolocation api:
----------------
geolocation is a api keyword which is getting from the navigator. using this
geolocation api we can work with a three function.
->getCurrentPosition :we can acces the currect position longitude and lagitude.
->watchPosition :we can watch the position if there is any changes will be
happend.
->clearWatch :clear all the position from the present location, unable to
watch the positions.
Ex:
---
if([Link]){
[Link]((position)=>{
[Link]('latitude :',[Link])
[Link]('longitude :',[Link])
},(error)=>{
[Link]([Link])
})
}
Ex:
---
if([Link]){
[Link]((position)=>{
[Link]('latitude :',[Link])
[Link]('longitude :',[Link])
},(error)=>{
[Link]([Link])
})
}
Ex:
---
if([Link]){
let watch=[Link]((position)=>{
[Link]('latitude :',[Link])
[Link]('longitude :',[Link])
},(error)=>{
[Link]([Link])
})
[Link](watch)
}