Using a markGeoshape as a location picker

Using vega-lite-api, I’d like to use a markGeoshape as a “picker” to select a spot via click and make that lat/lon available to the rest of the Notebook.

Sadly, I can’t even see how to let the markGeoshape’s vl.tooltip() display the lat/lon, let alone get that info “out”.

Simple example starter page here: https://observablehq.com/@kpm-at-hfi/map-tooltip-and-click-question

Any thoughts?

I’m afraid I don’t have the time to help get the Vega-Lite version working just at the moment — although I’m sure it’s possible, but I just wanted to let you know that the Inputs Bazaar has US and World map longitude/latitude pickers. They might help you get something up and running quickly.

import {usaMapCoordinates} from "@jashkenas/inputs"

3 Likes

Off topic:

I love your inputs bazaar. I should just invest the time to do it myself… but… could we somehow further ‘internationalize’ inputs? Something hauntingly intriguing like showing a country input to a user based on the registered location of that user’s IP address [or any other way to further diversity the focus of many of the example maps]?

PS - That red dot from the screenshot was definitely not NYC. :stuck_out_tongue:

Related: This notebook uses a Vega-lite chart’s brush filter to drive the notebook’s visualization.

1 Like

I ended up using the nice inputs from @jashkenas since I only needed a quick picker for some proof of concept work.

Thanks all! :slight_smile: