Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get zoom working in Android #185

Open
OtterTax opened this issue Jan 31, 2023 · 5 comments
Open

Can't get zoom working in Android #185

OtterTax opened this issue Jan 31, 2023 · 5 comments

Comments

@OtterTax
Copy link

I'm sure I'm missing something here, but I can't get zoom working in Android. Whenever I zoom in or zoom out on an Android device. The zoom level snaps back to its original value. I'm told the same thing happens on iOS, but I haven't tested it myself. Zooming works fine on the desktop browsers I've tried (Chrome and Firefox). The example below uses a controlled component, but I've also tried using defaultCenter and defaultZoom with an uncontrolled component.

Steps to reproduce:

  1. yarn create react-app pigeon-maps-test
  2. yarn add pigeon-maps
  3. replace App.js with the following:
import React, { useState } from 'react'
import { Map } from 'pigeon-maps'

function App() {
  const [center, setCenter] = useState([50.879, 4.6997])
  const [zoom, setZoom] = useState(13)
  return (
    <Map 
      height={300}
      center={center} 
      zoom={zoom} 
      onBoundsChanged={({ center, zoom }) => { 
        setCenter(center) 
        setZoom(zoom) 
      }} 
    />
  )
}

export default App;
  1. Run app. Zooming from desktop browser works fine, but zooming from Android is not possible.
@MrGentle
Copy link

MrGentle commented Apr 1, 2023

I'm facing the same issue in my Ionic react app.
Did you figure out any solution to this?

Would like to add that when 2-finger dragging, the map updates center to the wrong position causing jumps/stuttering

@albjeremias
Copy link

albjeremias commented Apr 11, 2023

have u tried this workaround:

#58 (comment)

@luisdralves
Copy link

I was facing this issue, but it doesn't seem to affect maps with zoomSnap set to false.

Also worth noting that the example works in mobile, not sure what's different there.

@Shaky-Sahil
Copy link

I was facing this issue, but it doesn't seem to affect maps with zoomSnap set to false.

Also worth noting that the example works in mobile, not sure what's different there.

Setting zoomsnap to 'false' did the trick for me. Thanks for that!

@rogerio-richa
Copy link

idk how many hours I lost trying to figure this out. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants