Maps: Post-Expressions Update: Initial Map Zoom and Coords Not Correct

Created on 1 May 2019  路  8Comments  路  Source: react-native-mapbox-gl/maps

Describe the bug
Initial Map Zoom and Coords Not Correct
Reference #4

To Reproduce
With newest expression merged on master installed, load map with initial center and coordinates defined:

      <Mapbox.MapView
        zoomLevel={8}
        centerCoordinate={[-111.8678, 40.2866]}
        style={styles.map}
        showUserLocation={true}
>

Expected behavior
Map zoom/center coords should load initially as before.

Screenshots
Resulting map regardless of center/coords defined:

Screen Shot 2019-04-30 at 4 30 53 PM

Versions (please complete the following information):

  • Platfrom: iOS
  • Device: Simulator Xr
  • React Native Version 0.59

Additional context

A big thank you and shoutout to @mfazekas for the recent expressions updates. The good news is we have the newest custom maps in Mapbox Studio working and displaying:

Screen Shot 2019-04-30 at 4 48 52 PM

Most helpful comment

@systemlevel thanks for trying out the new branch.

We need a doc update/rewrite, on how to migrate code for the new mapbox.

As mentioned in https://github.com/react-native-mapbox/maps/pull/4#issue-270304205

<Mapbox.MapView
        zoomLevel={8}
        centerCoordinate={[-111.8678, 40.2866]}
        style={styles.map}
        showUserLocation={true}
...
<Mapbox.MapView>

is now
````jsx
style={styles.map}

>
zoomLevel={8}
centerCoordinate={[-111.8678, 40.2866]}
/>
showUserLocation={true}
/>
...

```

All 8 comments

@systemlevel thanks for trying out the new branch.

We need a doc update/rewrite, on how to migrate code for the new mapbox.

As mentioned in https://github.com/react-native-mapbox/maps/pull/4#issue-270304205

<Mapbox.MapView
        zoomLevel={8}
        centerCoordinate={[-111.8678, 40.2866]}
        style={styles.map}
        showUserLocation={true}
...
<Mapbox.MapView>

is now
````jsx
style={styles.map}

>
zoomLevel={8}
centerCoordinate={[-111.8678, 40.2866]}
/>
showUserLocation={true}
/>
...

```

@mfazekas Thank you! I'll work on some doc updates to reflect these changes as well.

@mfazekas getting an issue with RCTMGLCamera after installing react-native-mapbox/maps on another machine and running the app. Is this related to the above changes?

Screen Shot 2019-04-30 at 10 25 03 PM

Adding additional details from xcode:

Screen Shot 2019-04-30 at 10 47 15 PM
Screen Shot 2019-04-30 at 10 47 26 PM

RCTMGLCamera should be in the project, generated by cocoapods. Are you using the workspace to build?

k茅p

RCTMGLCamera should be in the project, generated by cocoapods. Are you using the workspace to build?

k茅p

@mfazekas I have tried running it with react-native run-ios in the terminal as well as in xcode by building and running it there. If I misunderstood your question let me know.

Both of those approaches result in a failed build:

info Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RCTMGLCamera", referenced from:

info       objc-class-ref in libRCTMGL.a(RCTMGLMapView.o)

info ld: symbol(s) not found for architecture x86_64

info clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'v attempted to clear out node_modules and do a clean npm install but the same error results still.

@systemlevel sorry i thought you're using cocapods, but it appears you're not.
Does your RCTMGL.xcodeproj contains the RCTMLCamera?
k茅p

It did for a project i've started with

react-native init
npm install react-native-mapbox/maps --save 
react-native link
# add Mapbox.framework to the project

it builds/run fine, it's also in the github project, so not sure how your version has it missing.

https://github.com/react-native-mapbox/maps/blob/3c24cbb76ce81c1972dbd7727c44d5ab0b47bd8c/ios/RCTMGL.xcodeproj/project.pbxproj#L27-L28

@mfazekas Yes I see that as well. So strange... I ended up deleting my project and then pulling a fresh copy down from my git repository and everything started working. I wish I knew what the exact issue was but I couldn't determine why that happened.

Things are working now after installing everything again from a clean clone of our repo.

Thanks again for your help.

All issues have been addressed and updated docs to follow. Closing this out for now...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MariaSyed picture MariaSyed  路  4Comments

arnaudambro picture arnaudambro  路  5Comments

calypsow777 picture calypsow777  路  5Comments

bartolkaruza picture bartolkaruza  路  3Comments

mustafaskyer picture mustafaskyer  路  3Comments