How to use the @capacitor/core.HapticsImpactStyle.Heavy function in @capacitor/core

To help you get started, we’ve selected a few @capacitor/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DoFabien / OsmGo / src / app / services / map.service.ts View on Github external
this.map.on('click', async (e) => {
      const features = this.map.queryRenderedFeatures(e.point, { layers: ['marker', 'marker_changed', 'icon-change'] });
      if (!features.length) {
        return;
      }

      if (this.configService.deviceInfo.platform === 'web'){
        window.navigator.vibrate(50);
      }else {
    
        Haptics.impact(  {
          style: HapticsImpactStyle.Heavy
        });
    
      }



      const uniqFeaturesById = uniqBy(features, o => o['properties']['id']);

      if (uniqFeaturesById.length > 1) {
        const inputsParams: any = uniqFeaturesById.map((f, i) => {
          const tags = JSON.parse(f['properties'].tags);
          const pk = JSON.parse(f['properties'].primaryTag);
          const name = tags.name || '?';
          const label = `${name}  (${pk.k} = ${pk.v})`;
          return {
            type: 'radio',
github ionic-team / capacitor / example / src / pages / haptics / haptics.ts View on Github external
  hapticsImpact(style = HapticsImpactStyle.Heavy) {
    Plugins.Haptics.impact({
      style: style
    });
  }