Skip to content

Compass example has limited browser support #144

Description

@mike-000

The compass example depends on the requestPermission method which currently has limited browser support. On other browsers/devices either no extra permissions are needed or a request is triggered by window.addEventListener('deviceorientation'). A more generic solution which maintains the existing structure might look like

if (window.DeviceOrientationEvent) {
  locate.addEventListener('click', function () {
    Promise.resolve(
      typeof DeviceOrientationEvent.requestPermission === 'function'
        ? DeviceOrientationEvent.requestPermission()
        : ''
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions