Giter Club home page Giter Club logo

Comments (14)

monsieurtanuki avatar monsieurtanuki commented on June 8, 2024 1

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.

RuoLiDevelop avatar RuoLiDevelop commented on June 8, 2024
screen-capture.webm

from flutter_map.

JaffaKetchup avatar JaffaKetchup commented on June 8, 2024

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.

RuoLiDevelop avatar RuoLiDevelop commented on June 8, 2024

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.

JaffaKetchup avatar JaffaKetchup commented on June 8, 2024

No worries, no need to delve into the code unless you want to!

from flutter_map.

RuoLiDevelop avatar RuoLiDevelop commented on June 8, 2024

hi @monsieurtanuki
I don't understand. cullingMargin: null

from flutter_map.

RuoLiDevelop avatar RuoLiDevelop commented on June 8, 2024

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.

RuoLiDevelop avatar RuoLiDevelop commented on June 8, 2024

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.

monsieurtanuki avatar monsieurtanuki commented on June 8, 2024

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
Screenshot_1714548463 Screenshot_1714548372

But it doesn't always work that well with solid style.

zoom 19 zoom 25
Screenshot_1714548885 Screenshot_1714549210

@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.

monsieurtanuki avatar monsieurtanuki commented on June 8, 2024

@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
Screenshot_1714549210 Screenshot_1714555249 Screenshot_1714555365

from flutter_map.

JaffaKetchup avatar JaffaKetchup commented on June 8, 2024

@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.

monsieurtanuki avatar monsieurtanuki commented on June 8, 2024

@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 and canvas.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 paths 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.
  • 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.

monsieurtanuki avatar monsieurtanuki commented on June 8, 2024

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
Screenshot_1714578574 Screenshot_1714578584
  • 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.

monsieurtanuki avatar monsieurtanuki commented on June 8, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.