Skip to content

Commit

Permalink
improved error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Breyer committed Mar 14, 2012
1 parent 75bf8de commit aad12bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions js/osm-isometric-3d.js
Expand Up @@ -327,12 +327,18 @@ function loadCity() {
city_id = getCityByLatLon(lat,lon);
if (city_id == "") {
var nearestCityId = getNearestCityId(new L.LatLng(lat,lon));
var msg = "Sorry, but the position '" + location_str + "' is out of any rendered area or the URL couldn't be parsed. " + '<br/><br/>Try the following: <ul>';
if (nearestCityId != "") {
if (nearestCityId != ""){
var msg = "The position '" + location_str + "' is out of any rendered area. " + '<br/><br/>Try the following: <ul>';
msg += '<li>Goto the nearest city: <a href="map.html#' + nearestCityId + '">' + getCityNameById(nearestCityId) + '</a>';
msg += '<li>Click <a href="index.html">here</a> to get a list of available cities</li></ul>';
showMessage("Sorry, but you're on a black spot!", msg);
}
msg += '<li>Check the URL</li> <li>Click <a href="index.html">here</a> to get a list of available cities</li></ul>';
showMessage("Error 404: Not found", msg);
else {
var msg = "Sorry, but the position '" + location_str + "' is out of any rendered area or the URL couldn't be parsed. " + '<br/><br/>Try the following: <ul>';
msg += '<li>Check the URL</li> <li>Click <a href="index.html">here</a> to get a list of available cities</li></ul>';
showMessage("Error 404: Not found", msg);
}


}
current_city_id = city_id;
Expand Down
4 changes: 2 additions & 2 deletions map.html
Expand Up @@ -20,8 +20,8 @@
<div id="map"> </div>
</div>
<div id="footer">
<a alt="Locate" id="locate" href="javascript:void(0)" onClick="locate()" title="find your geolocation"></a>
<a alt="Permalink" id="permalink" href="javascript:void(0)" onClick="loadPermalink()"></a>
<a alt="Locate" id="locate" href="javascript:void(0)" onClick="locate()" title="Locate me!"></a>
<a alt="Permalink" id="permalink" href="javascript:void(0)" onClick="loadPermalink()" title="Permalink"></a>
<div id="state">
<div class="timestamp">Last update: unknown</div>
</div>
Expand Down

0 comments on commit aad12bd

Please sign in to comment.