Android Question [SOLVED] MyLocationEnabled = False Seems to Kill Markers Too

mmieher

Active Member
Licensed User
Longtime User
Whether done in Designer or code, setting MyLocationEnabled to false hides all markers, not just MyLocation. I want other markers, but NOT my location.

B4X:
    gMap = gMapFragment.GetMap
    If gMap.IsInitialized Then
        Log("gmap.IsInitialized")
        gMap.MyLocationEnabled = True
    End If
    
    gMap.addMarker(Lat, Lon, "Destination")
    ''   gMap.MyLocationEnabled = False                '    this kills markers
 
Solution
Please post a small example.
Sorry, Erel. The mistake is right there. I was enabling MyLocation then disabling it a nanosecond later. Copy and Paste. Must have confused Google. That hid my Mountain View emulator location and the marker at the lat/lon parameters I pass.

Answer is just leave MyLocationEnabled alone. Interesting to me that MapFragment in Designer layout still has MyLocation Button Enabled checked. Must be something else.

mmieher

Active Member
Licensed User
Longtime User
Please post a small example.
Sorry, Erel. The mistake is right there. I was enabling MyLocation then disabling it a nanosecond later. Copy and Paste. Must have confused Google. That hid my Mountain View emulator location and the marker at the lat/lon parameters I pass.

Answer is just leave MyLocationEnabled alone. Interesting to me that MapFragment in Designer layout still has MyLocation Button Enabled checked. Must be something else.
 
Upvote 0
Solution
Top