1 | <?php |
||
10 | class LeafletService implements MappingService { |
||
11 | |||
12 | private $addedDependencies = []; |
||
13 | |||
14 | 22 | public function getName(): string { |
|
17 | |||
18 | 21 | public function getAliases(): array { |
|
21 | |||
22 | public function hasAlias( string $alias ): bool { |
||
23 | return in_array( $alias, [ 'leafletmaps', 'leaflet' ] ); |
||
24 | } |
||
25 | |||
26 | 15 | public function getParameterInfo(): array { |
|
27 | 15 | $params = MapsFunctions::getCommonParameters(); |
|
28 | |||
29 | 15 | $params['zoom'] = [ |
|
30 | 'type' => 'integer', |
||
31 | 'range' => [ 0, 20 ], |
||
32 | 'default' => false, |
||
33 | 'message' => 'maps-par-zoom' |
||
34 | ]; |
||
35 | |||
36 | 15 | $params['defzoom'] = [ |
|
37 | 15 | 'type' => 'integer', |
|
38 | 'range' => [ 0, 20 ], |
||
39 | 15 | 'default' => self::getDefaultZoom(), |
|
40 | 15 | 'message' => 'maps-leaflet-par-defzoom' |
|
41 | ]; |
||
42 | |||
43 | 15 | $params['layers'] = [ |
|
44 | 15 | 'aliases' => 'layer', |
|
45 | 15 | 'type' => 'string', |
|
46 | 15 | 'values' => array_keys( $GLOBALS['egMapsLeafletAvailableLayers'], true, true ), |
|
47 | 15 | 'default' => $GLOBALS['egMapsLeafletLayers'], |
|
48 | 15 | 'message' => 'maps-leaflet-par-layers', |
|
49 | 'islist' => true, |
||
50 | ]; |
||
51 | |||
52 | 15 | $params['overlaylayers'] = [ |
|
53 | 15 | 'type' => 'string', |
|
54 | 15 | 'values' => array_keys( $GLOBALS['egMapsLeafletAvailableOverlayLayers'], true, true ), |
|
55 | 15 | 'default' => $GLOBALS['egMapsLeafletOverlayLayers'], |
|
56 | 15 | 'message' => 'maps-leaflet-par-overlaylayers', |
|
57 | 'islist' => true, |
||
58 | ]; |
||
59 | |||
60 | 15 | $params['resizable'] = [ |
|
61 | 15 | 'type' => 'boolean', |
|
62 | 15 | 'default' => $GLOBALS['egMapsResizableByDefault'], |
|
63 | 15 | 'message' => 'maps-par-resizable' |
|
64 | ]; |
||
65 | |||
66 | 15 | $params['enablefullscreen'] = [ |
|
67 | 'aliases' => [ 'fullscreen' ], |
||
68 | 'type' => 'boolean', |
||
69 | 'default' => false, |
||
70 | 'message' => 'maps-par-enable-fullscreen', |
||
71 | ]; |
||
72 | |||
73 | 15 | $params['scrollwheelzoom'] = [ |
|
74 | 'aliases' => [ 'scrollzoom' ], |
||
75 | 'type' => 'boolean', |
||
76 | 'default' => true, |
||
77 | 'message' => 'maps-par-scrollwheelzoom', |
||
78 | ]; |
||
79 | |||
80 | 15 | $params['markercluster'] = [ |
|
81 | 'type' => 'boolean', |
||
82 | 'default' => false, |
||
83 | 'message' => 'maps-par-markercluster', |
||
84 | ]; |
||
85 | |||
86 | 15 | $params['clustermaxzoom'] = [ |
|
87 | 'type' => 'integer', |
||
88 | 'default' => 20, |
||
89 | 'message' => 'maps-par-clustermaxzoom', |
||
90 | ]; |
||
91 | |||
92 | 15 | $params['clusterzoomonclick'] = [ |
|
93 | 'type' => 'boolean', |
||
94 | 'default' => true, |
||
95 | 'message' => 'maps-par-clusterzoomonclick', |
||
96 | ]; |
||
97 | |||
98 | 15 | $params['clustermaxradius'] = [ |
|
99 | 'type' => 'integer', |
||
100 | 'default' => 80, |
||
101 | 'message' => 'maps-par-maxclusterradius', |
||
102 | ]; |
||
103 | |||
104 | 15 | $params['clusterspiderfy'] = [ |
|
105 | 'type' => 'boolean', |
||
106 | 'default' => true, |
||
107 | 'message' => 'maps-leaflet-par-clusterspiderfy', |
||
108 | ]; |
||
109 | |||
110 | 15 | $params['geojson'] = [ |
|
111 | 'type' => 'jsonfile', |
||
112 | 'default' => '', |
||
113 | 'message' => 'maps-displaymap-par-geojson', |
||
114 | ]; |
||
115 | |||
116 | 15 | return $params; |
|
117 | } |
||
118 | |||
119 | /** |
||
120 | * @since 3.0 |
||
121 | */ |
||
122 | 15 | public function getDefaultZoom() { |
|
125 | |||
126 | 15 | public function newMapId(): string { |
|
133 | |||
134 | 15 | public function getResourceModules(): array { |
|
137 | |||
138 | 15 | public function getDependencyHtml( array $params ): string { |
|
152 | |||
153 | 15 | private function getDependencies( array $params ): array { |
|
164 | |||
165 | 15 | private function getLayerDependencies( array $params ) { |
|
183 | |||
184 | } |
||
185 |