06-22-2017 05:45 AM
Hi,
I recently have a strange problem when any photos with geo-tagging unable to load into Google Maps.
From Javascript console, the error message was clear: MissingKeyMapError (see file attached)
I try to delete /share folder but still no luck.
Following are my Alfresco version (installed on CentOS 7):
06-22-2017 06:26 AM
Hi,
Google Maps needs API Key to consume this services.
In my case, I solved this issue as follows:
First we have to generate our APIKey form Google. More information:
https://developers.google.com/maps/documentation/javascript/get-api-key?hl=ES
After that, the quick solution (maybe not the best) is to modify this files (the best option is to extend share):
[Alfresco]\tomcat\webapps\share\components\geographic\google-map.js
[Alfresco]\tomcat\webapps\share\components\geographic\google-map-min.js
In both files, when we make a request to Google Maps, we will add a parameter "key=OUR_API_KEY", so the url will be:
script.src = window.location.protocol + "//maps.google.com/maps/api/js?sensor=false&key=OUR_API_KEY&callback=Alfresco.component.GoogleMap.Callback";
Regards,
06-22-2017 06:49 AM
Hi calvo _
On my previous/other installation -- and I was thought it was default configuration -- that API Key is not required, until this happened.
Actually the correct map was loaded for a milliseconds, and then switched to error page.
This View a file on Google Maps | Alfresco Documentation also not mention about the API Key to view a file on Google Maps.
Anyway thanks for your tricks.
[bayu]
06-22-2017 07:16 AM
Hi Bayu Widyasanyata,
Me too. I had the same behaviour "the correct map was loaded for a milliseconds, and then switched to error page", so I changed that couple of files and it works (version 201704).
Anyway, I will appreciate any other solutions from the community 🙂
Thank you so much
Regards,
06-22-2017 08:16 AM
Hi calvo _,
Following some points after my little research on my platform:
Here are the results:
I haven't known yet why IP address and NginX has the right-answer for the problem. 😞
Thank you,
[bayu]
06-23-2017 12:28 AM
I want to update my latest research regarding this issues:
I then add nginx onto one of my installation (201704) which I expect will solve the issue. The result is fail. URI accessed is alfresco.dev.
But when I changed to same uri/hostname (alfrescoecm.dev) with another alfresco which successfully loaded Google Maps, then the photo can be loaded normally. (point #2 on my answer above)
So, it looks my hostname (alfrescoecm.dev) is already "white-listed" by Google Maps to access without key ("anonymous").
For my another machine hosted on Internet, this problem is not affected.
Hence, summarizing: problems found on localdomain hostname which hasn't been "registered"/"whitelisted" to Google Maps API key.
If anyone has another experiences and solutions, pls share... Thanks,
Explore our Alfresco products with the links below. Use labels to filter content by product module.