I have created modal that loads with default lat-long so when I open the modal it automatically loads that location. I have added a GPS button that can give me the user's current location. Both are in different functions, but now I want current location when modal opens. If I do that, search bar not working with find other location.
function initMap(lat, lng){
if (lat & lng) {
lat = parseFloat(lat)
lng = parseFloat(lng)
} else {
lat = -72.43234
lng = 1.23423
}
}
if user getLocation()
then it will fetch current location, but it will never retrieve other location in map.
function initMap(lat, lng){
if (lat & lng) {
lat = parseFloat(lat)
lng = parseFloat(lng)
} else {
getLocation()
}
}
getLocation() {
// code for current location html5
}