Index: branches/SemanticMaps0.8/includes/services/YahooMaps/SM_YahooMapsQP.php |
— | — | @@ -21,31 +21,14 @@ |
22 | 22 | * @see SMMapPrinter::addSpecificMapHTML |
23 | 23 | */ |
24 | 24 | public function addSpecificMapHTML() { |
25 | | - $mapName = $this->service->getMapId(); |
26 | | - |
27 | | - $this->output .= Html::element( |
| 25 | + return Html::element( |
28 | 26 | 'div', |
29 | 27 | array( |
30 | | - 'id' => $mapName, |
| 28 | + 'id' => $this->service->getMapId(), |
31 | 29 | 'style' => "width: $this->width; height: $this->height; background-color: #cccccc; overflow: hidden;", |
32 | 30 | ), |
33 | 31 | wfMsg( 'maps-loading-map' ) |
34 | 32 | ); |
35 | | - |
36 | | - MapsMapper::addInlineScript( $this->service, <<<EOT |
37 | | - initializeYahooMap( |
38 | | - "$mapName", |
39 | | - $this->centreLat, |
40 | | - $this->centreLon, |
41 | | - $this->zoom, |
42 | | - $this->type, |
43 | | - [$this->types], |
44 | | - [$this->controls], |
45 | | - $this->autozoom, |
46 | | - $this->markerJs |
47 | | - ); |
48 | | -EOT |
49 | | - ); |
50 | 33 | } |
51 | 34 | |
52 | 35 | /** |
Index: branches/SemanticMaps0.8/includes/services/YahooMaps/SM_YahooMapsFormInput.php |
— | — | @@ -56,33 +56,14 @@ |
57 | 57 | * @see MapsMapFeature::addSpecificMapHTML |
58 | 58 | */ |
59 | 59 | public function addSpecificMapHTML() { |
60 | | - $mapName = $this->service->getMapId( false ); |
61 | | - |
62 | | - $this->output .= Html::element( |
| 60 | + return Html::element( |
63 | 61 | 'div', |
64 | 62 | array( |
65 | | - 'id' => $mapName, |
| 63 | + 'id' => $this->service->getMapId( false ), |
66 | 64 | 'style' => "width: $this->width; height: $this->height; background-color: #cccccc; overflow: hidden;", |
67 | 65 | ), |
68 | 66 | wfMsg( 'maps-loading-map' ) |
69 | 67 | ); |
70 | | - |
71 | | - MapsMapper::addInlineScript( $this->service, <<<EOT |
72 | | - makeFormInputYahooMap( |
73 | | - "$mapName", |
74 | | - "$this->coordsFieldName", |
75 | | - $this->centreLat, |
76 | | - $this->centreLon, |
77 | | - $this->zoom, |
78 | | - $this->type, |
79 | | - [$this->types], |
80 | | - [$this->controls], |
81 | | - $this->autozoom, |
82 | | - {$this->markerCoords['lat']}, |
83 | | - {$this->markerCoords['lon']} |
84 | | - ); |
85 | | -EOT |
86 | | - ); |
87 | 68 | |
88 | 69 | } |
89 | 70 | |
Index: branches/SemanticMaps0.8/includes/services/OpenLayers/SM_OpenLayersQP.php |
— | — | @@ -21,34 +21,14 @@ |
22 | 22 | * @see SMMapPrinter::addSpecificMapHTML |
23 | 23 | */ |
24 | 24 | public function addSpecificMapHTML() { |
25 | | - global $wgLang; |
26 | | - |
27 | | - $mapName = $this->service->getMapId(); |
28 | | - |
29 | | - $this->output .= Html::element( |
| 25 | + return Html::element( |
30 | 26 | 'div', |
31 | 27 | array( |
32 | | - 'id' => $mapName, |
| 28 | + 'id' => $this->service->getMapId(), |
33 | 29 | 'style' => "width: $this->width; height: $this->height; background-color: #cccccc; overflow: hidden;", |
34 | 30 | ), |
35 | 31 | wfMsg( 'maps-loading-map' ) |
36 | 32 | ); |
37 | | - |
38 | | - $langCode = $wgLang->getCode(); |
39 | | - |
40 | | - MapsMapper::addInlineScript( $this->service, <<<EOT |
41 | | - initOpenLayer( |
42 | | - "$mapName", |
43 | | - $this->centreLat, |
44 | | - $this->centreLon, |
45 | | - $this->zoom, |
46 | | - {$this->layers}, |
47 | | - [$this->controls], |
48 | | - $this->markerJs, |
49 | | - "$langCode" |
50 | | - ); |
51 | | -EOT |
52 | | - ); |
53 | 33 | } |
54 | 34 | |
55 | 35 | /** |
Index: branches/SemanticMaps0.8/includes/services/OpenLayers/SM_OpenLayersFormInput.php |
— | — | @@ -34,37 +34,14 @@ |
35 | 35 | * @see MapsMapFeature::addSpecificMapHTML |
36 | 36 | */ |
37 | 37 | public function addSpecificMapHTML() { |
38 | | - global $wgLang; |
39 | | - |
40 | | - $mapName = $this->service->getMapId( false ); |
41 | | - |
42 | | - $this->output .= Html::element( |
| 38 | + return Html::element( |
43 | 39 | 'div', |
44 | 40 | array( |
45 | | - 'id' => $mapName, |
| 41 | + 'id' => $this->service->getMapId( false ), |
46 | 42 | 'style' => "width: $this->width; height: $this->height; background-color: #cccccc; overflow: hidden;", |
47 | 43 | ), |
48 | 44 | wfMsg( 'maps-loading-map' ) |
49 | 45 | ); |
50 | | - |
51 | | - $langCode = $wgLang->getCode(); |
52 | | - |
53 | | - MapsMapper::addInlineScript( $this->service,<<<EOT |
54 | | - makeFormInputOpenLayer( |
55 | | - "$mapName", |
56 | | - "$this->coordsFieldName", |
57 | | - $this->centreLat, |
58 | | - $this->centreLon, |
59 | | - $this->zoom, |
60 | | - {$this->markerCoords['lat']}, |
61 | | - {$this->markerCoords['lon']}, |
62 | | - {$this->layers}, |
63 | | - [$this->controls], |
64 | | - "$langCode" |
65 | | - ); |
66 | | -EOT |
67 | | - ); |
68 | | - |
69 | 46 | } |
70 | 47 | |
71 | | -} |
\ No newline at end of file |
| 48 | +} |
Index: branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMapsQP.php |
— | — | @@ -25,14 +25,13 @@ |
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
29 | | - * @see SMMapPrinter::addSpecificMapHTML |
| 29 | + * @see SMMapPrinter::getMapHTML |
30 | 30 | */ |
31 | | - public function addSpecificMapHTML() { |
| 31 | + public function getMapHTML() { |
32 | 32 | $mapName = $this->service->getMapId(); |
| 33 | + $output = $this->service->getOverlayOutput( $mapName, $this->overlays, $this->controls ); |
33 | 34 | |
34 | | - $this->service->addOverlayOutput( $this->output, $mapName, $this->overlays, $this->controls ); |
35 | | - |
36 | | - $this->output .= Html::element( |
| 35 | + return $output . Html::element( |
37 | 36 | 'div', |
38 | 37 | array( |
39 | 38 | 'id' => $mapName, |
— | — | @@ -40,23 +39,6 @@ |
41 | 40 | ), |
42 | 41 | wfMsg( 'maps-loading-map' ) |
43 | 42 | ); |
44 | | - |
45 | | - MapsMapper::addInlineScript( $this->service, <<<EOT |
46 | | - initializeGoogleMap("$mapName", |
47 | | - { |
48 | | - lat: $this->centreLat, |
49 | | - lon: $this->centreLon, |
50 | | - zoom: $this->zoom, |
51 | | - type: $this->type, |
52 | | - types: [$this->types], |
53 | | - controls: [$this->controls], |
54 | | - scrollWheelZoom: $this->autozoom, |
55 | | - kml: [$this->kml] |
56 | | - }, |
57 | | - $this->markerJs |
58 | | - ); |
59 | | -EOT |
60 | | - ); |
61 | 43 | } |
62 | 44 | |
63 | 45 | /** |
Index: branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMapsFormInput.php |
— | — | @@ -43,45 +43,17 @@ |
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | | - * @see MapsMapFeature::addSpecificFormInputHTML |
| 47 | + * @see MapsMapFeature::getMapHTML |
48 | 48 | */ |
49 | | - public function addSpecificMapHTML() { |
50 | | - $mapName = $this->service->getMapId( false ); |
51 | | - |
52 | | - // Remove the overlays control in case it's present. |
53 | | - // TODO: make less insane |
54 | | - if ( in_string( 'overlays', $this->controls ) ) { |
55 | | - $this->controls = str_replace( array( ",'overlays'", "'overlays'," ), '', $this->controls ); |
56 | | - } |
57 | | - |
58 | | - $this->output .= Html::element( |
| 49 | + public function getMapHTML() { |
| 50 | + return Html::element( |
59 | 51 | 'div', |
60 | 52 | array( |
61 | | - 'id' => $mapName, |
| 53 | + 'id' => $this->service->getMapId( false ), |
62 | 54 | 'style' => "width: $this->width; height: $this->height; background-color: #cccccc; overflow: hidden;", |
63 | 55 | ), |
64 | 56 | wfMsg( 'maps-loading-map' ) |
65 | 57 | ); |
66 | | - |
67 | | - MapsMapper::addInlineScript( $this->service, <<<EOT |
68 | | - makeGoogleMapFormInput( |
69 | | - "$mapName", |
70 | | - "$this->coordsFieldName", |
71 | | - { |
72 | | - lat: $this->centreLat, |
73 | | - lon: $this->centreLon, |
74 | | - zoom: $this->zoom, |
75 | | - type: $this->type, |
76 | | - types: [$this->types], |
77 | | - controls: [$this->controls], |
78 | | - scrollWheelZoom: $this->autozoom, |
79 | | - kml: [$this->kml] |
80 | | - }, |
81 | | - {$this->markerCoords['lat']}, |
82 | | - {$this->markerCoords['lon']} |
83 | | - ); |
84 | | -EOT |
85 | | - ); |
86 | 58 | } |
87 | 59 | |
88 | 60 | } |
\ No newline at end of file |