score:0
maybe are you facing to an error ?
geo.getcurrentposition(success, () => console.log('error happened !'));
score:1
navigator.geolocation
has multiple drawbacks: it is not always available; it requires the user's consent; while doing so it displays an annoying pop-up; it uses approximation methods that are inconsistent and may give unexpected results; it required https, so it's hard to test on your local development server.
do you have the possibility to test an alternative, see if it works for you and if you don't have error anymore? i suggest a realtime api such as abstract ip location which is free.
you call the api omitting the ip_address
parameter, so it returns the geolocation for the device making the api call. in the response, you get the longitude
and latitude
fields you can use to display the map's marker.
Source: stackoverflow.com
Related Query
- Geolocation API is available and enabled but does not give the coordinates
- I want to change the API request based on button click. The number in the API changes and different data loads but component does not rerender
- Using Metamask but get Error: Returned error: The method eth_sendTransaction does not exist/is not available
- The written link and condition is correct but the page does not move
- Fetch API work on POSTMAN and express server but does not work on React js
- Cors issue i also set the proxy in pkg.json due to cors and set the api according to it but this error is not remove
- Material-UI Dialog Reusable Component Not Working but no error in the console and app does not crash
- My UseEffect either calls an infinite time my API and my data is showing or calls it once but the data is not showing
- React: I have an api fetch and the data stores into my hook state. Why can I console.log the hook object, but not access it?
- google cloud storage image url works fine but when used in the src of an img html file it goes to the alternative and does not show the image
- Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema
- Invalid options object. Dev Server has been initialized using an options object that does not match the API schema
- Eslint react/jsx-one-expression-per-line: allow variables and JSX strings on the same line, but not elements
- Why does jest-dom give the error "TypeError: expect(...).not.toBeVisible is not a function" when I use it
- how to solve the problem of "folly/Portability.h" and "File .../main.jsbundle does not exist" in React Native?
- Webpack error: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema
- ValidationError: Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema
- Error: Hydration failed because the initial UI does not match what was rendered on the server with useSession() and react-bootstrap
- Module not found: can't resolve' redux-thunk ' error I have tried the solutions but it does not happen.What is the solution?
- What is the benefit of having $sce or Strict Contextual Escaping in angularjs and why react does not need to do it?
- Why does my React app append the external URL to http://localhost:/<port> and not to ONLY the URL itself?
- Tooltip component rendering but not visible, and it is not the z-index
- React Router v5: history.push() changes the address bar, but does not change the page
- Why in React, my axios API call has Authorization Header which contains Bearer <token> but not being authorized and gives 401 error
- The arrows does not showing in react slick with 4 and more photos
- <Link> only changes the url when click but not the components and the page
- React-Router push only changes the URL and does not navigate
- API data does not update in production, but works locally
- Why does my img show up when I hardcode the src URL, but not when I assign it programmatically?
- Reactjs Link does not work on IE11 but does on Edge and other browsers
More Query from same tag
- how to export custom array.prototype method from js file in react
- Antd icon type from string in v4
- Reactjs Warning: input is a void element tag and must not have `children` or use `props.dangerouslySetInnerHTML`. Check the render method of null
- Find key by its index number in an object list and replace with new user input value
- Attempting to render Firebase Auth user details through this.setState in React app undefined
- How to show placeholder value on React/Formik Select Component?
- React,Redux cannot read property undefined
- How to get music's info from input type file in ReactJs
- Chart is not displaying updated data
- How to call two function on Mouse over in functional components?
- Adding style stored in a variable inside React class
- Parsing error: Unexpected token = ReactJs
- create react app with express on azure app service fails to start
- React context: consumer do not trigger handlers from provider
- React - Redux - this.props.fetch.map is not a function
- is Valid to Check and Push to another URL within Constructor of React Component?
- Disable or active buttons using reactjs
- React - TypeError: Cannot read property 'toFixed' of null
- Clear Ref in useEffect Cleanup
- Animate movement of React component from one to another
- Implementing smooth scrolling in react
- Component is not being returned in nested loop
- Should you test that all components render without crashing?
- why isnt the flex attribute working in react styled components?
- I can't figure out how to get div with image to obey the height constrains of the parent div
- React JS: How to add classname for react component based on the position in an array?
- I cannot get the About Component to display on React
- react: using es6 component in ts component: ts2605: jsx element type 'yyy' is not a constructor function for jsx elements
- isLoading from useAuth0() is always false
- tooltip div with ReactJS