diff options
Diffstat (limited to 'www/wiki/extensions/Maps/src/MediaWiki/ParserHooks/DisplayMapRenderer.php')
-rw-r--r-- | www/wiki/extensions/Maps/src/MediaWiki/ParserHooks/DisplayMapRenderer.php | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/www/wiki/extensions/Maps/src/MediaWiki/ParserHooks/DisplayMapRenderer.php b/www/wiki/extensions/Maps/src/MediaWiki/ParserHooks/DisplayMapRenderer.php index 25a80683..8c757acd 100644 --- a/www/wiki/extensions/Maps/src/MediaWiki/ParserHooks/DisplayMapRenderer.php +++ b/www/wiki/extensions/Maps/src/MediaWiki/ParserHooks/DisplayMapRenderer.php @@ -8,6 +8,7 @@ use Maps\DataAccess\MediaWikiFileUrlFinder; use Maps\Elements\Location; use Maps\MappingService; use Maps\Presentation\ElementJsonSerializer; +use Maps\Presentation\MapHtmlBuilder; use Maps\Presentation\WikitextParser; use Maps\Presentation\WikitextParsers\LocationParser; use Parser; @@ -66,9 +67,10 @@ class DisplayMapRenderer { $this->handleMarkerData( $params ); - $output = $this->getMapHTML( + $output = ( new MapHtmlBuilder() )->getMapHTML( $params, - $this->service->newMapId() + $this->service->newMapId(), + $this->service->getName() ); $dependencies = $this->service->getDependencyHtml( $params ); @@ -177,29 +179,4 @@ class DisplayMapRenderer { } } - /** - * Returns the HTML to display the map. - * - * @param array $params - * @param string $mapName - * - * @return string - */ - protected function getMapHTML( array $params, $mapName ) { - return Html::rawElement( - 'div', - [ - 'id' => $mapName, - 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;", - 'class' => 'maps-map maps-' . $this->service->getName() - ], - wfMessage( 'maps-loading-map' )->inContentLanguage()->escaped() . - Html::element( - 'div', - [ 'style' => 'display:none', 'class' => 'mapdata' ], - FormatJson::encode( $params ) - ) - ); - } - } |