forked from developmentseed/openlayers_plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenlayers_plus.module
137 lines (134 loc) · 5.38 KB
/
openlayers_plus.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/**
* Implementation of hook_block().
*/
function openlayers_plus_block($op, $delta = 0) {
switch ($op) {
case 'list':
$blocks = array('blockswitcher' => array('info' => t('OL+ Blockswitcher')));
return $blocks;
case 'view':
switch ($delta) {
case 'blockswitcher':
return array(
'subject' => t('Map layers'),
'content' => theme('openlayers_plus_blockswitcher')
);
case 'blocktoggle':
return array(
'subject' => t('Map layers'),
'content' => theme('openlayers_plus_blocktoggle')
);
}
}
}
/**
* Implementation of hook_theme().
*/
function openlayers_plus_theme() {
return array(
'openlayers_plus_blockswitcher' => array(
'arguments' => array(),
'path' => drupal_get_path('module', 'openlayers_plus') . '/theme',
'template' => 'openlayers-plus-blockswitcher',
'file' => 'theme.inc',
),
'openlayers_plus_blocktoggle' => array(
'arguments' => array('a_label' => '', 'b_label' => ''),
'path' => drupal_get_path('module', 'openlayers_plus') . '/theme',
'template' => 'openlayers-plus-blocktoggle',
'file' => 'theme.inc',
),
'openlayers_plus_legend_raw' => array(
'arguments' => array('raw' => '', 'layer' => array(), 'layer_id' => array()),
'path' => drupal_get_path('module', 'openlayers_plus') . '/theme',
'template' => 'openlayers-plus-legend-raw',
'file' => 'theme.inc',
),
'openlayers_plus_legend' => array(
'arguments' => array('legend' => array(), 'layer' => array(), 'layer_id' => array()),
'path' => drupal_get_path('module', 'openlayers_plus') . '/theme',
'template' => 'openlayers-plus-legend',
'file' => 'theme.inc',
),
);
}
/**
* Implementation of hook_openlayers_behaviors().
*
* This is a ctools plugins hook.
*/
function openlayers_plus_openlayers_behaviors() {
return array(
'openlayers_plus_behavior_blockswitcher' => array(
'title' => t('OL+: Blockswitcher'),
'description' => t('A clone of LayerSwitcher, with better themability and positioning via the Drupal block system.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') .'/behaviors',
'file' => 'openlayers_plus_behavior_blockswitcher.inc',
'class' => 'openlayers_plus_behavior_blockswitcher',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_blocktoggle' => array(
'title' => t('OL+: Blocktoggle'),
'description' => t('A version of BlockSwitcher that toggles between two different layers only. Useful for situations in which layers represent the same data in slightly different ways.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') .'/behaviors',
'file' => 'openlayers_plus_behavior_blocktoggle.inc',
'class' => 'openlayers_plus_behavior_blocktoggle',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_legend' => array(
'title' => t('OL+: Map legend'),
'description' => t('A block in a corner of a map that provides information on layers.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') .'/behaviors',
'file' => 'openlayers_plus_behavior_legend.inc',
'class' => 'openlayers_plus_behavior_legend',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_permalink' => array(
'title' => t('OL+: Permalink'),
'description' => t('A version of Permalink optimized to persist layers between pages with different layer setups and without explicitly using the control.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') .'/behaviors',
'file' => 'openlayers_plus_behavior_permalink.inc',
'class' => 'openlayers_plus_behavior_permalink',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_scalepoints' => array(
'title' => t('OL+: Scalepoints'),
'description' => t('Dynamic styling, changing point radii based on a certain value.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') .'/behaviors',
'file' => 'openlayers_plus_behavior_scalepoints.inc',
'class' => 'openlayers_plus_behavior_scalepoints',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_tooltips' => array(
'title' => t('OL+: Tooltips'),
'description' => t('An interaction with point-based maps that results in following links on hover.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') .'/behaviors',
'file' => 'openlayers_plus_behavior_tooltips.inc',
'class' => 'openlayers_plus_behavior_tooltips',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_popup' => array(
'title' => t('OL+: Popups'),
'description' => t('An interaction with point-based, clustered maps that allows clicking on points that results in scanning between items.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') .'/behaviors',
'file' => 'openlayers_plus_behavior_popup.inc',
'class' => 'openlayers_plus_behavior_popup',
'parent' => 'openlayers_behavior',
),
),
);
}