Enabling Google Maps in Neatline
My students and I were having difficulty loading Google Maps in Neatline, so I came up with two possible solutions. The first is to upload alternative map layers. The second is to obtain a Google API key and plug it into the Neatline code. After some googling, I discovered several threads that indicated that (at least in the past) there had been a problem with Neatline’s code for OpenLayers, which doesn’t play well with Google Maps as is, but could if a Google API key were added.
If you want to add an API key, here is what you do:
- Get a Google Maps Javascript API key. These are free as long as you have less than 25,000 map loads per day. You can register for an API code here: https://developers.google.com/maps/documentation/javascript/get-api-key
- Make sure you have backed up your site recently. If you have not, it might be a good idea to do it now.
- Go to your Omeka install and navigate to this file: [Your Omeka Name]/plugins/Neatline/helpers/Assets.php
- Open the file in the editor.
- Find this line: nl_appendScript(‘//maps.google.com/maps/api/js?v=3.20&sensor=false’);
- Rewrite the code and paste in your Google API key so that the line looks like this: nl_appendScript(‘//maps.google.com/maps/api/js?key=[YOUR KEY GOES HERE]’);
- Save the file.
Powered by WPeMatico