From 4ee76734de1d426df88a2a4791391909cd1a8597 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sat, 14 Sep 2024 00:07:12 +0800 Subject: Update --- snippets/html_leaflet | 9 +++++++++ snippets/html_maplibre_cdn | 1 + snippets/javascript_promise | 3 +++ snippets/javascript_terrdraw | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 snippets/html_leaflet create mode 100644 snippets/html_maplibre_cdn create mode 100644 snippets/javascript_promise create mode 100644 snippets/javascript_terrdraw (limited to 'snippets') diff --git a/snippets/html_leaflet b/snippets/html_leaflet new file mode 100644 index 0000000..7b434c1 --- /dev/null +++ b/snippets/html_leaflet @@ -0,0 +1,9 @@ + + + + + diff --git a/snippets/html_maplibre_cdn b/snippets/html_maplibre_cdn new file mode 100644 index 0000000..4dc2b17 --- /dev/null +++ b/snippets/html_maplibre_cdn @@ -0,0 +1 @@ + diff --git a/snippets/javascript_promise b/snippets/javascript_promise new file mode 100644 index 0000000..12128a7 --- /dev/null +++ b/snippets/javascript_promise @@ -0,0 +1,3 @@ +new Promise((resolve, reject) => { + +}) diff --git a/snippets/javascript_terrdraw b/snippets/javascript_terrdraw new file mode 100644 index 0000000..17363b1 --- /dev/null +++ b/snippets/javascript_terrdraw @@ -0,0 +1,32 @@ +// Events +draw.on("finish", (id: string, context: { action: string, mode: string }) => { + if (action === 'draw') { + // Do something for draw finish event + } else if (action === 'dragFeature') { + // Do something for a drag finish event + } else if (action === 'dragCoordinate') { + // + }else if (action === 'dragCoordinateResize') { + // + } +}); + +draw.on("change", (ids: string[], type: string) => { + // Possible type values: + // 'create' + // 'update' + // 'delete' + // 'styling' + // Do something + //... +}); + +draw.on("select", (id: string) => { + // Do something + //... +}); + +draw.on("deselect", () => { + // Do something + //... +}); -- cgit v1.2.3-70-g09d2