question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

My map keeps shaking when I move it

See original GitHub issue

Hello, my map seems to shake a lot when I use width: 100% (or any percentage)

With px, it works just fine. I want to make the width the whole screen though.

Here’s a video of the shaking:

https://user-images.githubusercontent.com/49425409/153725273-faaec144-cee5-45a2-aff0-4af452fadeee.mp4

In the video the width is 90%

This is the part of the HTML:

<div id="mapContainer" style="width:100%;height:100%; position: relative;">
    <div id="map" style="width: 90%; height: 500px; left: 50%; bottom: 50%; transform: translate(-50%, 50%);">
      <a href="https://www.maptiler.com" style="position:absolute;left:10px;bottom:10px;z-index:999;"><img src="https://api.maptiler.com/resources/logo.svg" alt="MapTiler logo"></a>
    </div>

Thanks in advance, Jees

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Falke-Designcommented, Feb 13, 2022

When I added additionally a TileLayer the shaking doesn’t happen anymore. Same if I removed L.mapboxGL completely.

L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18 }).addTo(map).

I don’t know mapbox, but it looks like this is an mapbox error and can’t be fixed in Leaflet. Also I suggest to update the mapbox-gl-js version. You are using 1.13.2 but the newest version is 2.7.0. https://cdn.maptiler.com/mapbox-gl-js/v1.13.2/mapbox-gl.js

0reactions
IvanSanchezcommented, Feb 12, 2022

The basemap is a L.mapboxGL one. To consider this as a Leaflet bug, this should be reproducible with a plain L.TileLayer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

My map is shaking when I am using the app. I don't know why I ...
My map is shaking when I am using the app. ... the app also but every time when I am gonna use map...
Read more >
With large maps, screen keeps shaking back and forth then ...
With large maps, screen keeps shaking back and forth then moving way off to the side of the map after moving the camera...
Read more >
is there a reason my car is shaking on a custom map? help ...
Try a different car, otherwise your fps looks quite low, maybe that could be affecting something...
Read more >
Map screen is shaking when ki pilot is flying :: X4
Hey there! I got the problem that my map screen (and all related screens) is shaking every one oder two seconds when the...
Read more >
How to Disable “Shake to Send Feedback” in ... - OSXDaily
If you don't want to see the 'Shake to send feedback' alert come up in Google Maps for iOS, this article will show...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found