/** * Responsible for actual output on the layer page which gives an overview of the layer definition. * * @since 3.0 * * @param MapsLayer * * @return string */ public function renderLayerInfo(MapsLayer $layer) { global $wgLang; // appropriate layer header: if ($layer->getName() !== null) { // if layer with same name is defined on same page already: if ($this->getLayerStore()->getLayerByName($layer->getName()) !== null) { return $this->errorbox(wfMessage('maps-layerdef-equal-layer-name', $layer->getName())->inContentLanguage()->text()); } $outHeader = wfMessage('maps-layer-of-type-and-name', $layer->getType(), $layer->getName())->inContentLanguage()->text(); } else { $outHeader = wfMessage('maps-layer-of-type', $layer->getType())->inContentLanguage()->text(); } $outHeader = "<span class=\"mapslayerhead\">{$outHeader}</span>"; // info message about which services are supporting the layer(-type): $supportedServices = MapsLayerTypes::getServicesForType($layer->getType()); $outServices = '<span class="mapslayersupports">' . wfMessage('maps-layer-type-supported-by', $wgLang->listToText($supportedServices), count($supportedServices))->inContentLanguage()->escaped() . '</span>'; $outTable = $this->getLayerDefinitionTable($layer); return Html::rawElement('div', array('class' => 'mapslayer' . ($layer->isOk() ? '' : ' mapslayererror')), $outHeader . $outServices . $outTable); }
/** * Convenient function for getting mapping services supported by this layer. * * @since 3.0 * * @return string[] */ public final function getSupportedServices() { return MapsLayerTypes::getServicesForType($this->getType()); }