Sha256: 6659c2b6cba3d8afc3085a4873bd2c694a130a250013b469cdab98cc96a4f4a1

Contents?: true

Size: 346 Bytes

Versions: 73

Compression:

Stored size: 346 Bytes

Contents

# frozen_string_literal: true

class Atome
  def geolocation
    localisation = {latitude: nil, longitude: nil}
    $window.navigator.geolocate.then do |pos|
      localisation[:latitude] =  pos.coords.latitude
      localisation[:longitude] =  pos.coords.longitude
    end.rescue do |err|
      p  err
      localisation = nil
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
atome-0.5.7.3.9 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.3.6 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.3.5 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.3.3 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.3.2 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.3.1 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.3.0 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.1.8 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.1.7 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.1.0 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.0.7 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.0.5 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.0.4 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.0.3 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.7.0.2 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.6.8.7 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.6.8.6 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.6.8.5 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.6.8.3 lib/platform_specific/opal/extensions/geolocation.rb
atome-0.5.6.7.8 lib/platform_specific/opal/extensions/geolocation.rb