How To: Geolocation

Jump to: navigation, search

Contents

Installation

1. This plugin works with Google Maps, so you will need to sign up for a Google account if you do not already have one.

2. Next, obtain a Google Maps API key. Go here to apply for a: key. Once you have your key, you can install and configure the plugin.

3. Upload and install the Geo-location plugin into your plugins folder on the server, see: Installing a Plugin.

4. Activate it from the admin=>Settings=>Plugins page. Then click Configure.

5. Add your API key.

6. You will be asked to set the default location coordinates for your map—or the location that displays at the center of the map.

7. Set the default zoom level to determine the level of detail you want to appear on the 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/map/browse, where example.com is the path to your Omeka installation.

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 map_for_item() function on item/show.php. The map_for_item() function has three arguments:

<?php echo 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 map_for_item($item,'400','300'); ?>

Personal tools

Toolbox