|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This group contains all Leaflet related files of the Maps extension. |
|
5
|
|
|
* |
|
6
|
|
|
* @defgroup Leaflet |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* This file holds the hook and initialization for the Leaflet service. |
|
11
|
|
|
* |
|
12
|
|
|
* @licence GNU GPL v2+ |
|
13
|
|
|
* @author Pavel Astakhov < [email protected] > |
|
14
|
|
|
*/ |
|
15
|
|
|
|
|
16
|
|
|
// Check to see if we are being called as an extension or directly |
|
17
|
|
|
if ( !defined( 'MEDIAWIKI' ) ) { |
|
18
|
|
|
die( 'This file is an extension to MediaWiki and thus not a valid entry point.' ); |
|
19
|
|
|
} |
|
20
|
|
|
|
|
21
|
|
|
call_user_func( function() { |
|
22
|
|
|
global $wgResourceModules; |
|
23
|
|
|
|
|
24
|
|
|
$pathParts = ( explode( DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR, __DIR__, 2 ) ); |
|
25
|
|
|
|
|
26
|
|
|
$wgResourceModules['ext.maps.leaflet'] = [ |
|
27
|
|
|
'dependencies' => [ 'ext.maps.common' ], |
|
28
|
|
|
'localBasePath' => __DIR__, |
|
29
|
|
|
'remoteExtPath' => end( $pathParts ), |
|
30
|
|
|
'group' => 'ext.maps', |
|
31
|
|
|
'targets' => [ |
|
32
|
|
|
'mobile', |
|
33
|
|
|
'desktop' |
|
34
|
|
|
], |
|
35
|
|
|
'scripts' => [ |
|
36
|
|
|
'jquery.leaflet.js', |
|
37
|
|
|
'ext.maps.leaflet.js', |
|
38
|
|
|
], |
|
39
|
|
|
'messages' => [ |
|
40
|
|
|
'maps-markers', |
|
41
|
|
|
'maps-copycoords-prompt', |
|
42
|
|
|
'maps-searchmarkers-text', |
|
43
|
|
|
], |
|
44
|
|
|
]; |
|
45
|
|
|
|
|
46
|
|
|
$wgResourceModules['ext.maps.leaflet.fullscreen'] = [ |
|
47
|
|
|
'localBasePath' => __DIR__ . '/leaflet.fullscreen', |
|
48
|
|
|
'remoteExtPath' => end( $pathParts ) . '/leaflet.fullscreen', |
|
49
|
|
|
'group' => 'ext.maps', |
|
50
|
|
|
'targets' => [ |
|
51
|
|
|
'mobile', |
|
52
|
|
|
'desktop' |
|
53
|
|
|
], |
|
54
|
|
|
'scripts' => [ |
|
55
|
|
|
'Control.FullScreen.js', |
|
56
|
|
|
], |
|
57
|
|
|
'styles' => [ |
|
58
|
|
|
'Control.FullScreen.css', |
|
59
|
|
|
], |
|
60
|
|
|
]; |
|
61
|
|
|
|
|
62
|
|
|
$wgResourceModules['ext.maps.leaflet.markercluster'] = [ |
|
63
|
|
|
'localBasePath' => __DIR__ . '/leaflet.markercluster', |
|
64
|
|
|
'remoteExtPath' => end( $pathParts ), |
|
65
|
|
|
'group' => 'ext.maps', |
|
66
|
|
|
'targets' => [ |
|
67
|
|
|
'mobile', |
|
68
|
|
|
'desktop' |
|
69
|
|
|
], |
|
70
|
|
|
'scripts' => [ |
|
71
|
|
|
'leaflet.markercluster.js', |
|
72
|
|
|
], |
|
73
|
|
|
'styles' => [ |
|
74
|
|
|
'MarkerCluster.css', |
|
75
|
|
|
], |
|
76
|
|
|
]; |
|
77
|
|
|
|
|
78
|
|
|
$wgResourceModules['ext.maps.leaflet.providers'] = [ |
|
79
|
|
|
'localBasePath' => __DIR__ . '/leaflet-providers', |
|
80
|
|
|
'remoteExtPath' => end( $pathParts ) . '/leaflet-providers', |
|
81
|
|
|
'group' => 'ext.maps', |
|
82
|
|
|
'targets' => [ |
|
83
|
|
|
'mobile', |
|
84
|
|
|
'desktop' |
|
85
|
|
|
], |
|
86
|
|
|
'scripts' => [ |
|
87
|
|
|
'leaflet-providers.js', |
|
88
|
|
|
], |
|
89
|
|
|
]; |
|
90
|
|
|
} ); |
|
91
|
|
|
|