Index: branches/Maps0.8/Maps_Settings.php |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | # Commenting or removing a mapping service will make Maps completely ignore it, and so improve performance. |
85 | 85 | |
86 | 86 | # Google Maps API v2 |
87 | | - include_once $egMapsDir . 'includes/services/GoogleMaps/GoogleMaps.php'; |
| 87 | + // include_once $egMapsDir . 'includes/services/GoogleMaps/GoogleMaps.php'; |
88 | 88 | |
89 | 89 | # Google Maps API v3 |
90 | 90 | include_once $egMapsDir . 'includes/services/GoogleMaps3/GoogleMaps3.php'; |
— | — | @@ -92,16 +92,16 @@ |
93 | 93 | include_once $egMapsDir . 'includes/services/OpenLayers/OpenLayers.php'; |
94 | 94 | |
95 | 95 | # Yahoo! Maps API |
96 | | - include_once $egMapsDir . 'includes/services/YahooMaps/YahooMaps.php'; |
| 96 | + // include_once $egMapsDir . 'includes/services/YahooMaps/YahooMaps.php'; |
97 | 97 | |
98 | | - # Yahoo! Maps API |
| 98 | + # WMF OSM |
99 | 99 | include_once $egMapsDir . 'includes/services/OSM/OSM.php'; |
100 | 100 | |
101 | 101 | # Array of String. Array containing all the mapping services that will be made available to the user. |
102 | 102 | $egMapsAvailableServices = array( |
103 | | - 'googlemaps2', |
| 103 | + //'googlemaps2', |
104 | 104 | 'googlemaps3', |
105 | | - 'yahoomaps', |
| 105 | + //'yahoomaps', |
106 | 106 | 'openlayers', |
107 | 107 | 'osm' |
108 | 108 | ); |
Index: branches/Maps0.8/RELEASE-NOTES |
— | — | @@ -10,6 +10,8 @@ |
11 | 11 | === Maps 0.8 === |
12 | 12 | (2011-0x-xx) |
13 | 13 | |
| 14 | +This version branched from Maps 0.7.x at version 0.7.3. |
| 15 | + |
14 | 16 | * Removed compatibility with pre MediaWiki 1.17, in order to make full use of the new features. |
15 | 17 | |
16 | 18 | * Added support for the auto-documentation features for parser hooks introduced in Validator 0.4.3. |
Index: branches/Maps0.8/includes/services/GoogleMaps3/jquery.googlemap.js |
— | — | @@ -28,7 +28,10 @@ |
29 | 29 | |
30 | 30 | var map = new google.maps.Map( this.get( 0 ), mapOptions ); |
31 | 31 | |
32 | | - var markers = []; |
| 32 | + var markers = []; |
| 33 | + if ( !options.locations ) { |
| 34 | + options.locations = []; |
| 35 | + } |
33 | 36 | |
34 | 37 | // Add the markers. |
35 | 38 | for ( var i = options.locations.length - 1; i >= 0; i-- ) { |
— | — | @@ -61,7 +64,7 @@ |
62 | 65 | |
63 | 66 | var bounds; |
64 | 67 | |
65 | | - if ( options.centre === false || options.zoom === false ) { |
| 68 | + if ( ( options.centre === false || options.zoom === false ) && options.locations.lentgh > 1 ) { |
66 | 69 | bounds = new google.maps.LatLngBounds(); |
67 | 70 | |
68 | 71 | for ( var i = markers.length - 1; i >= 0; i-- ) { |
— | — | @@ -71,11 +74,29 @@ |
72 | 75 | map.fitBounds( bounds ); |
73 | 76 | } |
74 | 77 | |
75 | | - map.setCenter( |
76 | | - options.centre === false ? |
77 | | - bounds.getCenter() : new google.maps.LatLng( options.centre.lat , options.centre.lon ) |
78 | | - ); |
| 78 | + if ( options.zoom !== false ) { |
| 79 | + map.setZoom( options.zoom ); |
| 80 | + } |
79 | 81 | |
| 82 | + var centre; |
| 83 | + |
| 84 | + if ( options.centre === false ) { |
| 85 | + if ( options.locations.length > 1 ) { |
| 86 | + centre = bounds.getCenter(); |
| 87 | + } |
| 88 | + else if ( options.locations.length == 1 ) { |
| 89 | + centre = new google.maps.LatLng( options.locations[0].lat, options.locations[0].lon ); |
| 90 | + } |
| 91 | + else { |
| 92 | + centre = new google.maps.LatLng( 0, 0 ); |
| 93 | + } |
| 94 | + } |
| 95 | + else { |
| 96 | + centre = options.centre; |
| 97 | + } |
| 98 | + |
| 99 | + map.setCenter( centre ); |
| 100 | + |
80 | 101 | if ( options.autoinfowindows ) { |
81 | 102 | for ( var i = markers.length - 1; i >= 0; i-- ) { |
82 | 103 | markers[i].openWindow = new google.maps.InfoWindow( { content: markers[i].text } ); |
Index: branches/Maps0.8/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | /** |
15 | 15 | * @see MapsBasePointMap::getMapHTML() |
16 | 16 | */ |
17 | | - public function addSpecificMapHTML( array $params, Parser $parser, $mapName ) { |
| 17 | + public function getMapHTML( array $params, Parser $parser, $mapName ) { |
18 | 18 | return Html::element( |
19 | 19 | 'div', |
20 | 20 | array( |
Index: branches/Maps0.8/includes/parserHooks/Maps_DisplayMap.php |
— | — | @@ -68,9 +68,12 @@ |
69 | 69 | $params['coordinates'] = new Parameter( 'coordinates' ); |
70 | 70 | $params['coordinates']->addAliases( 'coords', 'location', 'address' ); |
71 | 71 | $params['coordinates']->addCriteria( new CriterionIsLocation() ); |
72 | | - $params['coordinates']->addManipulations( new MapsParamLocation() ); |
73 | 72 | $params['coordinates']->addDependencies( 'mappingservice', 'geoservice' ); |
74 | 73 | $params['coordinates']->setDescription( wfMsg( 'maps-displaymap-par-coordinates' ) ); |
| 74 | + $params['coordinates']->setDoManipulationOfDefault( false ); |
| 75 | + $manipulation = new MapsParamLocation(); |
| 76 | + $manipulation->toJSONObj = true; |
| 77 | + $params['coordinates']->addManipulations( $manipulation ); |
75 | 78 | |
76 | 79 | return $params; |
77 | 80 | } |
Index: branches/Maps0.8/includes/Maps_MappingServices.php |
— | — | @@ -236,4 +236,4 @@ |
237 | 237 | return $objects; |
238 | 238 | } |
239 | 239 | |
240 | | -} |
\ No newline at end of file |
| 240 | +} |
Index: branches/Maps0.8/includes/features/Maps_BasePointMap.php |
— | — | @@ -145,7 +145,7 @@ |
146 | 146 | if ( $location->isValid() ) { |
147 | 147 | $jsonObj = $location->getJSONObject( $params['title'], $params['label'], $iconUrl ); |
148 | 148 | |
149 | | - $jsonObj['title'] = $parser->parse( $jsonObj['title'], $wgTitle, new ParserOptions() )->getText(); |
| 149 | + $jsonObj['title'] = strip_tags( $parser->parse( $jsonObj['title'], $wgTitle, new ParserOptions() )->getText() ); |
150 | 150 | $jsonObj['text'] = $parser->parse( $jsonObj['text'], $wgTitle, new ParserOptions() )->getText(); |
151 | 151 | |
152 | 152 | $params['locations'][] = $jsonObj; |
Index: branches/Maps0.8/includes/features/Maps_BaseMap.php |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | public final function renderMap( array $params, Parser $parser ) { |
72 | 72 | $this->setCentre( $params ); |
73 | 73 | |
74 | | - if ( $params['zoom'] == 'null' ) { |
| 74 | + if ( $params['zoom'] === false ) { |
75 | 75 | $params['zoom'] = $this->service->getDefaultZoom(); |
76 | 76 | } |
77 | 77 | |
— | — | @@ -150,7 +150,7 @@ |
151 | 151 | } |
152 | 152 | } |
153 | 153 | else { |
154 | | - $params['centre'] = MapsCoordinateParser::parseCoordinates( $params['coordinates'] ); |
| 154 | + $params['centre'] = $params['coordinates']; |
155 | 155 | } |
156 | 156 | |
157 | 157 | unset( $params['coordinates'] ); |