teovillanueva / react-native-web-maps

Cross platform maps for react & react-native 🗺
https://teovillanueva.github.io/react-native-web-maps/
MIT License
54 stars 14 forks source link

Geojson tag still not recognized #12

Closed jbcsamonte closed 1 year ago

jbcsamonte commented 1 year ago

Hi there,

Contrary to the documentation, the geojson tag still doesn't work when running the application into web. image

I'm currently encountering the following error when I'm trying it out. This is also the same error with the original react-native-web-maps API.

Providing you with the screenshots of the errors encountered. Hoping this would be resolved in the next update of the API. image

image

teovillanueva commented 1 year ago

Hey! Are you using nextjs?

teovillanueva commented 1 year ago

Nvm, just found the issue, the Geojson component is not being exported from the index.web.ts file. Would you mind opening a PR with the fix? I'm a little bit busy right now. Else I can push the change on the weekend :)

teovillanueva commented 1 year ago

Fixed by #13

jbcsamonte commented 1 year ago

Hi,

please let me know if the update has been packaged to npm so I can tri it out again on my project. Thank you

image

teovillanueva commented 1 year ago

Hey! Just published the changes, let me know if it worked :)

jbcsamonte commented 1 year ago

Hey! Just published the changes, let me know if it worked :)

Unforturantely, error still exists.. image

I reinstalled the api by using yarn expo install @teovilla/react-native-web-maps

teovillanueva commented 1 year ago

It looks like Expo web may not be transpiling the module. Would you mind showing me your webpack.config.js

jbcsamonte commented 1 year ago

It looks like Expo web may not be transpiling the module. Would you mind showing me your webpack.config.js

Here's my webpack.config.js file

image

teovillanueva commented 1 year ago

Do you know if the issue is exactly with the Geojson component? Would you mind trying with the marker or Polygon component?

jbcsamonte commented 1 year ago

same error on markers image

console error log: image

jbcsamonte commented 1 year ago

On an additional, even without the components inside the mapview tag.. i cant seem to load the map on mapview and it shows the same error above..

this is my code for the app.js ` import { StatusBar } from "expo-status-bar"; import { StyleSheet, Text, View, Dimensions, TextInput } from "react-native"; import MapView, { Geojson, Marker, Polygon } from "react-native-maps"; // import Geojson from "react-native-geojson";

const mapWidth = Dimensions.get("window").width; const mapHeigth = (Dimensions.get("window").height / 12) * 10;

export default function App() {

const abraMarker = { latitude: 17.453, longitude: 120.7, latitudeDelta: 0.0922, longitudeDelta: 0.0421, };

return (

); }

const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: "#fff", alignItems: "center", justifyContent: "center", }, map: { width: mapWidth, height: mapHeigth, }, addressInput: { width: 250, height: 40, margin: 12, borderWidth: 1, padding: 5, }, });

`

teovillanueva commented 1 year ago

Just published version 0.6.3, this issue should be fixed.