|
@ -1,5 +1,5 @@ |
|
|
import React, { useState, useEffect } from "react"; |
|
|
import React, { useState, useEffect } from "react"; |
|
|
import { View } from "react-native"; |
|
|
|
|
|
|
|
|
import { View, Linking } from "react-native"; |
|
|
import WebView from "react-native-webview"; |
|
|
import WebView from "react-native-webview"; |
|
|
import { |
|
|
import { |
|
|
setViewCode, |
|
|
setViewCode, |
|
@ -56,8 +56,6 @@ export default function OpenStreetMap({ |
|
|
renderOptions: dataOptionsToShow, |
|
|
renderOptions: dataOptionsToShow, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(markersList)
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (markersList && mapRef) { |
|
|
if (markersList && mapRef) { |
|
|
deleteAllMarkers(mapRef); |
|
|
deleteAllMarkers(mapRef); |
|
@ -91,7 +89,13 @@ export default function OpenStreetMap({ |
|
|
javaScriptEnabled={true} |
|
|
javaScriptEnabled={true} |
|
|
source={{ html: webviewContent }} |
|
|
source={{ html: webviewContent }} |
|
|
injectedJavaScript={viewFunction} |
|
|
injectedJavaScript={viewFunction} |
|
|
|
|
|
|
|
|
|
|
|
onShouldStartLoadWithRequest={(event) => { |
|
|
|
|
|
if (event.url.slice(0, 4) === "http") { |
|
|
|
|
|
Linking.openURL(event.url); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
}} |
|
|
/> |
|
|
/> |
|
|
)} |
|
|
)} |
|
|
{!isForm && ( |
|
|
{!isForm && ( |
|
|