00001 <?php
00002
00011 class SMOpenLayersQP extends SMMapPrinter {
00012
00016 protected function getServiceName() {
00017 return 'openlayers';
00018 }
00019
00023 public function addSpecificMapHTML() {
00024 global $wgLang;
00025
00026 $mapName = $this->service->getMapId();
00027
00028 $this->output .= Html::element(
00029 'div',
00030 array(
00031 'id' => $mapName,
00032 'style' => "width: $this->width; height: $this->height; background-color: #cccccc; overflow: hidden;",
00033 ),
00034 wfMsg( 'maps-loading-map' )
00035 );
00036
00037 $langCode = $wgLang->getCode();
00038
00039 MapsMapper::addInlineScript( $this->service, <<<EOT
00040 initOpenLayer(
00041 "$mapName",
00042 $this->centreLat,
00043 $this->centreLon,
00044 $this->zoom,
00045 {$this->layers},
00046 [$this->controls],
00047 $this->markerJs,
00048 "$langCode"
00049 );
00050 EOT
00051 );
00052 }
00053
00060 public function getParameters() {
00061 $params = parent::getParameters();
00062
00063 $params[] = array( 'name' => 'controls', 'type' => 'enum-list', 'description' => wfMsg( 'semanticmaps_paramdesc_controls' ), 'values' => MapsOpenLayers::getControlNames() );
00064 $params[] = array( 'name' => 'layers', 'type' => 'enum-list', 'description' => wfMsg( 'semanticmaps_paramdesc_layers' ), 'values' => MapsOpenLayers::getLayerNames() );
00065
00066 return $params;
00067 }
00068
00069 }