Plugins/Geolocation

Before Installing

This plugin works with Google Maps, so you will need to sign up for a Google account if you do not already have one. Once you do that, obtain a Google Maps API Key. This key is required to use the Geolocation plugin. Once you have your key, you can install and configure the plugin.

Installation

  1. Upload the Geolocation plugin folder into your plugins folder on the server; See: Installing a Plugin.
  2. Activate it from the admin → Settings → Plugins page.
  3. Click the Configure link to add the following:
    • Your API key
    • The default location coordinates for your map (the location that displays at the center of the map.)
    • The default zoom level for your map. Enter a number from 1-20, with 1 displaying a view of the Earth and 20 showing exact placement on a street.

Using the Geolocation Plugin

Browsing Items by a Map

The Geolocation plugin will create a page for browsing items via a Google Map. Once your plugin is activated, you can access the page at http://example.com/geolocation/map/browse, where example.com is the path to your Omeka installation.

To add a link to your map/browse page in your main navigation, edit your theme's header.php, and add the following to your public_nav_main() function:

'Map' => uri('geolocation/map/browse')

Learn more about the public_nav_main() helper function.

Showing a Map on the Item/Show page

To show a map indicating where an item is located on the item/show page, you need to use the geolocation_map_for_item() function on item/show.php. The geolocation_map_for_item() function has three arguments:

<?php echo geolocation_google_map_for_item($item,$width='200',$height='200'); ?>

The values for width and height of the map default to 200px. If you'd like to change those values, simply put the desired values when using the function on the show.php page. So, for example, if you want a map on the item/show page that has a width of 400px and a height of 300px, you would use the following code:

<?php echo geolocation_google_map_for_item($item,'400','300'); ?>

Geolocation and Other Plugins

Keep in mind that if you are activating other plugins that append the items/show page for displaying content those elements may crowd the page's public display.