Flutter_map: No such method: latitude called on null

Created on 30 Sep 2018  路  9Comments  路  Source: fleaflet/flutter_map

Hello,
Whenever I try to create a map I receive the error

" Exception has occurred.
NoSuchMethodError: The getter 'latitude' was called on null.
Receiver: null
Tried calling: latitude"

locations services are enabled and the map works fine if im not running the debugger to catch exceptions, thank you

bug

Most helpful comment

Hi!
I am facing the same problem!
any update??
thnx:)

All 9 comments

This error happens with the example app

Have you included the dependencies latlong https://pub.dartlang.org/packages/latlong ?

Hi!
I am facing the same problem!
any update??
thnx:)

For me , work in example and my project but after update i have this issue.

i thinks this happens because your map its getting null value in the center, it happens to me when i move between tabs, i fixes using a default LatLon but the problem with this i that the map does not get back in the state i was before move to another tab.

if someone know a work around for this please lmk

Without example code that reproduces, it's difficult to identify what the problem is. I'm going to close this as stale for now.

Try conditionally 馃挴
image

and you can try calling this function whenever u need user's current position
image

Packages used: 馃憤
flutter_map:
geolocator:

Was this page helpful?
0 / 5 - 0 ratings