react-native-webview-leaflet
react-native-webview-leaflet copied to clipboard
Map not show
My map only looks blue, even the example they give on it. the map does not move or show any interaction
From my experience, it happens because one of the parameters passed to the map is somehow wrong
` render() {
return (
<WebViewLeaflet styles={styles.zIndex}
ref={(ref) => {
if(this.state.WebViewLeafletRef == null)
this.setState({WebViewLeafletRef:ref})
}}
backgroundColor={"green"}
zoom={2}
onLoadEnd={()=>{
let mapLayers = this.state.mapLayers;
this.state.WebViewLeafletRef.sendMessage({
mapLayers
});
}}
onLoadStart={(a)=>console.log("start")}
doShowDebugMessages={true}
mapCenterPosition={{lat: 6.00, lng:-70.00}}
onMessageReceived={this.onMessageReceived}
/>
);
} }` This is my render, even though I have reviewed the past insights I still cannot solve the problem
I have reviewed the library and notice that the MAP_READY event never fires. and I only have this in the render..
return ( <WebViewLeaflet/> );
You have to have the 'onMessageReceived' prop, otherwise the map won't show. As for your first comment, try removing every prop exect for 'onMessageReceived', and then add one prop at a time until the map won't show again