Enabling Google Maps in Neatline

Enabling Google Maps in Neatline

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:

  1. 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
  2. Make sure you have backed up your site recently. If you have not, it might be a good idea to do it now.
  3. Go to your Omeka install and navigate to this file: [Your Omeka Name]/plugins/Neatline/helpers/Assets.php
  4. Open the file in the editor.
  5. Find this line: nl_appendScript(‘//maps.google.com/maps/api/js?v=3.20&sensor=false’);
  6. 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]’);
  7. Save the file.

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

css.php