Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LateInitializationError on PolylineLayerOptions #931

Closed
Uraskin opened this issue Jun 9, 2021 · 6 comments
Closed

LateInitializationError on PolylineLayerOptions #931

Uraskin opened this issue Jun 9, 2021 · 6 comments

Comments

@Uraskin
Copy link

Uraskin commented Jun 9, 2021

Hello! Found an error when working with PolylineLayerOptions constructor :
if (polylineCulling) { for (var polyline in polylines) { polyline.boundingBox = LatLngBounds.fromPoints(polyline.points); } }

Here if we reuse exist polylines item (when we refresh map and call setState), then we will face with LateInitializationError, because boundingBox has a late init and its was initialized before.

@mblataric
Copy link

Just ran into this myself.
Is there any workaround?

@ibrierley
Copy link
Collaborator

Not sure if I'm misunderstanding a bit (quite possible!), why are you reusing it, rather than creating a new widget ? Maybe an example would be useful to highlight the problem (and for anyone to test a fix).

@mblataric
Copy link

mblataric commented Jun 15, 2021

Not sure if I'm misunderstanding a bit (quite possible!), why are you reusing it, rather than creating a new widget ? Maybe an example would be useful to highlight the problem (and for anyone to test a fix).

Not sure what you mean "reusing it"? Reusing what?

For me, I get this error as soon as I add this to flutter map layers:

PolylineLayerOptions( polylineCulling: true, polylines: [kartaModel.polyline])

@ibrierley
Copy link
Collaborator

Sorry, I was reading from the original problem that was raised, it was talking about reusing the polylines, so I'm guessing your problem is a bit different then.

I use PolylineLayerOptions and don't get any lateinit error (and I'm assuming the polyline example doesn't give that error, but I haven't tested that yet), so wondering what's different in your case.

Seeing a minimal example reproducing the error as ever would be useful.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jul 16, 2021
@github-actions
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants