Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coordinateFromPoint not working #2038

Closed
hanselsen opened this issue Feb 21, 2018 · 12 comments
Closed

coordinateFromPoint not working #2038

hanselsen opened this issue Feb 21, 2018 · 12 comments

Comments

@hanselsen
Copy link

hanselsen commented Feb 21, 2018

Is this a bug report?

YES

Have you read the Installation Instructions?

YES

Environment

"react": "^16.0"
"react-native": "^0.51"
git+ssh://git@github.com/react-community/react-native-maps.git"

Tested on Android only

Steps to Reproduce

  1. Clone react-native-maps-master
  2. Change example/examples/StaticMap.js
    • Add these props to <MapView />:
    ref={r => this.map = r}
    onMapReady={() => {
        //this.map.coordinateForPoint(); not workingr, because it's coordinateFromPoint (documentation typo)
        this.map.coordinateFromPoint([0,0]).then(c => {
            console.log(c); //not resolved
        });
    }}

Expected Behavior

I wish to get a coordinate for point 0,0 in the then

Also: documentation not correct. Name for coordinateFromPoint at Methods is not correct while looking at the code.

Actual Behavior

An error occurs when executed:
TypeError: _reactNative.NativeModules.AirMapModule.coordinateFromPoint is not a function

Reproducible Demo

See; Steps to reproduce

@wasedaigo
Copy link
Contributor

wasedaigo commented Feb 22, 2018

I cannot make it work either. The error I am receiving is

Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property 'apply' of undefined
TypeError: Cannot read property 'apply' of undefined
    at MapView._runCommand (blob:http://localhost:8081/c5677f99-a731-4570-a04c-c37f3546b6a1:281059:42)
    at MapView.proxiedMethod (blob:http://localhost:8081/c5677f99-a731-4570-a04c-c37f3546b6a1:30480:32)
    at blob:http://localhost:8081/c5677f99-a731-4570-a04c-c37f3546b6a1:281022:20
    at tryCallTwo (blob:http://localhost:8081/c5677f99-a731-4570-a04c-c37f3546b6a1:13431:7)
    at doResolve (blob:http://localhost:8081/c5677f99-a731-4570-a04c-c37f3546b6a1:13595:15)
    at new Promise (blob:http://localhost:8081/c5677f99-a731-4570-a04c-c37f3546b6a1:13454:5)
    at MapView.coordinateFromPoint (blob:http://localhost:8081/c5677f99-a731-4570-a04c-c37f3546b6a1:28102

I am using iOS

@g3r4n
Copy link

g3r4n commented Feb 22, 2018

Got the same issue.
@danielgindi does your RCT_EXPORT_METHOD from AirMap should be in the AirMapManager ?
e.g like the takeSnapshot one ?

@wasedaigo
Copy link
Contributor

wasedaigo commented Feb 22, 2018

@g3r4n I made a PR, this fixed this issue for iOS
#2039

@hanselsen Since one of the issue was the typo, my fix might have fixed it for Android as well(I have also changed the promise part). Unfortunately I am not actively developing on Android, so I had no time to check the fix by myself.

@danielgindi
Copy link
Contributor

Hmm for some reason it works for me. Haven't seen the error. I can look into it, but I see that there's already a PR for fixing this :-)

@wasedaigo
Copy link
Contributor

wasedaigo commented Feb 25, 2018

@danielgindi I think this does not happen if you are using GoogleMap on iOS.

@Schabaani
Copy link

same issuse

@hanselsen
Copy link
Author

@wasedaigo thanks. I look forward to the merge.

@wasedaigo
Copy link
Contributor

wasedaigo commented Feb 27, 2018

@hanselsen currently the merge is blocked as we haven't tested the PR on Android. If you can confirm it is working on Android and leave a comment on the PR, we can merge that PR.

@rborn
Copy link
Collaborator

rborn commented Feb 28, 2018

@hanselsen @Schabaani @danielgindi @g3r4n +1 if you could confirm it works ok on android. I won't be able to run a test of the PR very soon so I could use some help ❤️

@hanselsen
Copy link
Author

@rborn at this moment I do not have the time. I will let you know later if @Schabaani or @danielgindi or @g3r4n doesn't reply.

@g3r4n
Copy link

g3r4n commented Mar 2, 2018

Sorry guys i don't have an android device.

@rborn
Copy link
Collaborator

rborn commented Mar 21, 2019

Old issue, closing, please open a new one if you still have it

@rborn rborn closed this as completed Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants