What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-01 07:30:17
react native location
// npm install @react-native-community/geolocation // npx react-native link @react-native-community/geolocation import Geolocation from '@react-native-community/geolocation'; Geolocation.getCurrentPosition(info => console.log(info)); Add solution -
Javascript 2021-11-11 23:23:13
React native user based location
import { NativeModules, DeviceEventEmitter, PermissionsAndroid } from 'react-native' import Config from 'react-native-config' import get from 'lodash/get' const { GeoLocation } = NativeModulesclass BackgroundGeoLocation { constructor(token, user_id)... Add solution -
Javascript 2021-11-10 03:39:25
permission api js
navigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.state == 'granted') { showLocalNewsWithGeolocation(); } else if (result.state == 'prompt') { showButtonToEnableLocalNews(); } // Don't do anything if the permis... Add solution -
Other 2021-11-09 20:30:21
how to add feature policy header
//Add this in the .htaccess file. <IfModule mod_headers.c> Header always set Permissions-Policy "geolocation=(), midi=(),sync-xhr=(),accelerometer=(), gyroscope=(), magnetometer=(), camera=(), fullscreen=(self)" </IfModule> Add solution -
Shell/Bash 2021-11-07 18:29:11
open longitude and latitude in ionic
import { Geolocation } from '@ionic-native/geolocation/ngx'; ... constructor(private geolocation: Geolocation) {} ... this.geolocation.getCurrentPosition().then((resp) => { // resp.coords.latitude // resp.coords.longitude }).catch((error) => {... Add solution -
Javascript 2021-11-07 01:26:18
jquery get location of user
$("#find_btn").click(function () { //user clicks button if ("geolocation" in navigator){ //check geolocation available //try to get user current location using getCurrentPosition() method navigator.geolocation.getCurrentPosition(... Add solution