Android Question GoogleMap MyLocation

lkching7

Member
Licensed User
Longtime User
I Try To Get Gooele Map MyLocation Latitude & Longitude.
But Occur Error Initialized, I Already Make Sure MyLocationEnabled is True.
The Google Map Library Run Properly Except This Function.

I Just Try The Simple Call :

gmap = mFragment.GetMap
gmap.MyLocationEnabled = True
gmap.GetUiSettings .MyLocationButtonEnabled =True
msgbox(gmap.MyLocation.Latitude,"TEST")





 

lkching7

Member
Licensed User
Longtime User
You need to check whether MyLocation.IsInitialized before using it. It will not be initialized until the location is known.

I Have Check The MyLocation.IsInitialized, But It Always Return False. Actually What Mean By "location is known"
 
Upvote 0

lkching7

Member
Licensed User
Longtime User
It means that Google Maps doesn't yet know the device location.
Thank For Reply, Is That Google Map Will Automatic Know The Device Location ? Or I Have To "Call" The Google Map Do Something To Check My Device Location.
By The Way, If I Click The Right Top Corner Button In Google Map. She Will Know My Location.

Capture.PNG
 
Upvote 0

lkching7

Member
Licensed User
Longtime User
Test it outside. After a minute or two you will see a symbol that marks the current location. When this symbol is visible you will be able to get the current location.

Yes ! You're Correct. When I Go Outside, Problem Solved. I Can Get The My Location Already. Many Thank Erel.
Can I Ask One More Question, It That Suitable To Create a Timer To Check Whether "MyLocation.IsInitialized = True"
 
Upvote 0

klarsys

Active Member
Licensed User
Longtime User
Rather than a timer, is there any event / call back I can use to update my marker every time my location is updated?
 
Upvote 0

Similar Threads

Top