-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathding_library.openlayers_maps.inc
More file actions
127 lines (121 loc) · 3.58 KB
/
ding_library.openlayers_maps.inc
File metadata and controls
127 lines (121 loc) · 3.58 KB
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
<?php
/**
* @file
* ding_library.openlayers_maps.inc
*/
/**
* Implements hook_openlayers_maps().
*/
function ding_library_openlayers_maps() {
$export = array();
$openlayers_maps = new stdClass();
$openlayers_maps->disabled = FALSE; /* Edit this to true to make a default openlayers_maps disabled initially */
$openlayers_maps->api_version = 1;
$openlayers_maps->name = 'ding_library_map';
$openlayers_maps->title = 'Ding! library map';
$openlayers_maps->description = 'Map of libraries ';
$openlayers_maps->data = array(
'width' => 'auto',
'height' => '225px',
'image_path' => '',
'css_path' => '',
'proxy_host' => '',
'hide_empty_map' => 0,
'center' => array(
'initial' => array(
'centerpoint' => '12.543640136217, 55.68726232509',
'zoom' => '12',
),
'restrict' => array(
'restrictextent' => 0,
'restrictedExtent' => '',
),
),
'behaviors' => array(
'openlayers_behavior_fullscreen' => array(
'activated' => 0,
),
'openlayers_behavior_keyboarddefaults' => array(),
'openlayers_behavior_navigation' => array(
'zoomWheelEnabled' => 1,
'zoomBoxEnabled' => 1,
'documentDrag' => 0,
),
'openlayers_behavior_panzoom' => array(),
'openlayers_behavior_tooltip' => array(
'layers' => array(
'ding_library_openlayers_1' => 'ding_library_openlayers_1',
),
),
),
'default_layer' => 'mapquest_osm',
'layers' => array(
'mapquest_osm' => 'mapquest_osm',
'ding_library_openlayers_1' => 'ding_library_openlayers_1',
),
'layer_weight' => array(
'ding_library_openlayers_1' => '0',
'openlayers_kml_example' => '0',
'openlayers_geojson_picture_this' => '0',
'geofield_formatter' => '0',
),
'layer_styles' => array(
'geofield_formatter' => '0',
'openlayers_geojson_picture_this' => '0',
'openlayers_kml_example' => '0',
'ding_library_openlayers_1' => '0',
),
'layer_styles_select' => array(
'geofield_formatter' => '0',
'openlayers_geojson_picture_this' => '0',
'openlayers_kml_example' => '0',
'ding_library_openlayers_1' => '0',
),
'layer_styles_temporary' => array(
'geofield_formatter' => '0',
'openlayers_geojson_picture_this' => '0',
'openlayers_kml_example' => '0',
'ding_library_openlayers_1' => '0',
),
'layer_activated' => array(
'ding_library_openlayers_1' => 'ding_library_openlayers_1',
'geofield_formatter' => 0,
'openlayers_geojson_picture_this' => 0,
'openlayers_kml_example' => 0,
),
'layer_switcher' => array(
'ding_library_openlayers_1' => 0,
'geofield_formatter' => 0,
'openlayers_geojson_picture_this' => 0,
'openlayers_kml_example' => 0,
),
'projection' => 'EPSG:900913',
'displayProjection' => 'EPSG:4326',
'styles' => array(
'default' => 'default',
'select' => 'default',
'temporary' => 'default',
),
);
$export['ding_library_map'] = $openlayers_maps;
return $export;
}
/**
* Implements hook_openlayers_map_preprocess_alter().
*/
function ding_library_openlayers_map_preprocess_alter(&$map) {
if (arg(0) != 'node' || !is_numeric(arg(1))) {
return;
}
$node = node_load(arg(1));
if (empty($node->field_geocode)) {
return;
}
$centerpoint = $node->field_geocode[LANGUAGE_NONE][0]['lon'] . ', ' . $node->field_geocode[LANGUAGE_NONE][0]['lat'];
$map['center'] = array(
'initial' => array(
'centerpoint' => $centerpoint,
'zoom' => '16',
),
);
}