Maps: Blue Dot Representing User Location Missing

Created on 2 May 2019  路  9Comments  路  Source: react-native-mapbox-gl/maps

Describe the bug
User location indicated by blue dot not showing on maps.

To Reproduce
Have tried the following including the new UserLocation object:

      <Mapbox.MapView
        style={styles.map}
        showUserLocation={true}
      >
        <Mapbox.UserLocation 
            showUserLocation={true}
        />

Expected behavior

Blue dot:
Screen Shot 2019-05-02 at 12 32 57 AM

Versions (please complete the following information):

  • Platfrom: iOS
  • Device: iPhone Xs and Simulator
  • React Native Version 0.59

Additional context
Possible post-expressions update impact @mfazekas. Let me know if I have anything wrong in my attempt at showUserLocation based on the new changes from your vantage point.

Most helpful comment

@nasmuris the js implemenation has the advantage of customization, you can use your own location component. Ideally we'd have an option to use the native current location components.

All 9 comments

Looking at the code, I think you might need visible={true} instead of showUserLocation. Still, that code looks like it's not quite finished, for example there's no way to specify the TrackingMode.

@alexiri @systemlevel
yes
Mapview#showUserLocation is now UserLocation#visible
tracking mode can be specified in the camera so Mapview#userTrackingMode is now Camera#userTrackingMode: enum {'normal','compass','course'} and Camera#followUserLocation: bool

@alexiri @mfazekas Perfect. These two objects were necessary to get the users location showing on the map:

        <Mapbox.UserLocation 
          visible={true}
        />

and

        <Mapbox.Camera
          zoomLevel={12}
          followUserLocation={true} 
        />

Once you get the hang of new UserLocation and Camera objects the logic makes a lot of sense to me and how these are used.

Looks solved, closing. We'll need to write a migration guide, but that should be covered in a different issue.

Have a strange situation. Sometimes user location not shows. Gps and network is open befor app launch .no user marker shows. By closing app, and opening, shows.it happens In android, release and debug, real device and genymotion. Samsung s7 s5. huawei y5 asus real device

Native SDKs make it possible to show current user location heading via renderMode- android or showsUserHeadingIndicator - iOS
Why is not this supported and JS implementation is used?

@nasmuris the js implemenation has the advantage of customization, you can use your own location component. Ideally we'd have an option to use the native current location components.

@mfazekas, how is a custom location component used to display the user's location and direction?

@sauhardar, pass in for example a SymbolLayer with an image source of your choosing and it will get rendered instead of the blue dot

Was this page helpful?
0 / 5 - 0 ratings

Related issues

atomheartother picture atomheartother  路  3Comments

andrei-tofan picture andrei-tofan  路  5Comments

SethArchambault picture SethArchambault  路  3Comments

gmaclennan picture gmaclennan  路  3Comments

calypsow777 picture calypsow777  路  5Comments