Initial commit
Co-Authored-By: kotte <14197736+mrtamagotchi@users.noreply.github.com> Co-Authored-By: mikaeltellhed <2311083+mikaeltellhed@users.noreply.github.com> Co-Authored-By: Tore Knudsen <18231882+torekndsn@users.noreply.github.com> Co-Authored-By: Michael Cartner <32543275+michaelcartner@users.noreply.github.com>
|
After Width: | Height: | Size: 152 KiB |
|
After Width: | Height: | Size: 2.5 MiB |
|
After Width: | Height: | Size: 554 KiB |
BIN
static/library/modules/mapbox/guides/interacting/interacting.zip
Normal file
BIN
static/library/modules/mapbox/guides/interacting/nodes-1.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
static/library/modules/mapbox/guides/interacting/nodes-2.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 64 KiB |
BIN
static/library/modules/mapbox/guides/interacting/screen-1.png
Normal file
|
After Width: | Height: | Size: 246 KiB |
BIN
static/library/modules/mapbox/guides/interacting/screen-2.png
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
static/library/modules/mapbox/guides/interacting/state-2.png
Normal file
|
After Width: | Height: | Size: 293 KiB |
|
After Width: | Height: | Size: 84 KiB |
@@ -0,0 +1,34 @@
|
||||
# Getting Screen Coordinates of Markers
|
||||
|
||||
This snippet is useful if you want to position something, for example a Noodl Component, on top of a Marker on the Mapbox Map.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## How it works
|
||||
|
||||
Create a [Function](/nodes/javascript/function/) node and paste in the code below
|
||||
|
||||
```javascript
|
||||
const markers = document.querySelectorAll('.mapboxgl-marker')
|
||||
|
||||
if (!markers) return
|
||||
|
||||
for (let i = 0; i < markers.length; i++) {
|
||||
let m = markers[i]
|
||||
let markerId = m.getAttribute('data-ndl-marker-id')
|
||||
let rect = m.getBoundingClientRect()
|
||||
|
||||
Noodl.Object.get(markerId).setAll({
|
||||
posX: rect.left,
|
||||
posY: rect.top,
|
||||
})
|
||||
}
|
||||
|
||||
Outputs.done()
|
||||
```
|
||||
|
||||
When calling **Run** on the **Function** node the screen coordinates will be written to the Marker array, in the two properties `posX` and `posY`. After the operation is finished the **Done** output signal will be triggered.
|
||||
|
After Width: | Height: | Size: 555 KiB |
|
After Width: | Height: | Size: 129 KiB |
BIN
static/library/modules/mapbox/guides/screenshot/nodeGraph.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
static/library/modules/mapbox/guides/setting-up/module-1.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
static/library/modules/mapbox/guides/setting-up/no-token.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
static/library/modules/mapbox/guides/setting-up/nodepicker-1.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
static/library/modules/mapbox/guides/setting-up/screen-1.png
Normal file
|
After Width: | Height: | Size: 662 KiB |
BIN
static/library/modules/mapbox/guides/setting-up/token-1.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
static/library/modules/mapbox/guides/styles/preview.png
Normal file
|
After Width: | Height: | Size: 759 KiB |
BIN
static/library/modules/mapbox/guides/styles/video-nodegraph.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/button-1.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 20 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/markers-1.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/markers.zip
Normal file
BIN
static/library/modules/mapbox/guides/using-markers/nodes-1.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/nodes-2.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/nodes-3.png
Normal file
|
After Width: | Height: | Size: 81 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/nodes-4.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/nodes-5.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/nodes-6.png
Normal file
|
After Width: | Height: | Size: 127 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/nodes-7.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/panel-1.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/panel-2.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/screen-2.png
Normal file
|
After Width: | Height: | Size: 566 KiB |
BIN
static/library/modules/mapbox/guides/using-markers/screen-3.png
Normal file
|
After Width: | Height: | Size: 793 KiB |