-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Blank Map #118
Comments
👍 I have the same problem |
Someone help this problem. |
I'm experience the same thing. |
There is another ticket #109 which indicates that the map isn't loaded in debug mode, but I'm not in debug mode and I still have the problem, but, if some of you are in debug mode try without, just in case :) |
Just out of curiosity, is everyone using ES6 syntax (class extends component), or the older JS syntax (React.createClass) to make their class? I'm thinking the error might be a confusion with state/props. |
I'm currently using the ES6 syntax, and you ? |
ES6 for me as well. The examples are done with the other syntax so maybe that's throwing something off. |
Yes maybe, I'm gonna try with the older syntax :) |
Let us know how it goes, thanks! |
Ok I think I just find the problem, try to put your MapView in a View with this styles for the map and the container:
The map need to be in absolute position with the top, left, right and bottom props :) Edit: You can put your MapView without container, but if you put your MapView in a container this container also need to be in absolute position with the top, left, right and bottom props. |
No luck for me. Should I try it with the other syntax or did you stay with ES6? |
I stay with ES6 Syntax, just bellow you can see my file: import MapView from 'react-native-maps';
import React, {
Component,
StyleSheet,
} from 'react-native';
const styles = StyleSheet.create({
container: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
justifyContent: 'flex-end',
alignItems: 'center',
},
map: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
},
});
class Home extends Component {
constructor() {
super();
}
render() {
return (
<MapView
style={ styles.map }
initialRegion={{
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
/>
);
}
}
export default Home; |
Same problem here, ES6 syntax, positioning manipulation doesn't helps. |
If you just copy-paste my example you still have the problem ? |
Ok, so import Home from './Home';
import React, {
AppRegistry,
Component,
} from 'react-native';
class AwesomeProject extends Component {
render() {
return (
<Home />
);
}
}
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject); Try to run again your project, if you still have a blank map don't forget to setup Google Maps API. |
Ok thanks for your answer :) |
Hi, anyone got it working on iOS? I also got the same red border going on. |
Still no success in showing tiles on map, same thing (like in my previous message) in emulator and in real Android device. I've done everything like it's said in the instruction. |
Hey guys, I've finally fixed my issue. My Google Maps Api Key was incorrect. |
And one important thing - don't forget to enable Google Maps Android API in your Google Developers Console API Manager. |
@alexHlebnikov: I was my first answer :) |
I assume that's what my problem is as well, the API key. The instructions lacked info on it, i'll try it out later. |
I'm experiencing the same behavior via my IOS simulator even after making the changes. Note, running the Example app runs fine without an api key |
Same blank page with red borders on iOS... I guess the API key has nothing to do with this issue right ? The instructions seems to use Plans ? |
@lellex Yes the API key has nothing to do with iOS because that's use Plan. Did you try to set you map in absolute position with the props top, right, left and bottom set to |
Thanks, but I didn't install the plugin correctly (first time I try on iOS)... and it's works fine ! |
@lellex Ok great 👍 |
I had the same problem |
how did you solve i am facing exact same problem |
If it works locally but not when uploaded to the Play store and you use Play App Signing. Make sure the Play signing key is whitelisted in the "Maps SDK for Android" you can find the SHA1 key in the Play console under "Setup -> App integrity -> App signing key certificate". |
create second API for the android ...It works for me... |
Hello, @magrinj This blank map issue occurred on iOS simulator. I am going to use Apple Maps with react-native-maps module on iOS And the geocode, I am getting without Google Map API Key. Here is my code and API
Thanks in advance. |
can you pass provider="google" to MapView and test it because on IOS default is apple map |
Thank you for your reply, @chanphiromsok You, I am going to use apple map on iOS version Please give me your reply if you have experience in this. Thanks again! :) |
can you try physical device?
|
@chanphiromsok , My react-native-maps version is And I can not test on physical server |
do you use bare project react-native or expo? if so can you try with a new project and run the simulator again? |
@chanphiromsok , i am using react-native-cli |
which version are you using ? , can you new init new project ? and test it ? |
@chanphiromsok , |
now can you try to create new project and test it again and build new |
@chanphiromsok I have tried that but does not work |
can you remove condition rendering ? on MapView just display MapView without any logic |
seem weird I dont have issue like that |
Yup, I did not add any logic in this app. |
I see your maps is loaded can you try pass initialCamera to MapView |
What do you mean? |
I don't know about your configuration in native side I don't know how is your config if so do you have experienced with expo ? you can try expo prebuild in case you are missing configuration |
I tried :
i am using my apikey already on my website. i am trying to use this on android too. also i added sha1 key. but it removed my other restrict for website on console. At the end i removed al Restricts and save it. After that it work but i know that it shoudl be Restricted for website and mobile app. But For now, I can say that I saved the day for development. At least I found the source of the problem.
|
Thanks for your kind help. Great appreciate. |
@GundamSudarshan did you enabled new fabric in gradle.properties. ( new architecture true) set this false and clean last build with cd android & ./gradlew clean . After rebuild app. If it works tell us |
@OFD16 gradle.properties new architecture is in true only. Map was not showing it's was showing in gray colour |
@GundamSudarshan convert it false and try again like i said. If it works check the is configration is exist for new arch in maps package |
@OFD16 It's convert into false also. It's was not working. It's was showing in red colour |
Upon running it, all I get is an empty box with red outline.
The text was updated successfully, but these errors were encountered: