Index: trunk/extensions/SemanticMaps/YahooMaps/SM_YahooMapsQP.php |
— | — | @@ -73,8 +73,8 @@ |
74 | 74 | function() { |
75 | 75 | initializeYahooMap( |
76 | 76 | '$this->mapName', |
77 | | - $this->centre_lat, |
78 | | - $this->centre_lon, |
| 77 | + $this->centreLat, |
| 78 | + $this->centreLon, |
79 | 79 | $this->zoom, |
80 | 80 | $this->type, |
81 | 81 | [$this->types], |
Index: trunk/extensions/SemanticMaps/YahooMaps/SM_YahooMapsFormInput.php |
— | — | @@ -85,8 +85,8 @@ |
86 | 86 | makeFormInputYahooMap( |
87 | 87 | '$this->mapName', |
88 | 88 | '$this->coordsFieldName', |
89 | | - $this->centre_lat, |
90 | | - $this->centre_lon, |
| 89 | + $this->centreLat, |
| 90 | + $this->centreLon, |
91 | 91 | $this->zoom, |
92 | 92 | $this->type, |
93 | 93 | [$this->types], |
Index: trunk/extensions/SemanticMaps/OpenLayers/SM_OpenLayersQP.php |
— | — | @@ -75,8 +75,8 @@ |
76 | 76 | function() { |
77 | 77 | initOpenLayer( |
78 | 78 | '$this->mapName', |
79 | | - $this->centre_lat, |
80 | | - $this->centre_lon, |
| 79 | + $this->centreLat, |
| 80 | + $this->centreLon, |
81 | 81 | $this->zoom, |
82 | 82 | [$layerItems], |
83 | 83 | [$this->controls], |
Index: trunk/extensions/SemanticMaps/OpenLayers/SM_OpenLayersFormInput.php |
— | — | @@ -86,8 +86,8 @@ |
87 | 87 | makeFormInputOpenLayer( |
88 | 88 | '$this->mapName', |
89 | 89 | '$this->coordsFieldName', |
90 | | - $this->centre_lat, |
91 | | - $this->centre_lon, |
| 90 | + $this->centreLat, |
| 91 | + $this->centreLon, |
92 | 92 | $this->zoom, |
93 | 93 | $this->marker_lat, |
94 | 94 | $this->marker_lon, |
Index: trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoords.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | * |
45 | 45 | * @return true |
46 | 46 | */ |
47 | | - public static function getGeoProximitySQLCondition( &$whereSQL, SMGeoCoordsValueDescription $description, $tablename, $fieldname, Database $dbs ) { |
| 47 | + public static function getGeoProximitySQLCondition( &$whereSQL, SMGeoCoordsValueDescription $description, $tablename, $fieldname, DatabaseBase $dbs ) { |
48 | 48 | // If the MapsGeoFunctions class is not loaded, we can not create the bounding box, so don't add any conditions. |
49 | 49 | if ( !self::geoFunctionsAreAvailable() ) { |
50 | 50 | return true; |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | $south = $dbs->addQuotes( $boundingBox['south'] ); |
80 | 80 | $west = $dbs->addQuotes( $boundingBox['west'] ); |
81 | 81 | |
82 | | - $whereSQL .= "{$tablename}lat < $north && {$tablename}lat > $south && {$tablename}lon < $east && {$tablename}lon > $west"; |
| 82 | + $whereSQL .= "{$tablename}.lat < $north && {$tablename}.lat > $south && {$tablename}.lon < $east && {$tablename}.lon > $west"; |
83 | 83 | |
84 | 84 | return true; |
85 | 85 | } |
Index: trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValueDescription.php |
— | — | @@ -19,6 +19,8 @@ |
20 | 20 | * @author Jeroen De Dauw |
21 | 21 | * |
22 | 22 | * @ingroup SemanticMaps |
| 23 | + * |
| 24 | + * TODO: storing the distance here does not seem quite right |
23 | 25 | */ |
24 | 26 | class SMGeoCoordsValueDescription extends SMWValueDescription { |
25 | 27 | protected $m_distance; |
Index: trunk/extensions/SemanticMaps/FormInputs/SM_FormInput.php |
— | — | @@ -184,20 +184,20 @@ |
185 | 185 | private function setCentre() { |
186 | 186 | if ( empty( $this->centre ) ) { |
187 | 187 | if ( isset( $this->coordinates ) ) { |
188 | | - $this->centre_lat = $this->marker_lat; |
189 | | - $this->centre_lon = $this->marker_lon; |
| 188 | + $this->centreLat = $this->marker_lat; |
| 189 | + $this->centreLon = $this->marker_lon; |
190 | 190 | } |
191 | 191 | else { |
192 | | - $this->centre_lat = '0'; |
193 | | - $this->centre_lon = '0'; |
| 192 | + $this->centreLat = '0'; |
| 193 | + $this->centreLon = '0'; |
194 | 194 | } |
195 | 195 | } |
196 | 196 | else { |
197 | 197 | // Geocode and convert if required. |
198 | 198 | $centre = MapsGeocoder::attemptToGeocode( $this->centre, $this->geoservice, $this->serviceName ); |
199 | 199 | |
200 | | - $this->centre_lat = Xml::escapeJsString( $centre['lat'] ); |
201 | | - $this->centre_lon = Xml::escapeJsString( $centre['lon'] ); |
| 200 | + $this->centreLat = Xml::escapeJsString( $centre['lat'] ); |
| 201 | + $this->centreLon = Xml::escapeJsString( $centre['lon'] ); |
202 | 202 | } |
203 | 203 | } |
204 | 204 | |
Index: trunk/extensions/SemanticMaps/OpenStreetMap/SM_OSMQP.php |
— | — | @@ -64,8 +64,8 @@ |
65 | 65 | mode: 'osm-wm', |
66 | 66 | layer: 'osm-like', |
67 | 67 | locale: '$this->lang', |
68 | | - lat: $this->centre_lat, |
69 | | - lon: $this->centre_lon, |
| 68 | + lat: $this->centreLat, |
| 69 | + lon: $this->centreLon, |
70 | 70 | zoom: $this->zoom, |
71 | 71 | width: $this->width, |
72 | 72 | height: $this->height, |
Index: trunk/extensions/SemanticMaps/OpenStreetMap/SM_OSMFormInput.php |
— | — | @@ -80,8 +80,8 @@ |
81 | 81 | mode: 'osm-wm', |
82 | 82 | layer: 'osm-like', |
83 | 83 | locale: '$this->lang', |
84 | | - lat: $this->centre_lat, |
85 | | - lon: $this->centre_lon, |
| 84 | + lat: $this->centreLat, |
| 85 | + lon: $this->centreLon, |
86 | 86 | zoom: $this->zoom, |
87 | 87 | width: $this->width, |
88 | 88 | height: $this->height, |
Index: trunk/extensions/SemanticMaps/SemanticMaps.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | |
37 | 37 | // Only initialize the extension when all dependencies are present. |
38 | 38 | if ( defined( 'Maps_VERSION' ) && defined( 'SMW_VERSION' ) ) { |
39 | | - define( 'SM_VERSION', '0.6 a12' ); |
| 39 | + define( 'SM_VERSION', '0.6 a13' ); |
40 | 40 | |
41 | 41 | $smgScriptPath = ( isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/SemanticMaps'; |
42 | 42 | $smgDir = dirname( __FILE__ ) . '/'; |
Index: trunk/extensions/SemanticMaps/QueryPrinters/SM_MapPrinter.php |
— | — | @@ -29,6 +29,8 @@ |
30 | 30 | * ideally should be inherited. Since SMWResultPrinter already gets inherited, |
31 | 31 | * this is not possible. Finding a better solution to this code redundancy |
32 | 32 | * would be nice, cause now changes to MapsMapFeature need to be copied here. |
| 33 | + * |
| 34 | + * The adaptor pattern could be used to prevent this. |
33 | 35 | */ |
34 | 36 | abstract class SMMapPrinter extends SMWResultPrinter { |
35 | 37 | |
— | — | @@ -57,8 +59,8 @@ |
58 | 60 | |
59 | 61 | protected $mapName; |
60 | 62 | |
61 | | - protected $centre_lat; |
62 | | - protected $centre_lon; |
| 63 | + protected $centreLat; |
| 64 | + protected $centreLon; |
63 | 65 | |
64 | 66 | protected $output = ''; |
65 | 67 | protected $errorList; |
— | — | @@ -313,24 +315,24 @@ |
314 | 316 | // Geocode and convert if required. |
315 | 317 | $centre = MapsGeocoder::attemptToGeocode( $this->centre, $this->geoservice, $this->serviceName ); |
316 | 318 | |
317 | | - $this->centre_lat = $centre['lat']; |
318 | | - $this->centre_lon = $centre['lon']; |
| 319 | + $this->centreLat = $centre['lat']; |
| 320 | + $this->centreLon = $centre['lon']; |
319 | 321 | } |
320 | 322 | elseif ( count( $this->m_locations ) > 1 ) { |
321 | 323 | // If centre is not set, and there are multiple points, set the values to null, to be auto determined by the JS of the mapping API. |
322 | | - $this->centre_lat = 'null'; |
323 | | - $this->centre_lon = 'null'; |
| 324 | + $this->centreLat = 'null'; |
| 325 | + $this->centreLon = 'null'; |
324 | 326 | } |
325 | 327 | elseif ( count( $this->m_locations ) == 1 ) { |
326 | 328 | // If centre is not set and there is exactelly one marker, use it's coordinates. |
327 | | - $this->centre_lat = Xml::escapeJsString( $this->m_locations[0][0] ); |
328 | | - $this->centre_lon = Xml::escapeJsString( $this->m_locations[0][1] ); |
| 329 | + $this->centreLat = Xml::escapeJsString( $this->m_locations[0][0] ); |
| 330 | + $this->centreLon = Xml::escapeJsString( $this->m_locations[0][1] ); |
329 | 331 | } |
330 | 332 | else { |
331 | 333 | // If centre is not set and there are no results, centre on the default coordinates. |
332 | 334 | global $egMapsMapLat, $egMapsMapLon; |
333 | | - $this->centre_lat = $egMapsMapLat; |
334 | | - $this->centre_lon = $egMapsMapLon; |
| 335 | + $this->centreLat = $egMapsMapLat; |
| 336 | + $this->centreLon = $egMapsMapLon; |
335 | 337 | } |
336 | 338 | } |
337 | 339 | |
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMapsQP.php |
— | — | @@ -92,8 +92,8 @@ |
93 | 93 | function() { |
94 | 94 | initializeGoogleMap('$this->mapName', |
95 | 95 | { |
96 | | - lat: $this->centre_lat, |
97 | | - lon: $this->centre_lon, |
| 96 | + lat: $this->centreLat, |
| 97 | + lon: $this->centreLon, |
98 | 98 | zoom: $this->zoom, |
99 | 99 | type: $this->type, |
100 | 100 | types: [$this->types], |
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMapsFormInput.php |
— | — | @@ -94,8 +94,8 @@ |
95 | 95 | '$this->mapName', |
96 | 96 | '$this->coordsFieldName', |
97 | 97 | { |
98 | | - lat: $this->centre_lat, |
99 | | - lon: $this->centre_lon, |
| 98 | + lat: $this->centreLat, |
| 99 | + lon: $this->centreLon, |
100 | 100 | zoom: $this->zoom, |
101 | 101 | type: $this->type, |
102 | 102 | types: [$this->types], |