Category : geolocation

https://geolocation-db.com/jsonp/ trying to access live location from this link using jqury but i give following error callback({"country_code":"Not found","country_name":"Not found","city":"Not found","postal":"Not found","latitude":"Not found","longitude":"Not found","IPv4":"IP Not found","state":"Not found"}) kindly help me with issue its working fine on my friends laptop basically i have integrated it in my php project Source: Ask Javascript..

Read more

I developed a map with OpenStreetMap that should locate my current position. On desktop all working fine, but when I switch to mobile phone he doesn’t ask for GPS permissions and it doesn’t work. After creating the map (on phone it displays error): function init() { createMap(‘map’); navigator.geolocation.watchPosition(success, error, options); } function createMap(id) { map ..

Read more

I added an OpenStreetMap map on my project using Leaflet. I wanted to disable scrolling on mobiles and wheel scroll on desktops. I used the following options found here and managed to achieve this. const mymap = L.map(‘theMap’, { dragging: !L.Browser.mobile, //disables dragging on mobiles tap: !L.Browser.mobile, // mobile functionality?? scrollWheelZoom: false //disables wheel scrolls ..

Read more

I’m trying to grab the latitude and longitude of visitors to my site. However, for some reason, I’m not getting anything from getCurrentPosition(). Here is my current code: const successCb = (position) => { console.log(position); } const errorCb = (error) => { console.error(error); } window.addEventListener("load", () => { navigator.geolocation.getCurrentPosition(successCb, errorCb); }); So from my understanding, ..

Read more