Skip to content

Issue map rendering Chrome migrating location service API v1 to v2

0

Hi,

I migrated the aws location service api from v1 to v2 in my webapplication where I'm using it to render a Map.
In the v1 I was using the open-data-visualization-light map.
In the v2 I'm using the Monochrome style.

Issue

The issue that I'm experiencing is that when I'm at max zoom out possible the map disappears.
This issue is independent from the maplibre version as I tried with multiple ones.
This issue seems to occur only on Chrome browsers.
I tried with multiple versions of it both on Windows and Linux:

  • Version 134.0.6998.178
  • Version 131.0.6778.204

Enter image description here

The same issue doesn't appear in Firefox or Microsoft Edge.

Enter image description here

Reproducing the error

To reproduce the error just copy the example in the docs and try zooming out as much as possible in a chrome browser.

<!DOCTYPE html>
<html lang="en">
   <head>
       <title>Display a map</title>
       <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." />
       <meta charset='utf-8'>
       <meta name="viewport" content="width=device-width, initial-scale=1">
       <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.css' />
       <style>
               body { margin: 0; padding: 0; }
               html, body, #map { height: 100%; }
       </style>
       <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></script>
   </head>
   <body>
       <!-- Map container -->
       <div id="map"></div>
       <script>
           const styleUrl = 'https://maps.geo.eu-central-1.amazonaws.com/v2/styles/Monochrome/descriptor?key=placeholder';
           const map = new maplibregl.Map({
               container: 'map', // container id
               style: styleUrl, // style URL
               center: [25.24, 36.31], // starting position [lng, lat]
               zoom: 2, // starting zoom
           });
       </script>
   </body>
</html>

asked a year ago238 views
2 Answers
0

Very interesting. I tried your code in Chrome and FF and found the same behavior. The map does disappear when you try to zoom out.

I'll raise this with the Location Service team internally to see if they have any ideas.

AWS
EXPERT
answered a year ago
  • Thank you, luckly enough you were able to reproduce the error. I was scared that I was the only one having it since I was not able to find any relevant issues online.

  • Hi do you have any update regarding this issue?

0

If you set the "minZoom" in your code to 1, it should remove this issue. In our testing it seemed to help.

AWS
EXPERT
answered a year ago
  • This seems to me more of a workaround than a proper solution. Why wasn't it happening with the map provided by open-data-visualization-light and only happens on Chrome browser? Still I tried what you were proposing and for the mercator projection the issue seems disappeared. For the globe projection, which has been added in maplibre library recently, is still happening no matter the min zoom set. The map disappears when moving at the poles, should I provide a demonstration?

  • Hi Zac, any news regarding the issue described above?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.