Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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',
hapticsImpact(style = HapticsImpactStyle.Heavy) {
Plugins.Haptics.impact({
style: style
});
}