keystonejs / keystone-classic

Node.js CMS and web app framework
http://v4.keystonejs.com
MIT License
14.63k stars 2.21k forks source link

Use other geocoding-service for location enrichment when no Google Maps API-Key available #1533

Closed stfnsr closed 9 years ago

stfnsr commented 9 years ago

As much as I enjoy using Google's APIs, maybe it would be nice to have something that works out of the box without having to provide an API-Key? Mapquest for example: http://open.mapquestapi.com/nominatim/

stfnsr commented 9 years ago

Processwire (a PHP CMS/CMF which i used a couple of times) uses google geocoding without needing an API Key. https://github.com/ryancramerdesign/FieldtypeMapMarker/blob/48090d01a524ed33c1de71d61003e848067e5152/MapMarker.php#L79

Also Google Developer Guide sounds like an API Key isn't strictly neccessary? https://developers.google.com/maps/documentation/geocoding/intro

All Geocoding API applications should use an API key. Including a key in your request:

  • Allows you to monitor your application's API usage in the Google Developers Console.
  • Enables per-key instead of per-IP-address quota limits.
  • Ensures that Google can contact you about your application if necessary.

Also, Client Side Geocoding sounds really nice, doesn't need key or quota, and especially no roundtrip to the server (if used via admin backend) https://developers.google.com/maps/articles/geocodestrat#client

morenoh149 commented 9 years ago

+1

JedWatson commented 9 years ago

You're correct, not sure if this changed but it looks like you don't actually need an api key for a limited number of geocodes with google. Also happy to bring this to the client, but I don't think we should get rid of the server-side implementation because it's useful in other cases. No problem having both options.

I guess we should get rid of the check for the API Key to enable the geolocation functionality, and we can update the generator as well.

stfnsr commented 9 years ago

Yes, the server-side implementation would definitely stay relevant. I wouldn't get rid of the check completely though - perhaps add an option to Type.Location to allow geocoding without key? This is because Google has certain restrictions about the ways in which you can use data gained through the API (e.g. you aren't allowed to use it with other map providers), so activating it should still be a deliberate choice.

stfnsr commented 9 years ago

I suppose if i want to tackle a client-side implementation it would be best to do this in the elemental-integration branch?

stfnsr commented 9 years ago

Apparently, the check that enables the API checks for the wrong key? But then again, the provided key isn't used anyway.