forked from discoverygarden/islandora_mapping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
islandora_mapping.module
55 lines (51 loc) · 1.5 KB
/
islandora_mapping.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* @file
* Defines all the hooks this module implements.
*
* This module provides theme functions to embed maps within pages.
*/
/**
* Implements hook_theme().
*/
function islandora_mapping_theme() {
return array(
'islandora_mapping_map_single_item' => array(
'variables' => array(
'latitude' => NULL,
'longitude' => NULL,
'div_id' => 'islandora_mapping_map_mapper',
'height' => '400',
'width' => '600',
),
),
'islandora_mapping_map_multi_item' => array(
'variables' => array(
'locations' => array(),
'map_options' => NULL,
'map_style' => 'height:500px;width:500px;',
),
),
);
}
/**
* Implements wrapper to map single item.
*/
function theme_islandora_mapping_map_single_item(array $variables) {
$latitude = $variables['latitude'];
$longitude = $variables['longitude'];
$div_id = $variables['div_id'];
$height = $variables['height'];
$width = $variables['width'];
return ip_geoloc_output_map($latitude, $longitude, $div_id, "height: " . $height . "; width:" . $width . ";");
}
/**
* Implements wrapper to map multi item.
*/
function theme_islandora_mapping_map_multi_item(array $variables) {
$locations = $variables['locations'];
$map_options = $variables['map_options'];
$map_style = $variables['map_style'];
return ip_geoloc_output_map_multi_location($locations, 'ip-geoloc-map-multi-locations',
$map_options, $map_style, NULL, FALSE, 1, $center_latlng = array(0, 0), FALSE);
}