Skip to content

Instantly share code, notes, and snippets.

@janit
Last active November 8, 2016 09:36
Show Gist options
  • Save janit/32ac89d16a4668021f8b92d8deeca347 to your computer and use it in GitHub Desktop.
Save janit/32ac89d16a4668021f8b92d8deeca347 to your computer and use it in GitHub Desktop.
A simple patch to enable use of eZ Platform MapLocation fieldtype with Google Maps until OpenStreetMaps work is complete.
--- vendor/ezsystems/platform-ui-bundle/Resources/public/js/services/ez-googlemapapiloader2.js 2016-11-08 11:20:11.000000000 +0200
+++ vendor/ezsystems/platform-ui-bundle/Resources/public/js/services/ez-googlemapapiloader.js 2016-11-07 11:34:54.000000000 +0200
@@ -14,7 +14,7 @@
var EVENT_MAP_API_READY = 'mapAPIReady',
EVENT_MAP_API_FAILED = 'mapAPIFailed',
- GMAP_JSONP_URI = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback={callback}';
+ GMAP_JSONP_URI = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback={callback}&key=YOUR_PERSONAL_MAP_KEY_FROM_GOOGLE_HERE';
/**
* Google Maps API loader. It fires the `mapAPIReady` event when the Google
@larseirik
Copy link

Nice, than i think we should stick with the google maps part from now! Are you able to create a key which we can use for training purposes until we switch to OSM?

@janit
Copy link
Author

janit commented Nov 8, 2016

Yes, the key AIzaSyC_urlpUf5ZkeeabDPO6hOwebjrtYR6h1o is created and can be used.

But this should not be copy-pasted anywhere since it is a dummy account with a dummy key that can be revoked at any point.

For production / project development developers should get a key from the organisation whose project it is, directly from: https://developers.google.com/maps/documentation/javascript/get-api-key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment