Completed
Push — initialization ( 43947f...bbe7dd )
by Jeroen De
13:38 queued 11:12
created

OpenLayers.php ➔ efMapsInitOpenLayers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This group contains all OpenLayers related files of the Maps extension.
5
 *
6
 * @defgroup MapsOpenLayers OpenLayers
7
 */
8
9
/**
10
 * This file holds the hook and initialization for the OpenLayers service.
11
 *
12
 * @licence GNU GPL v2+
13
 * @author Jeroen De Dauw < [email protected] >
14
 */
15
16
if ( !defined( 'MEDIAWIKI' ) ) {
17
	die( 'Not an entry point.' );
18
}
19
20
call_user_func( function() {
21
	global $wgResourceModules;
22
23
	$pathParts = ( explode( DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR, __DIR__, 2 ) );
24
25
	$wgResourceModules['ext.maps.openlayers'] = [
26
		'dependencies' => [ 'ext.maps.common' ],
27
		'localBasePath' => __DIR__,
28
		'remoteExtPath' => end( $pathParts ),
29
		'group' => 'ext.maps',
30
		'targets' => [
31
			'mobile',
32
			'desktop'
33
		],
34
		'scripts' =>   [
35
			'OpenLayers/OpenLayers.js',
36
			'OSM/OpenStreetMap.js',
37
			'jquery.openlayers.js',
38
			'ext.maps.openlayers.js'
39
		],
40
		'styles' => [
41
			'OpenLayers/theme/default/style.css'
42
		],
43
		'messages' => [
44
			'maps-markers',
45
			'maps-copycoords-prompt',
46
			'maps-searchmarkers-text',
47
		]
48
	];
49
} );
50