Index: trunk/extensions/UKGeocodingForMaps/GoogleMaps/UKG_GoogleMapsDispUkPoint.php |
— | — | @@ -68,11 +68,16 @@ |
69 | 69 | * |
70 | 70 | */ |
71 | 71 | public function addSpecificMapHTML() { |
72 | | - global $wgJsMimeType; |
| 72 | + global $wgJsMimeType, $egValidatorErrorLevel; |
73 | 73 | |
74 | 74 | $onloadFunctions = MapsGoogleMaps::addOverlayOutput( $this->output, $this->mapName, $this->overlays, $this->controls ); |
75 | 75 | |
76 | | - $couldNotGeocodeMsg = Xml::escapeJsString( wfMsg( 'ukgeocoding_couldNotGeocode' ) ); |
| 76 | + if ( $egValidatorErrorLevel >= Validator_ERRORS_WARN ) { |
| 77 | + $couldNotGeocodeMsg = Xml::escapeJsString( wfMsg( 'ukgeocoding_couldNotGeocode' ) ); |
| 78 | + $showErrorJs = "document.getElementById( '{$this->mapName}_errors' ).innerHTML = '$couldNotGeocodeMsg';"; |
| 79 | + } else { |
| 80 | + $showErrorJs = ''; |
| 81 | + } |
77 | 82 | |
78 | 83 | $this->output .=<<<EOT |
79 | 84 | <div id="$this->mapName"></div> |
— | — | @@ -100,7 +105,7 @@ |
101 | 106 | if ( localSearch.results[0] ) { |
102 | 107 | callbackFunction(new GLatLng(localSearch.results[0].lat, localSearch.results[0].lng), marker); |
103 | 108 | } else { |
104 | | - document.getElementById( '{$this->mapName}_errors' ).innerHTML = '$couldNotGeocodeMsg'; |
| 109 | + $showErrorJs |
105 | 110 | } |
106 | 111 | } |
107 | 112 | ); |