for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare( strict_types = 1 );
namespace Maps\LegacyMapEditor;
use Maps\GoogleMapsService;
use SpecialPage;
/**
* Special page with map editor interface using Google Maps.
*
* @since 2.0
* @licence GNU GPL v2+
* @author Kim Eik
* @author Jeroen De Dauw < [email protected] >
*/
class SpecialMapEditor extends SpecialPage {
* @see SpecialPage::__construct
public function __construct() {
parent::__construct( 'MapEditor' );
}
* @see SpecialPage::execute
* @param null|string $subPage
public function execute( $subPage ) {
$this->setHeaders();
$outputPage = $this->getOutput();
$outputPage->addHtml(
GoogleMapsService::getApiScript(
$this->getLanguage()->getCode(),
[ 'libraries' => 'drawing' ]
)
);
$outputPage->addModules( 'ext.maps.wikitext.editor' );
$editorHtml = new MapEditorHtml( $this->getAttribs() );
$html = $editorHtml->getEditorHtml();
$outputPage->addHTML( $html );
* @since 2.1
* @return array
protected function getAttribs() {
return [
'id' => 'map-canvas',
'context' => 'Maps\MediaWiki\Specials\SpecialMapEditor'
];