Comments (14)
Or the new code to cull polyline segments that are out of the viewport is not working quite right at this zoom level?
@JaffaKetchup I've definitely noticed side-effects at high zoom levels, where segments are being dismissed.
@RuoLiDevelop Would you test with cullingMargin: null
?
from flutter_map.
screen-capture.webm
from flutter_map.
Hey @RuoLiDevelop,
Thanks for reporting this. I don't believe any exception occurs, as the polyline remains interactive the entire time, which means it is being painted, but there's definitely something strange going on: as you showed, it changes thickness, looks very strange, then disappears.
Zooming out does reintroduce the line correctly.
I can only assume there's some maths we're doing somewhere that doesn't like the precision required at this zoom level? Or the new code to cull polyline segments that are out of the viewport is not working quite right at this zoom level?
from flutter_map.
Hi @JaffaKetchup
Thank you for your reply. I'm sorry, but for some reason, I haven't delved too deeply into the Flutter_map code. In theory, limiting the zoom level can solve this problem.
from flutter_map.
No worries, no need to delve into the code unless you want to!
from flutter_map.
hi @monsieurtanuki
I don't understand. cullingMargin: null
from flutter_map.
v7-beta render with Impeller, I noticed minification zoom level,create line segments between unrelated polygons when the distance between polygons is long.
from flutter_map.
v7-beta render with Impeller, I noticed minification zoom level,create line segments between unrelated polygons when the distance between polygons is long.
screen-capture_1.webm
from flutter_map.
I've just run tests on the sample app, and added a FAB that increments the zoom while focusing on the same LatLng (_mapController.move(const LatLng(48.8567, 2.3519), _zoom);
).
It works on any zoom level, even unreasonable ones (32), for dash style.
zoom 19 | zoom 32 |
---|---|
But it doesn't always work that well with solid style.
zoom 19 | zoom 25 |
---|---|
@JaffaKetchup Would that mean that dashed custom-made style is more resilient than solid based-on-Path
style?
In "extreme" zoom levels, that would make sense, as we deal with extreme coordinates (ignoring them) in the code before passing them (or not) to the Path
.
from flutter_map.
@JaffaKetchup Looks really like the Path
doesn't like extreme coordinates.
I've just "fixed" the solid style using a specific SolidPixelHiker
, and as it limits the path segments to what is actually visible (i.e. with decent coordinates), it works perfectly on zoom 25 and even on unrealistic zoom 32.
current zoom 25 | "my" zoom 25 | "my" zoom 32 |
---|---|---|
from flutter_map.
@monsieurtanuki Wow, thanks for getting this fixed so quickly! We'd definitely appriciate a PR.
I'm a little bit confused what you were saying above. Do you mean that you think the issues are stemming from the new polyline segment culling that operates before painting, and you've moved it to painting, which seems to have fixed the issue? Or is there some issue with Flutter somewhere?
from flutter_map.
@JaffaKetchup I said several things above, that go in different directions.
How to display correctly solid style for polylines:
- As it looks like the dashed and dotted styles are displayed correctly, the fix is to find inspiration in them and apply it to solid style.
- The dashed and dotted styles compute exactly the visible segments / dots, and only them. The segment / dot coordinates used in the
path
are therefore relevant. - The solid style is currently dealt with differently, with a mere
path.addPolygon
andcanvas.drawPath
, with no coordinate preprocessing - In my example above, the polyline is displayed correctly in zoom 24 with the current implementation, but not in zoom 25.
- In zoom 24, the segment to display is
[Offset(196.4, 361.5), Offset(32560820.7, 55097704.0)]
- In zoom 25, the segment to display is
[Offset(196.4, 361.5), Offset(65121444.9, 110195046.5)]
- Therefore it could be that
path
s have problems with coordinates beyond 64M
=> Issue to open with flutter?
=> We can fix the polylines (the way I did), we cannot fix the polygons (and their area) that simply.
- In zoom 24, the segment to display is
- As I come from Java, I'm a bit cautious with the performances, as we allocate again and again lists during the display when we precompute the coordinates
=> Who could test the performances of current and next solid style display in a consistent way? I'd help if needed. - I'll open a PR today for my "solid fix"
Beyond that, during my coding last month I experienced coordinate issues with polylines in big zoom situations. Something like some points were ignored while they were invisible but relevant.
I cannot say if the culling was wrong, or if I used it in an inappropriate manner (like, closing the polyline, which is not supposed to happen), or if I was in a phase of my coding that was unstable anyway.
from flutter_map.
I confirm that polygon areas are not displayed correctly beyond the 64M limit.
And that cannot be solved with my fix. Other PRs are needed.
zoom 24 | zoom 25 |
---|---|
- zoom 24:
[Offset(196.4, 361.5), Offset(-60248650.4, 2244646.0), Offset(-37938681.4, 33140246.2)]
- zoom 25:
[Offset(196.4, 361.5), Offset(-120497497.2, 4488930.6), Offset(-75877559.2, 66280131.0)]
from flutter_map.
By the way I fixed that "path with extreme coordinates" display side effect years ago for osmdroid - including polygon areas - and I don't think it would be a problem to port the code from Java to dart/flutter:
from flutter_map.
Related Issues (20)
- [kml support] <kml support> HOT 1
- [BUG] MapEventTap - Delay between touch and event HOT 1
- Add privacy manifest file for iOS HOT 2
- Dragging polygon/polyline HOT 1
- [BUG (v7)] Dotted polyline throws exception: `Bad state: No element` HOT 1
- [BUG] v7-beta: polygon becomes distorted & invisible (but remains interactive) when zoomed far in HOT 7
- [BUG] map rotation is always possible on web even with InteractiveFlag set to InteractiveFlag.none HOT 2
- Load data from an external GeoJSON file HOT 2
- [BUG] pinchZoomWinGestures, rotationThreshold (etc.?) not working
- [BUG] Map tiles from local storage not loading when internet speed is poor HOT 5
- [BUG] Cannot use the package on flutter 3.22 HOT 1
- [BUG] External `MapController` lifecycle not synced with widget when destroyed and rebuilt HOT 12
- [BUG] `Polygon`s and `Polyline`s don't update when `points` modified HOT 5
- Tiles don't load after building a release apk HOT 1
- [BUG] Too high `package:meta` dependency constraint HOT 5
- [BUG] Overlapping `Polygon`s with same colors cause cutting HOT 3
- [BUG] Alternative polygon renderer in 7.0 renderers multiple holes incorrectly HOT 2
- [FEATURE] Drawing interactive polygons in real time HOT 3
- [BUG] Polygon simplification triggers crash on iOS in 7.0 HOT 6
- [FEATURE] Prevent pinch move while pinch zooming
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 flutter_map.