Skip to content
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

Use something else than Google Maps for maps #76

Open
amaury1093 opened this issue Apr 17, 2019 · 16 comments
Open

Use something else than Google Maps for maps #76

amaury1093 opened this issue Apr 17, 2019 · 16 comments
Assignees
Labels
good first issue Good for newcomers Hacktoberfest https://hacktoberfest.digitalocean.com/

Comments

@amaury1093
Copy link
Member

amaury1093 commented Apr 17, 2019

We plan to launch the app in China (where pollution is serious). However, we're using google maps, which is blocked.

An alternative would be mapbox, but we need to make sure it's not blocked in China. Or better: open street map.

Also, this might require ejecting from Expo. If possible, let's not eject from Expo.

@amaury1093 amaury1093 added the question Further information is requested label Apr 17, 2019
@amaury1093
Copy link
Member Author

amaury1093 commented May 6, 2019

To make it work with Expo, we could use a 100% JS solution: https://github.com/reggie3/react-native-webview-leaflet or https://github.com/allenhwkim/react-openlayers

Performance is not an issue here (the map is mostly decorative), so we don't need a native component

@amaury1093 amaury1093 added good first issue Good for newcomers and removed question Further information is requested labels May 6, 2019
@theaupoulat
Copy link

Still open ?

@amaury1093
Copy link
Member Author

Yes! It'd be good to see what's out there, and with what we can replace it. The requirements are:

  • works behind the the great firewall
  • doesn't require to eject expo
  • no loss of functionality compared to now (which is not much: select a bounding box to show, add 2 markers with custom image, popups on markers).

@theaupoulat would you like to work on this?

@theaupoulat
Copy link

theaupoulat commented Aug 16, 2019

I have similar requirements for a project so I'll gladly help! My first intuition is leaflet too.

@theaupoulat
Copy link

@amaurymartiny Having problems with algolia API, keep getting 403 errors on each search (I put algolia keys). Is it a known issue when setting development env ?

@amaury1093
Copy link
Member Author

Hmm, I'm not sure, is there an error message with the 403?

Alternatively, try setting null and null (without quotes) to the 2 algolia fields in app.json, they have a generous free tier.

@theaupoulat
Copy link

It was a version problem with react-native-reanimated and expo. Solved it ! thanks !

@amaury1093
Copy link
Member Author

Hi @theaupoulat! Any progress on your side? Are you still interested in working on this?

@LuKenneth
Copy link

I can give this a shot if you guys don't mind!

@amaury1093
Copy link
Member Author

Sure 🚀! @theaupoulat hasn't been answering, so go ahead @LuKenneth, I just assigned you.

@LuKenneth
Copy link

So I started taking a look at this tonight, I got the app running on my iPhone with no problems. Then I began looking into replacing the map provider with open street maps. What I successfully did was add a 'UrlTile' on the map to use open street maps, but I believe that's just an overlay over the existing map provider, which isn't what we're looking for. I decided I needed to make my attempts on an android device so that I could see the default Google Maps being replaced. I discovered this package (https://www.npmjs.com/package/react-native-maps-osmdroid) which seems to seamlessly replace google maps with open street maps on android. I yarn removed react-native-maps in favor of react-native-maps-osmdroid which I hoped would magically make everything work (so it seemed would be the case in the readme of the npm package site). But after running yarn start and launching it in my android emulator it fails on start up. Any idea what could be wrong here? Heading to bed for the night, but will look into it later. And I may shift to leaflet/whatever you linked above.
smoke_sentry

@amaury1093
Copy link
Member Author

amaury1093 commented Oct 3, 2019

Hey @LuKenneth, yeah that happens when you have an incorrect sentry DSN. Try to put null (without quotes) in the app.json field

Note: I updated the README too, you're not the first one to ask this

@amaury1093
Copy link
Member Author

Hey @LuKenneth, are you still working on this? Do you need any help?

@LuKenneth
Copy link

@amaurymartiny Sorry, I've been busy/traveling lately. Using null like you said fixed my issue above, thanks for that. I still plan on completing this - I can't remember where I last left off. I'll jump back in later tonight after work, and I'll update you!

@LuKenneth
Copy link

LuKenneth commented Oct 22, 2019

@amaurymartiny I remember where i was now... I tried to use https://github.com/allenhwkim/react-openlayers and https://github.com/allenhwkim/react-openlayers, but for each - I had trouble importing it because they don't have typed equivalents. Is my only option to created the typed module myself? That would be something brand new to me. Any advice?

@amaury1093
Copy link
Member Author

is my only option to created the typed module myself?

No, you have several options:

  1. you can just put inside App/ambient.d.ts the following line
declare module 'react-openlayers';

(read: https://stackoverflow.com/questions/48224858/import-require-nodejs-modules-without-types-in-typescript-in-2018)

And everything in react-openlayers will have the any type.

  1. You can just put
// eslint-disable-next-line
// @ts-ignore
import openLayers from 'react-openlayers';

If react-openlayers is used in several places, I'd prefer solution 1. Or else solution 2 is fine for me too.

@amaury1093 amaury1093 assigned LuKenneth and unassigned LuKenneth Feb 6, 2020
@amaury1093 amaury1093 added the Hacktoberfest https://hacktoberfest.digitalocean.com/ label Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Hacktoberfest https://hacktoberfest.digitalocean.com/
Projects
None yet
Development

No branches or pull requests

3 participants