@@ -331,17 +331,17 @@ |
||
331 | 331 | public function serializeParams(): string { |
332 | 332 | return implode( |
333 | 333 | "&", array( |
334 | - $this->zoom, |
|
335 | - $this->lat, |
|
336 | - $this->lon, |
|
337 | - $this->width, |
|
338 | - $this->height, |
|
339 | - serialize($this->markers), |
|
340 | - $this->maptype, |
|
341 | - $this->kmlFileName, |
|
342 | - $this->gpxFileName, |
|
343 | - $this->geojsonFileName |
|
344 | - ) |
|
334 | + $this->zoom, |
|
335 | + $this->lat, |
|
336 | + $this->lon, |
|
337 | + $this->width, |
|
338 | + $this->height, |
|
339 | + serialize($this->markers), |
|
340 | + $this->maptype, |
|
341 | + $this->kmlFileName, |
|
342 | + $this->gpxFileName, |
|
343 | + $this->geojsonFileName |
|
344 | + ) |
|
345 | 345 | ); |
346 | 346 | } |
347 | 347 |
@@ -15,119 +15,119 @@ |
||
15 | 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | 16 | */ |
17 | 17 | if (! defined ( 'DOKU_INC' )) |
18 | - die (); |
|
18 | + die (); |
|
19 | 19 | |
20 | 20 | if (! defined ( 'DOKU_LF' )) |
21 | - define ( 'DOKU_LF', "\n" ); |
|
21 | + define ( 'DOKU_LF', "\n" ); |
|
22 | 22 | if (! defined ( 'DOKU_TAB' )) |
23 | - define ( 'DOKU_TAB', "\t" ); |
|
23 | + define ( 'DOKU_TAB', "\t" ); |
|
24 | 24 | if (! defined ( 'DOKU_PLUGIN' )) |
25 | - define ( 'DOKU_PLUGIN', DOKU_INC . 'lib/plugins/' ); |
|
25 | + define ( 'DOKU_PLUGIN', DOKU_INC . 'lib/plugins/' ); |
|
26 | 26 | |
27 | 27 | require_once DOKU_PLUGIN . 'syntax.php'; |
28 | 28 | /** |
29 | 29 | * adds a WMS 1.1.1 layer to your map. |
30 | 30 | */ |
31 | 31 | class syntax_plugin_openlayersmapoverlays_searchlayer extends DokuWiki_Syntax_Plugin { |
32 | - private $dflt = array ( |
|
33 | - 'id' => 'olmap', |
|
34 | - 'name' => '', |
|
35 | - 'search' => '', |
|
36 | - 'opacity' => 0.8, |
|
37 | - 'attribution' => '', |
|
38 | - 'visible' => false, |
|
39 | - 'layers' => '', |
|
40 | - 'version' => '1.1.1', |
|
41 | - 'format' => 'image/png', |
|
42 | - 'transparent' => 'true' |
|
43 | - ); |
|
32 | + private $dflt = array ( |
|
33 | + 'id' => 'olmap', |
|
34 | + 'name' => '', |
|
35 | + 'search' => '', |
|
36 | + 'opacity' => 0.8, |
|
37 | + 'attribution' => '', |
|
38 | + 'visible' => false, |
|
39 | + 'layers' => '', |
|
40 | + 'version' => '1.1.1', |
|
41 | + 'format' => 'image/png', |
|
42 | + 'transparent' => 'true' |
|
43 | + ); |
|
44 | 44 | |
45 | - /** |
|
46 | - * (non-PHPdoc) |
|
47 | - * |
|
48 | - * @see DokuWiki_Syntax_Plugin::getPType() |
|
49 | - */ |
|
50 | - public function getPType() { |
|
51 | - return 'block'; |
|
52 | - } |
|
45 | + /** |
|
46 | + * (non-PHPdoc) |
|
47 | + * |
|
48 | + * @see DokuWiki_Syntax_Plugin::getPType() |
|
49 | + */ |
|
50 | + public function getPType() { |
|
51 | + return 'block'; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * (non-PHPdoc) |
|
56 | - * |
|
57 | - * @see DokuWiki_Syntax_Plugin::getType() |
|
58 | - */ |
|
59 | - public function getType() { |
|
60 | - // return 'FIXME: container|baseonly|formatting|substition|protected|disabled|paragraphs'; |
|
61 | - return 'baseonly'; |
|
62 | - } |
|
54 | + /** |
|
55 | + * (non-PHPdoc) |
|
56 | + * |
|
57 | + * @see DokuWiki_Syntax_Plugin::getType() |
|
58 | + */ |
|
59 | + public function getType() { |
|
60 | + // return 'FIXME: container|baseonly|formatting|substition|protected|disabled|paragraphs'; |
|
61 | + return 'baseonly'; |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * (non-PHPdoc) |
|
66 | - * |
|
67 | - * @see Doku_Parser_Mode::getSort() |
|
68 | - */ |
|
69 | - public function getSort() { |
|
70 | - return 902; |
|
71 | - } |
|
64 | + /** |
|
65 | + * (non-PHPdoc) |
|
66 | + * |
|
67 | + * @see Doku_Parser_Mode::getSort() |
|
68 | + */ |
|
69 | + public function getSort() { |
|
70 | + return 902; |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * Connect to our special pattern. |
|
75 | - * |
|
76 | - * @see Doku_Parser_Mode::connectTo() |
|
77 | - */ |
|
78 | - public function connectTo($mode) { |
|
79 | - $this->Lexer->addSpecialPattern ( '<olmap_searchlayer ?[^>\n]*>.*?</olmap_searchlayer>', |
|
80 | - $mode, 'plugin_openlayersmapoverlays_searchlayer' ); |
|
81 | - } |
|
73 | + /** |
|
74 | + * Connect to our special pattern. |
|
75 | + * |
|
76 | + * @see Doku_Parser_Mode::connectTo() |
|
77 | + */ |
|
78 | + public function connectTo($mode) { |
|
79 | + $this->Lexer->addSpecialPattern ( '<olmap_searchlayer ?[^>\n]*>.*?</olmap_searchlayer>', |
|
80 | + $mode, 'plugin_openlayersmapoverlays_searchlayer' ); |
|
81 | + } |
|
82 | 82 | |
83 | - /** |
|
84 | - * (non-PHPdoc) |
|
85 | - * |
|
86 | - * @see DokuWiki_Syntax_Plugin::handle() |
|
87 | - */ |
|
88 | - public function handle($match, $state, $pos, Doku_Handler $handler) { |
|
89 | - $param = array (); |
|
90 | - $data = $this->dflt; |
|
83 | + /** |
|
84 | + * (non-PHPdoc) |
|
85 | + * |
|
86 | + * @see DokuWiki_Syntax_Plugin::handle() |
|
87 | + */ |
|
88 | + public function handle($match, $state, $pos, Doku_Handler $handler) { |
|
89 | + $param = array (); |
|
90 | + $data = $this->dflt; |
|
91 | 91 | |
92 | - preg_match_all ( '/(\w*)="(.*?)"/us', $match, $param, PREG_SET_ORDER ); |
|
92 | + preg_match_all ( '/(\w*)="(.*?)"/us', $match, $param, PREG_SET_ORDER ); |
|
93 | 93 | |
94 | - foreach ( $param as $kvpair ) { |
|
95 | - list ( $matched, $key, $val ) = $kvpair; |
|
96 | - if (isset ( $data [$key] )) { |
|
97 | - $key = strtolower ( $key ); |
|
98 | - $data [$key] = $val; |
|
99 | - } |
|
100 | - } |
|
101 | - dbglog($data,'syntax_plugin_overlayer::handle: parsed data is:'); |
|
102 | - return $data; |
|
103 | - } |
|
94 | + foreach ( $param as $kvpair ) { |
|
95 | + list ( $matched, $key, $val ) = $kvpair; |
|
96 | + if (isset ( $data [$key] )) { |
|
97 | + $key = strtolower ( $key ); |
|
98 | + $data [$key] = $val; |
|
99 | + } |
|
100 | + } |
|
101 | + dbglog($data,'syntax_plugin_overlayer::handle: parsed data is:'); |
|
102 | + return $data; |
|
103 | + } |
|
104 | 104 | |
105 | - /** |
|
106 | - * (non-PHPdoc) |
|
107 | - * |
|
108 | - * @see DokuWiki_Syntax_Plugin::render() |
|
109 | - */ |
|
110 | - public function render($mode, Doku_Renderer $renderer, $data) { |
|
111 | - if ($mode != 'xhtml') |
|
112 | - return false; |
|
105 | + /** |
|
106 | + * (non-PHPdoc) |
|
107 | + * |
|
108 | + * @see DokuWiki_Syntax_Plugin::render() |
|
109 | + */ |
|
110 | + public function render($mode, Doku_Renderer $renderer, $data) { |
|
111 | + if ($mode != 'xhtml') |
|
112 | + return false; |
|
113 | 113 | |
114 | - static $loadedOLlib = false; |
|
115 | - if (! $loadedOLlib) { |
|
116 | - $renderer->doc .= DOKU_LF . '<script type="text/javascript" src="' . DOKU_BASE . 'lib/plugins/openlayersmapoverlays/lib/layers.js' . '"></script>'; |
|
117 | - $loadedOLlib = true; |
|
118 | - } |
|
119 | - // incremented for each olmap_wmslayer tag in the page source |
|
120 | - static $overlaynumber = 0; |
|
114 | + static $loadedOLlib = false; |
|
115 | + if (! $loadedOLlib) { |
|
116 | + $renderer->doc .= DOKU_LF . '<script type="text/javascript" src="' . DOKU_BASE . 'lib/plugins/openlayersmapoverlays/lib/layers.js' . '"></script>'; |
|
117 | + $loadedOLlib = true; |
|
118 | + } |
|
119 | + // incremented for each olmap_wmslayer tag in the page source |
|
120 | + static $overlaynumber = 0; |
|
121 | 121 | |
122 | - list ( $id, $url, $name, $visible ) = $data; |
|
123 | - $renderer->doc .= DOKU_LF . "<script type='text/javascript'><!--//--><![CDATA[//><!--" . DOKU_LF; |
|
124 | - $str = '{'; |
|
125 | - foreach ( $data as $key => $val ) { |
|
126 | - $str .= "'" . $key . "' : '" . $val . "',"; |
|
127 | - } |
|
128 | - $str .= "'type':'wms'}"; |
|
129 | - $renderer->doc .= "olMapOverlays['wms" . $overlaynumber . "'] = " . $str . ";" . DOKU_LF . "//--><!]]></script>"; |
|
130 | - $overlaynumber ++; |
|
131 | - return true; |
|
132 | - } |
|
122 | + list ( $id, $url, $name, $visible ) = $data; |
|
123 | + $renderer->doc .= DOKU_LF . "<script type='text/javascript'><!--//--><![CDATA[//><!--" . DOKU_LF; |
|
124 | + $str = '{'; |
|
125 | + foreach ( $data as $key => $val ) { |
|
126 | + $str .= "'" . $key . "' : '" . $val . "',"; |
|
127 | + } |
|
128 | + $str .= "'type':'wms'}"; |
|
129 | + $renderer->doc .= "olMapOverlays['wms" . $overlaynumber . "'] = " . $str . ";" . DOKU_LF . "//--><!]]></script>"; |
|
130 | + $overlaynumber ++; |
|
131 | + return true; |
|
132 | + } |
|
133 | 133 | } |