|
@ -47,7 +47,7 @@ export default function OpenStreetMap({ |
|
|
const viewFunction = `\
|
|
|
const viewFunction = `\
|
|
|
setCustomView(${global.location.lat}, ${global.location.long}, 16.5);`;
|
|
|
setCustomView(${global.location.lat}, ${global.location.long}, 16.5);`;
|
|
|
|
|
|
|
|
|
console.log(global.location) |
|
|
|
|
|
|
|
|
console.log(global.location); |
|
|
markersList && |
|
|
markersList && |
|
|
mapRef && |
|
|
mapRef && |
|
|
notEmpy(markersList) && |
|
|
notEmpy(markersList) && |
|
@ -61,22 +61,24 @@ export default function OpenStreetMap({ |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<View flex={1}> |
|
|
<View flex={1}> |
|
|
<WebView |
|
|
|
|
|
ref={(webViewRef) => { |
|
|
|
|
|
setMapRef(webViewRef); |
|
|
|
|
|
}} |
|
|
|
|
|
onMessage={(event) => { |
|
|
|
|
|
bindEventsToListeners( |
|
|
|
|
|
handleEvent(event), |
|
|
|
|
|
clickListener, |
|
|
|
|
|
setMarkerListener, |
|
|
|
|
|
moveEndListener |
|
|
|
|
|
); |
|
|
|
|
|
}} |
|
|
|
|
|
javaScriptEnabled={true} |
|
|
|
|
|
source={{ html: webviewContent }} |
|
|
|
|
|
injectedJavaScript={viewFunction} |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
{webviewContent && ( |
|
|
|
|
|
<WebView |
|
|
|
|
|
ref={(webViewRef) => { |
|
|
|
|
|
setMapRef(webViewRef); |
|
|
|
|
|
}} |
|
|
|
|
|
onMessage={(event) => { |
|
|
|
|
|
bindEventsToListeners( |
|
|
|
|
|
handleEvent(event), |
|
|
|
|
|
clickListener, |
|
|
|
|
|
setMarkerListener, |
|
|
|
|
|
moveEndListener |
|
|
|
|
|
); |
|
|
|
|
|
}} |
|
|
|
|
|
javaScriptEnabled={true} |
|
|
|
|
|
source={{ html: webviewContent }} |
|
|
|
|
|
injectedJavaScript={viewFunction} |
|
|
|
|
|
/> |
|
|
|
|
|
)} |
|
|
<View> |
|
|
<View> |
|
|
<MapModal |
|
|
<MapModal |
|
|
markerToRender={markerListener} |
|
|
markerToRender={markerListener} |
|
@ -87,5 +89,3 @@ export default function OpenStreetMap({ |
|
|
</View> |
|
|
</View> |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|