-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
[BUG] Error is thrown when adding marker then centering map #1171
Comments
There's a pull request at #1147 I did for a similar issue that may be related. Would you be able to test this at all, to see if it fixes your problem ? If so, I'll try and get it merged quicker. |
Yes, sorry I didn't spot your earlier comment, I don't think my fix is related to this issue. I've tried running the app, how does one recreate the problem (does it need to be connected to the server?), as it all runs fine, but I'm probably doing something you're not adding the marker or whatever. Can you try and create smaller test case for people to run. |
oh I get the pgServer is unavailable...so can't really test properly here. See if you can create a test that can run standalone without any connections etc for people to test. |
Actually, it could still be related....if you can, in flutter_maps marker_layer, around line 218, print out widget.markerLayerOptions.markers.length and _pxCache.length...are they different ? |
Will test if the values are different. But if you are running my app, once the map appears just click anywhere since that will add a marker on the clicked position and then center the map to that position. The error should appear. Thanks. |
Hi, I did, the centering doesn't work as it pops up an error about the pgrServer not being reachable, so I don't think any tests I've done are valid. |
Can you please click on the icon on the AppBar and change the url to: http://cld06.georepublic.net/pgrServer then press the Zoom Bnd floating button in the map to recenter. Then just click anywhere to add a Marker. Thanks thanks. |
ok, that gets rid of that error, but doesn't crash on my device. |
Actually, your pubspec is using 0.11.0 which may be why it doesn't for me.... |
Ok, I think I managed to reproduce it, changing flutter_map to 0.14 in pubspec, dio: any, latlong2: ^0.8.1 Then it crashes when adding/recentering, but it doesnt crash if I use my PR
Make sure you do a new pub get etc after changing that...see if it helps. |
Possibly make sure you use ref: and not branch: in the pubspec as above, I'm not sure if there's any difference or what. |
I am also encountering this after upgrading from 0.12.0 to 0.14.0 I'll do a pull request when I get a chance. Until then in the file lib/src/layers/marker_layer.dart add this at line 210:
|
@tantzygames, I think your suggestion already appears in @ibrierley's #1147? |
I see, so it does. Thanks for that |
@ibrierley apologies for not replying much sooner, but your branch referenced as:
does fix the problem. I have been testing for over an hour now and have yet to experience a crash like before. Thanks. |
No problem, this fix has been merged now. |
I'm going to close this, as I'm assuming the PR sorts this on the whole (at least prevents crashing and one can turn off caching). Feel free to reopen if still a problem. |
I get the error below whenever I add a marker on a given position then center the map to the marker position. This error appears with versions
0.13.0
and0.14.0
, but not in0.12.0
.The problem seems to be here: (package:flutter_map/src/layer/marker_layer.dart:217:21)
The source code of my project can be found here: https://github.com/mbasa/pgrServerDemo.
Thanks and regards,
Mario.
The text was updated successfully, but these errors were encountered: