Sha256: 3a07a92186e638eaf889ad294d91c349bf79aee926610faad6a14057bd885260

Contents?: true

Size: 343 Bytes

Versions: 1

Compression:

Stored size: 343 Bytes

Contents

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
      # alert self.inspect
    end.rescue do |err|
      p  err
      localisation = nil
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
atome-0.4.5.4 lib/atome/renderers/opal/extensions/geolocation.rb