Index: trunk/extensions/UKGeocodingForMaps/INSTALL |
— | — | @@ -1,4 +1,4 @@ |
2 | | -You can get version 0.1 from SVN at |
| 2 | +You can get version 0.2 from SVN at |
3 | 3 | |
4 | 4 | http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/UKGeocodingForMaps/ |
5 | 5 | |
Index: trunk/extensions/UKGeocodingForMaps/UKGeocodingForMaps.i18n.php |
— | — | @@ -19,6 +19,8 @@ |
20 | 20 | // General |
21 | 21 | 'ukgeocoding_name' => 'UK Geocoding for Maps', |
22 | 22 | 'ukgeocoding_desc' => 'Extends Maps with a display_uk_point parser function with Google Maps implementation', |
| 23 | + |
| 24 | + 'ukgeocoding_couldNotGeocode' => 'One or more postalcodes could not be geocoded and have been omitted from the map.', |
23 | 25 | ); |
24 | 26 | |
25 | 27 | /** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца)) |
Index: trunk/extensions/UKGeocodingForMaps/UKGeocodingForMaps.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | die( 'Not an entry point.' ); |
23 | 23 | } |
24 | 24 | |
25 | | -define('UKG_VERSION', '0.1'); |
| 25 | +define('UKG_VERSION', '0.2 a1'); |
26 | 26 | |
27 | 27 | $ukggScriptPath = (isset($wgExtensionAssetsPath) && $wgExtensionAssetsPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions') . '/UKGeocodingForMaps'; |
28 | 28 | $ukggDir = dirname( __FILE__ ) . '/'; |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | 'path' => __FILE__, |
53 | 53 | 'name' => wfMsg( 'ukgeocoding_name' ), |
54 | 54 | 'version' => UKG_VERSION, |
55 | | - 'author' => array('[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw] for Neill Mitchell at Prescient Software Ltd'), |
| 55 | + 'author' => array( '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw] for Neill Mitchell at Prescient Software Ltd' ), |
56 | 56 | 'url' => 'http://www.mediawiki.org/wiki/Extension:UK_geocoding_for_Maps', |
57 | 57 | 'descriptionmsg' => 'ukgeocoding_desc', |
58 | 58 | ); |
Index: trunk/extensions/UKGeocodingForMaps/GoogleMaps/UKG_GoogleMapsDispUkPoint.php |
— | — | @@ -52,10 +52,10 @@ |
53 | 53 | protected function doMapServiceLoad() { |
54 | 54 | global $egGoogleMapsOnThisPage, $loadedAjaxApi, $egGoogleAjaxSearchKey; |
55 | 55 | |
56 | | - MapsGoogleMaps::addGMapDependencies($this->output); |
| 56 | + MapsGoogleMaps::addGMapDependencies( $this->output ); |
57 | 57 | $egGoogleMapsOnThisPage++; |
58 | 58 | |
59 | | - if (!$loadedAjaxApi) { |
| 59 | + if ( !$loadedAjaxApi ) { |
60 | 60 | $this->output .= "<script src='http://www.google.com/uds/api?file=uds.js&v=1.0&key=$egGoogleAjaxSearchKey' type='text/javascript'></script>"; |
61 | 61 | $loadedAjaxApi = true; |
62 | 62 | } |
— | — | @@ -70,10 +70,13 @@ |
71 | 71 | public function addSpecificMapHTML() { |
72 | 72 | global $wgJsMimeType; |
73 | 73 | |
74 | | - $onloadFunctions = MapsGoogleMaps::addOverlayOutput($this->output, $this->mapName, $this->overlays, $this->controls); |
| 74 | + $onloadFunctions = MapsGoogleMaps::addOverlayOutput( $this->output, $this->mapName, $this->overlays, $this->controls ); |
75 | 75 | |
| 76 | + $couldNotGeocodeMsg = Xml::escapeJsString( wfMsg( 'ukgeocoding_couldNotGeocode' ) ); |
| 77 | + |
76 | 78 | $this->output .=<<<EOT |
77 | 79 | <div id="$this->mapName"></div> |
| 80 | +<div id="{$this->mapName}_errors"></div> |
78 | 81 | <script type="$wgJsMimeType"> /*<![CDATA[*/ |
79 | 82 | addOnloadHook( function() { |
80 | 83 | var map = initializeGoogleMap('$this->mapName', |
— | — | @@ -91,13 +94,13 @@ |
92 | 95 | [] |
93 | 96 | ); |
94 | 97 | var localSearch = new GlocalSearch(); |
95 | | - function usePointFromPostcode(marker, callbackFunction) { |
96 | | - localSearch.setSearchCompleteCallback(null, |
| 98 | + function usePointFromPostcode( marker, callbackFunction ) { |
| 99 | + localSearch.setSearchCompleteCallback( null, |
97 | 100 | function() { |
98 | | - if (localSearch.results[0]) { |
| 101 | + if ( localSearch.results[0] ) { |
99 | 102 | callbackFunction(new GLatLng(localSearch.results[0].lat, localSearch.results[0].lng), marker); |
100 | | - }else{ |
101 | | - alert("Postcode not found!"); |
| 103 | + } else { |
| 104 | + document.getElementById( '{$this->mapName}_errors' ).innerHTML = '$couldNotGeocodeMsg'; |
102 | 105 | } |
103 | 106 | } |
104 | 107 | ); |
Index: trunk/extensions/UKGeocodingForMaps/README |
— | — | @@ -4,5 +4,5 @@ |
5 | 5 | of Maps could not be used, and this extension should be seen as a sort of hack. Initial |
6 | 6 | development for this extension was funded by Neill Mitchell for Prescient Software Ltd. |
7 | 7 | |
8 | | -Version 0.1 is an experimental release, in which multiple issues are expected. I'm hoping to |
| 8 | +Version 0.2 is an experimental release, in which multiple issues are expected. I'm hoping to |
9 | 9 | polish the whole extension a little more once I have some free time. Bug reports are welcome though. |
\ No newline at end of file |