dcfemtech / hackforgood-waba-map

DCFemTech Hack for Good 2016 - WABA Bike Map Project
MIT License
10 stars 9 forks source link

Map addition: add "What's my location" function #119

Open WABA-Comms opened 7 years ago

WABA-Comms commented 7 years ago

Not much more to add, other than we love this idea! @alulsh, anything else to add?

alulsh commented 7 years ago

Here's an old PR for this: https://github.com/dcfemtech/hackforgood-waba-map/pull/7

Also, the original issue: https://github.com/dcfemtech/hackforgood-waba-map/issues/2

If someone can add https://github.com/dcfemtech/hackforgood-waba-map/pull/7 to our current codebase but with a lower zoom level (11-14) instead of 16 (see https://github.com/dcfemtech/hackforgood-waba-map/pull/7#commitcomment-18013906) then I'll gladly merge this!

mdelcambre commented 7 years ago

We will need to make sure that it is served over HTTPS, Chrome disabled location over insecure hosts: https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins

If you try to use it on chrome right now, you get this error: getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.

alulsh commented 7 years ago

@mdelcambre GitHub recently added HTTPS support to all GitHub pages sites in June 2016 (see https://github.com/blog/2186-https-for-github-pages) so I think we're good here! We're using HTTPS: https://dcfemtech.github.io/hackforgood-waba-map/.

Testing locally right over HTTP will throw an error though. The WABA website is also served over HTTP (http://www.waba.org/) - so this will throw assorted mixed content errors if we embed the project on their website (cc @nellepierson).

You could get around the local testing issue by generating your own self-signed certificate with OpenSSL

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -subj '/C=US/ST=DC/O=Test' -nodes

Then using a local web server to use the above cert. Looks like serve does support HTTPS per the readme but I am getting the following errors when trying to test locally:

alexandraulsh@Bikini-Kill hackforgood-waba-map* master $ serve -s

  error: unknown option `-s'

alexandraulsh@Bikini-Kill hackforgood-waba-map* master $ serve --https

  error: unknown option `--https'
mdelcambre commented 7 years ago

Yes I noticed after I commented that because we use github pages, it is secure.

For server, the https options appear to have been added after the last release. git blame shows those options on Mar 30, 2014 and the latest (1.4.0) was released Mar 13, 2014