beyonk-group / svelte-mapbox

MapBox Map and Autocomplete components for Svelte (or Vanilla JS)
MIT License
345 stars 61 forks source link

Is cooperativeGestures parameter supported? #79

Open beazergood opened 1 year ago

beazergood commented 1 year ago

I'd like to use this option for better UX on mobile.

So far I've tried adding it to the Map component as a prop, to the mapComponent object, and as an option, but having no luck.

<Map
  accessToken={PUBLIC_MAPBOX_API_TOKEN}
  style="mapbox://styles/mapbox/outdoors-v11"
  bind:this={mapComponent}
  on:ready={onReady}
  center={[event.location.lng, event.location.lat]}
  zoom="4"
  cooperativeGestures={true}
// or
  options={{ cooperativeGestures: true }}
>

or mapComponent.cooperativeGesture = true; or mapComponent.options = {cooperativeGesture = true};

Thought I'd check if it's supported or something I'm doing wrong. (most likely the latter, i'm a Svelte noob!)

pafech commented 1 year ago

It does work with: <Map cooperativeGestures: true> ...but only for mobile. It appears that the Desktop version stopped working at some point, unfortunately I'm unable to say at which point.