Replies: 4 comments
-
Thanks for looking into this!! |
Beta Was this translation helpful? Give feedback.
-
Nice work! I am really new to MapLibre, that said:
I set up a file server and opened |
Beta Was this translation helpful? Give feedback.
-
Awesome work!
I believe this is just the 2,500 most common Simplified Chinese characters arranged randomly in 5-character-long labels. The console failure should be irrelevant as it was specific to the map style that was loaded before. I'm guessing this was designed to test performance of different SDF glyph range designs before the Local Ideographs code path was introduced, which means the debug page does not have to make any font requests.
It looks like this is related to the above and loads a basemap view of Shanghai with default labels in English |
Beta Was this translation helpful? Give feedback.
-
TSC discussion summary: "Interesting" debug pages that can be added to the examples pages should go there, other that are interested for testing (if any) should move there, or adopted to be using rendering test or browser test, the rest should be deleted and we should keep an eye for PRs that add a debug page (or delete the library and index creation code to avoid this in the future). |
Beta Was this translation helpful? Give feedback.
-
Summary
I would like to present my notes taken after reviewing the 57 debug pages in the maplibre-gl-js repository: https://github.com/maplibre/maplibre-gl-js/tree/main/test/debug-pages. The purpose of this review was to figure out which debug pages are working and which ones are not as well as what do the debug pages test, accomplish and/or prove. Below I have identified some overall themes and problematic patterns as well as some suggestions for us to consider to revamp the current state of the debug pages. I am posting this in the community github as a discussion to solicit feedback and contributions from other developers. If you have contributed to the debug pages it would be very helpful if you could add a description of what a debug pages does to include: purpose, what is being tested, and what assertions and assumptions are being made.
Overall Themes and Problematic Patterns
Suggestions to Revamp
2762
Github: https://github.com/maplibre/maplibre-gl-js/blob/95b0ca42bf8376561db7e96c616d76696d8f65f7/debug/2762.html
It is not clear what this debug page is testing or trying to accomplish. From reading the code there is a point in an empty map and on map click it calls setPaintProperty on the map object to color the point and translate its position.
3895
Github: https://github.com/maplibre/maplibre-gl-js/blob/bf9896c4f0cd22cab613a5f28a52335ccf4a4e1f/debug/3895.html
This page is a victim of the merge where mapbox styles were replaced with demotiles. From the looks of it it is supposed to get the water layer from the map and flicker it by removing it from the map and adding it back on the map on a set interval.
We would need to recover the geometry from the mapbox style for this to work again.
7438
Github: https://github.com/maplibre/maplibre-gl-js/blob/e60fb1581b3192583c8f042ec64593e9626bd54c/debug/7438.html
Debug page for ScaleControl component. Currently is working from what I can tell.
7517
Github: https://github.com/maplibre/maplibre-gl-js/blob/ea9fbeee5725ffbb9aafd52ebfa81c10dc5ac205/debug/7517.html
Map gets camera based on bounding box with padding and offset. Map then eases from initial coordinates and zoom to camera center, zoom and bearing. Looks like it is working.
animate
Github: https://github.com/maplibre/maplibre-gl-js/blob/c4e323ba2d5c4079b9c7f5688ecdcb43fce1d2be/debug/animate.html
Creates an animate on top of the map. Two lines that cross each other are rotated counter clockwise. Animation updates seem to occur 60 fps. No clue as to where the function requestAnimationFrame comes from. Seems to be working.
bounds
Github: https://github.com/maplibre/maplibre-gl-js/blob/a00bf99458b1422e1eab0453f47e09546abfb249/debug/bounds.html
On map load gets the bounds of the the map extent then creates a polygon which is added to the map. The page listens to the map object for a rotateend event in which the callback gets the bounds of the map and updates the geometry of the bounds polygon. I think this is done incorrectly because when zooming out after rotating the map the bounds exceeds the previous zoom levels map extent and the orientation of the bounds is rotated by 46 degrees.
cache_api
Github: https://github.com/maplibre/maplibre-gl-js/blob/500320f891bfbd3f2c81cec772e4517ed625daa6/debug/cache_api.html
This page still has a dependency on mapbox and is broken. Lots of error messages in the console.
Notably:
canvas
Github: https://github.com/maplibre/maplibre-gl-js/blob/10eb02b04a781691c68df449d82171c8cb9ef963/debug/canvas.html
Not sure what the purpose of this page is. But it looks to be executing everything it is programmed to do properly. It draws 2 rectangles to a canvas element and two rectangles to and empty map object using canvas as a source.
chinese
Github: https://github.com/maplibre/maplibre-gl-js/blob/e60fb1581b3192583c8f042ec64593e9626bd54c/debug/chinese.html
Seems to be working properly. Not sure what this test is proving. Looks like data is loaded from a file containing points and then there is a “layout” configuration defined for the points added to the map. It looks like one of the images cannot be loaded successfully. Getting a warning in the console. Something like an image “icon” property might be undefined in the data.
circles
Github: https://github.com/maplibre/maplibre-gl-js/blob/72c136477c98cf6896da6227fb92de98bc6e51c4/debug/circles.html
Loads circle data from integration directory, then plots circles on map. Defines properties for custom circle radius and color. Defines layout of text annotation. Appears to be working properly. No errors in the console.
cluster
Github: https://github.com/maplibre/maplibre-gl-js/blob/bf88cd735b06eacc607c188a2508c9912140768d/debug/cluster.html
Issues: data don’t appear on initial load, you must zoom in on the map for data to appear. There is an 404 error in the console:
I think this has to do with the “cluster_label” since it references both of these fonts.
I don’t believe, I can see any clusters in the map. Only “unclustered_point” circles. So none of the custom cluster business logic can be evaluated.
color_spaces
Github: https://github.com/maplibre/maplibre-gl-js/blob/b0eaa56b2be98e1c05e960f0d805409b76bdc3b3/test/debug-pages/color_spaces.html
Issues: The data coming from the cloudfront domain might have changed because we are now getting the following console error:
Leads me to believe that there used to be a layer called “country-label-lg” that was added to the map from the cloudfront data.
I believe the purpose of this debug page is to test “rgb”, “hcl” and “lab” colorSpaces.
csp-static
Github: https://github.com/maplibre/maplibre-gl-js/blob/e60fb1581b3192583c8f042ec64593e9626bd54c/debug/csp-static.html
Issues:
csp
Github: https://github.com/maplibre/maplibre-gl-js/blob/b0eaa56b2be98e1c05e960f0d805409b76bdc3b3/test/debug-pages/csp.html
Isssues:
custom3d
Github: https://github.com/maplibre/maplibre-gl-js/blob/f556bee30d36d1001825f18734eda723b1174209/debug/custom3d.html
Seems to be working properly. Creates a custom 3D layer using the “gl” library in scope and adds it to the map.
debug
Github: https://github.com/maplibre/maplibre-gl-js/blob/725697ab4bf3bff35d75638a73d2ef673301fb2a/debug/debug.html
Not sure what the purpose of this page is. It seems that some items are working and others are not.
Issues:
Features:
default-image
Github: https://github.com/maplibre/maplibre-gl-js/blob/68cfea9935853d47649e077b6c9bc24c6ec9dbd4/debug/default-image.html
Issues:
Features:
events
Github: https://github.com/maplibre/maplibre-gl-js/blob/c496a32f15b1d721ec65ca77afeea8fa3ddaeb97/debug/events.html
Tests for the following map events: [
'touchstart', 'touchend', 'touchmove', 'touchcancel',
'mouseout', 'mousedown', 'mouseup', 'mousemove',
'click', 'dblclick', 'contextmenu',
'dragstart', 'drag', 'dragend',
'movestart', 'move', 'moveend',
'zoomstart', 'zoom', 'zoomend',
'rotatestart', 'rotate', 'rotateend',
'pitchstart', 'pitch', 'pitchend',
'boxzoomstart', 'boxzoomend', 'boxzoomcancel'
]
All seem to be working. But I don’t know how to test the events: 'touchstart', 'touchend', 'touchmove', 'touchcancel'
extrusion-query
Github: https://github.com/maplibre/maplibre-gl-js/blob/2119eaa3ea6d85fd8157defb6353d21fadd01b31/debug/extrusion-query.html
Not working properly. The purpose of this debug page is to extrude buildings into 3D; however, the building features are not found. This might be due to the demotiles migration.
featurestate
Github: https://github.com/maplibre/maplibre-gl-js/blob/b3046ea99a73cc027aa5d45ddba5285670097af8/debug/featurestate.html
Issues:
geojson-updates
Github: https://github.com/maplibre/maplibre-gl-js/blob/9e2bed3bb4f2fe4f04b11d2e6b4f364507e95ae2/test/debug-pages/geojson-updates.html
Appears to be working properly. Plots points from geojson then calculates animation of points moving and shows a linestring of the trail of the points path history. No errors in console.
heatmap
Github: https://github.com/maplibre/maplibre-gl-js/blob/15a0db742d21ace602f7eedfddeb1ae888f8bd6c/debug/heatmap.html
Broken but easily fixable.
Error: Cannot add layer "heatmap" before non-existing layer "waterway-label".
Issues:
highlightpoints
Github: https://github.com/maplibre/maplibre-gl-js/blob/b01a5d3bc78662de493f800ec9430cb7ea42555f/debug/highlightpoints.html
Appears to be working correctly. Points are plotted on map. When user’s mouse hovers over point the style of the point changes.
hillshade
Github: https://github.com/maplibre/maplibre-gl-js/blob/f13c86ea356c384fdab31855b9152f5bf5ef97b8/debug/hillshade.html
NOT working.
Issues:
iframe-blob
Github: https://github.com/maplibre/maplibre-gl-js/blob/e78ad7944ef768e67416daa4af86b0464bd0f617/debug/iframe-blob.html
Broken, NOT working.
Issues:
iframe
Github: https://github.com/maplibre/maplibre-gl-js/blob/16f9f076a68a1838d734be65116781723bcf8025/debug/iframe.html
Works. This test doesn’t test any of our logic, not sure if it is necessary.
image
Github: https://github.com/maplibre/maplibre-gl-js/blob/e78ad7944ef768e67416daa4af86b0464bd0f617/debug/image.html
Appears to work.
Features:
is-safari
Github: https://github.com/maplibre/maplibre-gl-js/blob/e60fb1581b3192583c8f042ec64593e9626bd54c/debug/is-safari.html
Appears to be working.
Features:
line-gradient
Github: https://github.com/maplibre/maplibre-gl-js/blob/8fa3d4d7211810beb7b8712c9e0147d0ef62e06f/debug/line-gradient.html
Appears to be working.
Features:
markers
Github: https://github.com/maplibre/maplibre-gl-js/blob/f92048996f6240007e77f65596b2184dd0f72195/debug/markers.html
Appears to be working.
Features:
mobile_scroll
Github: https://github.com/maplibre/maplibre-gl-js/blob/e78ad7944ef768e67416daa4af86b0464bd0f617/debug/mobile_scroll.html
Appears to be working.
Features:
multiple
Github: https://github.com/maplibre/maplibre-gl-js/blob/7edb25676fd6df9445f1c4973582356961ecacf5/debug/multiple.html
Broken: is NOT working.
Issues:
Features:
no_wrap
Github: https://github.com/maplibre/maplibre-gl-js/blob/f7da63452bc88feffd963780ec375cc8ae765d07/debug/no_wrap.html
Appears to be working.
Features:
popup
Github: https://github.com/maplibre/maplibre-gl-js/blob/e78ad7944ef768e67416daa4af86b0464bd0f617/debug/popup.html
Appears to be working
Features:
query_features
Github: https://github.com/maplibre/maplibre-gl-js/blob/e60fb1581b3192583c8f042ec64593e9626bd54c/debug/query_features.html
Broken: is NOT working. Could be an easy fix.
Issues:
raster-streets
Github: https://github.com/maplibre/maplibre-gl-js/blob/e78ad7944ef768e67416daa4af86b0464bd0f617/debug/raster-streets.html
Broken: is NOT working.
Issues:
route
Github: https://github.com/maplibre/maplibre-gl-js/blob/6b80a8174cb89d484dd0900a617261eee73758f0/test/debug-pages/route.html
Appears to be MOSTLY working.
Issues:
Features:
rtl
Github: https://github.com/maplibre/maplibre-gl-js/blob/e60fb1581b3192583c8f042ec64593e9626bd54c/debug/rtl.html
I do not know enough about RTL to know if this is working correctly or not. When I click to load the rtlTextPlugin Async it just gives me the status of deferred and does not change. No console errors, maybe we need better edge case handling?
satellite
Github: https://github.com/maplibre/maplibre-gl-js/blob/8a49205cf09a479579142a4d745c932eef49c2b1/debug/satellite.html
I do not think this is working because I don’t see anything in the map that would give context to the file name “satellite”. I don’t see anything in the code that references satellite either, maybe there are stale defaults and a lack of assertions?
setstyle
Github: https://github.com/maplibre/maplibre-gl-js/blob/b0eaa56b2be98e1c05e960f0d805409b76bdc3b3/test/debug-pages/setstyle.html
Appears to be working.
Features:
shield-rotation
Github: https://github.com/maplibre/maplibre-gl-js/blob/a763e8c3ea62fc4418f5b22014d78d5631273220/debug/shield-rotation.html
Appears to be working.
Features:
stretchable
Github: https://github.com/maplibre/maplibre-gl-js/blob/e78ad7944ef768e67416daa4af86b0464bd0f617/debug/stretchable.html
I don’t know enough about this page to determine if it is working properly without more context. There are no errors in the console.
switch-pattern
Github: https://github.com/maplibre/maplibre-gl-js/blob/8b7ad981bf78d2853c75213ff555a104f7c8164b/test/debug-pages/switch-pattern.html
This COULD be working. I am suspicious that it isn’t working because I cannot find a view that shows an extruded height of a polygon. But I was able to get the polygon to be placed a certain height above the ground. I was under the impression that extruded meant creating a 3D object.
symbols
Github: https://github.com/maplibre/maplibre-gl-js/blob/fe18f985d6126f0849d5d3de22f2a0dd9f66f6e9/debug/symbols.html
Appears to be working.
Features:
terrain-hillshade
Github: https://github.com/maplibre/maplibre-gl-js/blob/6b07410279b800fa3223dfae1f3eb1673679ceb4/test/debug-pages/terrain-hillshade.html
Appears to be working properly.
Features:
terrain-osm
Github: https://github.com/maplibre/maplibre-gl-js/blob/5afb59206874205180b4c277c21d930c37b4a21e/debug/terrain.html
Appears to be working properly.
Features:
terrain-satellite
Github: https://github.com/maplibre/maplibre-gl-js/blob/981c0d3506cafc5fe474313f8ba953d251f4a314/test/debug-pages/terrain-satellite.html
Appears to be working properly.
Features:
textsize
Github: https://github.com/maplibre/maplibre-gl-js/blob/b0eaa56b2be98e1c05e960f0d805409b76bdc3b3/test/debug-pages/textsize.html
Broken: is NOT working.
Issues:
threejs
Github: https://github.com/maplibre/maplibre-gl-js/blob/f556bee30d36d1001825f18734eda723b1174209/debug/threejs.html
Broken: is NOT working. Could be an easy fix.
Issues:
Error: layers.3d-buildings: source "composite" not found
Features:
tinysdf
Github: https://github.com/maplibre/maplibre-gl-js/blob/f5886802d8208008dd786f9b85edb0815addcdfb/debug/tinysdf.html
I don’t have enough context to tell if this page is working properly. After examining the code I still have no context as to what “tiny” or “sdf” references. No errors in the console.
Features:
transform-style
Github: https://github.com/maplibre/maplibre-gl-js/blob/dfbad266cb4f3da6acb1cefc50d8cd28dabb7019/test/debug-pages/transform-style.html
Appears to be working correctly.
Features:
update_image
Github: https://github.com/maplibre/maplibre-gl-js/blob/e78ad7944ef768e67416daa4af86b0464bd0f617/debug/update_image.html
Broken: is NOT working. Could be an easy fix.
Issues:
Features:
variable-anchor-with-icon-text-fit
Github: https://github.com/maplibre/maplibre-gl-js/blob/e78ad7944ef768e67416daa4af86b0464bd0f617/debug/variable-anchor-with-icon-text-fit.html
Broken: is NOT working.
Issues:
video
Github: https://github.com/maplibre/maplibre-gl-js/blob/fc37056bd4436199f36e8cb85e724ec18780c37f/test/debug-pages/video.html
Appears to be working properly. Still has a dependency on mapbox video assets
Features:
wms
Github: https://github.com/maplibre/maplibre-gl-js/blob/2ebe717f7e8817f545fbe52b6ba4855909df41ae/debug/wms.html
Appears to be working properly.
Features:
Beta Was this translation helpful? Give feedback.
All reactions