This shows you the differences between two versions of the page.
|
isi:laboratoare:03 [2025/10/17 15:10] sorin.ciolofan [Task] |
isi:laboratoare:03 [2025/10/17 15:22] (current) sorin.ciolofan [Task] |
||
|---|---|---|---|
| Line 46: | Line 46: | ||
| Indicatie: Trebuie diferentiat ce tip de click se intampla: feature/graphic si atunci se deschide popup-ul sau punct obisnuit de pe harta si atunci se continua cu rutarea. Puteti folosi functia [[https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest|hitTest]] in acest scop. | Indicatie: Trebuie diferentiat ce tip de click se intampla: feature/graphic si atunci se deschide popup-ul sau punct obisnuit de pe harta si atunci se continua cu rutarea. Puteti folosi functia [[https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest|hitTest]] in acest scop. | ||
| </note> | </note> | ||
| + | |||
| + | <code> | ||
| + | viewElement.addEventListener("arcgisViewClick", async (event) => { | ||
| + | const view = viewElement.view; | ||
| + | const hit = await view.hitTest(event.detail); | ||
| + | if (hit.results.length > 0 && hit.results[0].graphic.attributes?.PlaceName) { | ||
| + | // deschide popup | ||
| + | ..... | ||
| + | return; // opreste rutarea | ||
| + | } | ||
| + | //continua cu rutarea | ||
| + | ...... | ||
| + | }); | ||
| + | </code> | ||
| **Task 3** | **Task 3** | ||
| Line 109: | Line 123: | ||
| - | ==== Resurse ==== | + | /*==== Resurse ====*/ |