Comments (5)
I think solving the following issue will probably avoid this scenario.
Adding a try-catch probably can't hurt much, but still feeling like adding a patch and not a real solution.
from maplibre-gl-js.
I think solving the following issue will probably avoid this scenario. Adding a try-catch probably can't hurt much, but still feeling like adding a patch and not a real solution.
I also feel like adding exception handler feels like a hack and that it would be best to solve this at the source. However, can the camera really be kept above terrain at all times. What about an animated camera using freezeElevation=true
?
If it helps, I can add these handlers in a pull request. Another solution could be to prevent the LatLng constructor from throwing errors in such cases, e.g. adding a parameter flag like silent=true
at some point?
from maplibre-gl-js.
Yes, there was an initial PR to do it, but it changed the map settings so it needed more work:
from maplibre-gl-js.
I feel that a try/catch or similar - although it may feel like you have simply hacked around the problem - is actually pretty valid here:
- try/catch was invented to let you recover from unrecoverable errors. Deciding not to catch (or suppress in some way) this error would be a good choice if this error is unrecoverable. But is this really an unrecoverable error?
- it's true, you are hoping to solve this problem at the source, and it would be good to keep the camera above the terrain at all times. But a) that's not done yet and b) wouldn't it be better if the various subsystems were robust against failure in other subsystems? Right now by having each subsystem relying on the assumption that every other subsystem is working perfectly (even though we know they are not), this is designing to encourage a cascading failure.
from maplibre-gl-js.
Your points are valid, and I won't reject a PR to patch the code until we properly fix the problem. I would advise to add a comment to saying this should be removed after the issue is resolved.
We are talking about the same system, and I prefer not to write "defensive programming" if possible, and fix the source of a problem when possible. It's not always possible, I know, but I'm trying to aim high.
from maplibre-gl-js.
Related Issues (20)
- WebGL 1 phase out HOT 4
- Layer `type` change causing a full map reload HOT 5
- Text overlaps on some phone models HOT 1
- Strange results of `raster-contrast` paint property HOT 3
- Id missing on MapGeoJsonFeature on map.on('click', layerid, event) HOT 2
- App using terrain (raster-dem) crashes when zooming out after zooming in quickly HOT 3
- Raster tiles are much lower detail when terrain is enabled HOT 12
- How to use raster source with varying zoom levels? HOT 7
- standard-minifier-js of Meteor.js remove Promise HOT 2
- Map freeze if easeTo during move event HOT 7
- Missing documentation: Popup Constructor and PopupOptions
- on load method: Occasionally the load method does not trigger a callback HOT 17
- MapLibre stops responding with weird, seemingly unrelated error message HOT 2
- Sustitute placeholder images from placekitten.com
- Ability to modify the map background HOT 1
- setLayoutProperty trigger blink of map layer HOT 2
- Add the actual projection matrix to transform HOT 5
- Is it time to move to ES2017 and how HOT 4
- preserveDrawingBuffer and marker dragging breaks down rendering HOT 2
- Geojson Circle broken / even on example page HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maplibre-gl-js.