From 416632c2110aaf202a0f226a8767450fc4dbeefb Mon Sep 17 00:00:00 2001 From: rot1024 Date: Mon, 5 Feb 2024 16:55:01 +0900 Subject: [PATCH 1/2] feat: support line string and point click (#13) --- src/index.ts | 42 +++++++++++++++++++++++++++++++++++++----- src/util.ts | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 src/util.ts diff --git a/src/index.ts b/src/index.ts index b09446d..4b6ada6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,6 +16,7 @@ import { import Pbf from "pbf"; import { isFeatureClicked } from "./terria"; +import { isLineStringClicked, isPointClicked } from "./util"; const defaultParseTile = async (url?: string) => { const ab = await fetchResourceAsArrayBuffer(url); @@ -25,6 +26,8 @@ const defaultParseTile = async (url?: string) => { const tile = parseMVT(ab); return tile; }; +const defaultPickPointRadius = 5; +const defaultPickLineWidth = 5; type TileCoordinates = { x: number; @@ -56,6 +59,8 @@ export type ImageryProviderOption = { style?: FeatureHandler