Index: trunk/extensions/Maps/includes/Maps_LayerPage.php |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | 'th', |
49 | 49 | array(), |
50 | 50 | wfMsg( 'maps-layer-value' ) |
51 | | - ) |
| 51 | + ) |
52 | 52 | ); |
53 | 53 | |
54 | 54 | foreach ( $this->getProperties() as $property => $value ) { |
Index: trunk/extensions/Maps/includes/Maps_Layer.php |
— | — | @@ -138,7 +138,7 @@ |
139 | 139 | public function getJavaScriptDefinition() { |
140 | 140 | // Note: this is currently hardcoded for layers of type image. |
141 | 141 | $label = Xml::encodeJsVar( $this->properties['label'] ); |
142 | | - $source = Xml::encodeJsVar( $this->properties['source'] ); |
| 142 | + $source = Xml::encodeJsVar( MapsMapper::getImageUrl( $this->properties['source'] ) ); |
143 | 143 | $lowerBound = Xml::encodeJsVar( (int)$this->properties['lowerbound'] ); |
144 | 144 | $upperBound = Xml::encodeJsVar( (int)$this->properties['upperbound'] ); |
145 | 145 | $leftBound = Xml::encodeJsVar( (int)$this->properties['leftbound'] ); |
Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_ParamOLLayers.php |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | |
97 | 97 | foreach ( $layerNames as $layerName ) { |
98 | 98 | if ( array_key_exists( $layerName, $egMapsOLLayerDependencies ) ) { |
99 | | - |
| 99 | + $layerDependencies[] = $egMapsOLLayerDependencies[$layerName]; |
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
Index: trunk/extensions/Maps/includes/Maps_Mapper.php |
— | — | @@ -198,4 +198,24 @@ |
199 | 199 | return $params; |
200 | 200 | } |
201 | 201 | |
| 202 | + /** |
| 203 | + * Resolves the url of images provided as wiki page; leaves others alone. |
| 204 | + * |
| 205 | + * @since 0.7.1 |
| 206 | + * |
| 207 | + * @param string $image |
| 208 | + * |
| 209 | + * @return string |
| 210 | + */ |
| 211 | + public static function getImageUrl( $image ) { |
| 212 | + $title = Title::newFromText( $image, NS_FILE ); |
| 213 | + |
| 214 | + if ( $title->getNamespace() == NS_FILE && $title->exists() ) { |
| 215 | + $imagePage = new ImagePage( $title ); |
| 216 | + $image = $imagePage->getDisplayedFile()->getURL(); |
| 217 | + } |
| 218 | + |
| 219 | + return $image; |
| 220 | + } |
| 221 | + |
202 | 222 | } |
\ No newline at end of file |