diff --git a/img/icons/amenity_post_office.png b/img/icons/amenity_post_office.png
new file mode 100644
index 0000000..06a4214
Binary files /dev/null and b/img/icons/amenity_post_office.png differ
diff --git a/js/Control.NominatimGeocoder.js b/js/Control.NominatimGeocoder.js
index 7632e8f..2cccf97 100644
--- a/js/Control.NominatimGeocoder.js
+++ b/js/Control.NominatimGeocoder.js
@@ -2,7 +2,7 @@ L.Control.NominatimGeocoder = L.Control.extend({
options: {
collapsed: true,
position: 'topright',
- text: 'Locate',
+ text: lang_locate,
callback: function (results) {
// Check if no results are returned
if (results.length >= 1) {
diff --git a/js/main.js b/js/main.js
index 5e42f0f..35efbe2 100644
--- a/js/main.js
+++ b/js/main.js
@@ -476,10 +476,12 @@ var zoomControl = L.control.zoom({
map.on('locationerror', onLocationError);
map.on('moveend', nominatimQuery);
- map.on('popupopen', function() {
+ map.on('popupopen', function(e) {
var href=$("#plusone-div").data("href");
var size=$("#plusone-div").data("size");
- gapi.plusone.render("plusone-div",{'size':size,'href':href});
+ //gapi.plusone.render("plusone-div",{'size':size,'href':href});
+ // we make sure that a proper address is displayed
+ e.popup._source.el.fetchAddress();
});
n=true;
var href=$("#main-plus").data("href");
diff --git a/js/poi.js b/js/poi.js
index 01aeb28..d001a58 100644
--- a/js/poi.js
+++ b/js/poi.js
@@ -10,7 +10,7 @@ var shop_icons=["alcohol",'antiques',"art",
var leisure_icons=['pitch','swimming_pool','stadium','track','sports_centre'];
var amenity_icons=['atm','bar','bank','biergarten','cafe','cinema','clinic','college','dentist','doctors','drinking_water',
'fast_food','fuel','hospital','ice_cream','kindergarten','library','nightclub',
-'pub','pharmacy','restaurant','school','shelter','social_facility','stripclub','theatre','toilets','university','veterinary'];
+'pub','pharmacy','restaurant','school','shelter','social_facility','stripclub','theatre','toilets','university','veterinary','post_office'];
var office_icons=[];
var craft_icons=['key_cutter','clockmaker','glaziery','photographer','shoemaker','tailor'];
var emergency_icons=['ambulance_station','defibrillator'];
@@ -150,15 +150,21 @@ POI.prototype.getInfoBox = function(){
content+='
';
//name
- content+='
';
+ content+='
';
//addr
- content+='
'+((this.element.tags.hasOwnProperty("addr:city")) ? this.element.tags["addr:city"]+', ' : "")+((this.element.tags.hasOwnProperty("addr:street")) ? this.element.tags["addr:street"]+', ' : "")+((this.element.tags.hasOwnProperty("addr:housenumber")) ? this.element.tags["addr:housenumber"]+', ' : "")+'';
-
+ if(this.element.tags.hasOwnProperty("addr:housenumber") && this.element.tags.hasOwnProperty("addr:street"))
+ content+='
'+((this.element.tags.hasOwnProperty("addr:city")) ? this.element.tags["addr:city"]+', ' : "")+this.element.tags["addr:street"]+', ' +this.element.tags["addr:housenumber"]+'';
+ else
+ content+='
'+lang_loading+'
';
//net
content+='
';
content += this.__genItems({tag:['contact:email','email'],icon:'glyphicon glyphicon-envelope',href:'mailto:'});
content += this.__genItems({tag:['contact:phone','phone'],icon:'glyphicon glyphicon-phone-alt',href:'tel:'});
- content += this.__genItems({tag:['contact:website','website'],icon:'glyphicon glyphicon-globe',href:''});
+ content += this.__genItems({tag:['contact:website','website'],icon:'glyphicon glyphicon-globe',href:'',
+ hrefFunc:function(nn){
+ // some website values have no protocol indication, resulting in a misintrepretation of the URL (eg. http://osm24.eu/www.jeudepaume.org)
+ return (nn.indexOf('http://') == -1 && nn.indexOf('https://') == -1)?'http://'+nn:nn;
+ }});
content += this.__genItems({tag:['contact:facebook'],icon:'glyphicon glyphicon-globe',name:"Facebook",href:'',hrefFunc:
function(nn){return ((nn.indexOf('/') === -1)?"http://facebook.com/":"")+nn;}});
@@ -191,9 +197,9 @@ POI.prototype.getInfoBox = function(){
content+='';
if(this.element.id[0]!='w')
- content+="
Open OSM";
+ content+="
"+lang_open_osm+"";
else
- content+="
Open OSM";
+ content+="
"+lang_open_osm+"";
content+='
';
@@ -284,3 +290,46 @@ POI.prototype.updateShadow = function (now){
return false;
return true;
};
+
+/*
+ Determine the address of a POI, if it is unknown
+*/
+POI.prototype.fetchAddress = function(){
+ var typeTable = {"node":"N","way":"W","relation":"R"};
+ var addressDiv = this.element.type+this.element.id;
+ // if the address has not been determined yet
+ if($("#"+addressDiv).html() == lang_loading)
+ {
+ var requestData;
+ if(this.element.tags.hasOwnProperty("addr:housenumber"))
+ {
+ if(this.element.type)
+ requestData = {osm_type:typeTable[this.element.type],osm_id:this.element.id};
+ else
+ // way objects have no key type, no idea why
+ requestData = {osm_type:this.element.id[0].toUpperCase(),osm_id:this.element.id.substr(1)};
+ }
+ else
+ requestData = {lon:this.element.lon,lat:this.element.lat};
+
+ $.ajax({
+ url: 'nominatim_reverse_proxy.php',
+ dataType: "json",
+ data: requestData,
+ number : this.element.tags["addr:housenumber"],
+ addressDiv : addressDiv,
+ success: function(nominatim){
+ var wayName = nominatim.address.road;
+ if(!wayName)wayName = nominatim.address.pedestrian;
+ if(!wayName)wayName = nominatim.address.footway;
+ var cityName = nominatim.address.city;
+ if(!cityName)cityName = nominatim.address.town;
+ if(!cityName)cityName = nominatim.address.village;
+ var displayedAddress = cityName?cityName:"";
+ displayedAddress += (wayName?", "+wayName:"");
+ displayedAddress += (this.number?", "+this.number:"");
+ $("#"+this.addressDiv).html('
'+displayedAddress+'');
+ }
+ });
+ }
+};
diff --git a/js_lang.php b/js_lang.php
index 3c187d2..f38dc8e 100644
--- a/js_lang.php
+++ b/js_lang.php
@@ -20,6 +20,7 @@
var lang_loading='';
var lang_please_zoom_in='';
var lang_open='';
+var lang_open_osm='';
var lang_last_hour='';
var lang_close='';
var lang_nodata='';
diff --git a/lang/de_DE.php b/lang/de_DE.php
index bb99b09..6fd7a32 100644
--- a/lang/de_DE.php
+++ b/lang/de_DE.php
@@ -348,6 +348,7 @@
define('JS_LOADING','Lade...');
define('JS_PLEASE_ZOOM_IN','Bitte hineinzoomen');
define('JS_OPEN','Offen');
+define('JS_OPEN_OSM','Open in OSM');
define('JS_LAST_HOUR','Letzte Stunde');
define('JS_CLOSE','Geschlossen');
define('JS_NO_DATA','Keine Daten');
diff --git a/lang/en_EN.php b/lang/en_EN.php
index e24e879..1ad32ff 100644
--- a/lang/en_EN.php
+++ b/lang/en_EN.php
@@ -142,6 +142,7 @@
define('PANEL_OFFICE_ASSOCIATION','Association');
define('PANEL_OFFICE_LAWYER','Lawyer');
define('PANEL_OFFICE_NOTARY','Notary');
+define('PANEL_OFFICE_POST_OFFICE','Post office');
define('PANEL_CRAFT_LIST','Type');
define('PANEL_CRAFT_ALL','All');
@@ -349,6 +350,7 @@
define('JS_LOADING','Loading...');
define('JS_PLEASE_ZOOM_IN','Please zoom in');
define('JS_OPEN','Open');
+define('JS_OPEN_OSM','Open in OSM');
define('JS_LAST_HOUR','Last hour');
define('JS_CLOSE','Closed');
define('JS_NO_DATA','No data');
diff --git a/lang/fr_FR.php b/lang/fr_FR.php
index 3cfddef..84970be 100644
--- a/lang/fr_FR.php
+++ b/lang/fr_FR.php
@@ -142,6 +142,7 @@
define('PANEL_OFFICE_ASSOCIATION','Association');
define('PANEL_OFFICE_LAWYER','Avocat');
define('PANEL_OFFICE_NOTARY','Notaire');
+define('PANEL_OFFICE_POST_OFFICE','Bureau de poste');
define('PANEL_CRAFT_LIST','Type');
define('PANEL_CRAFT_ALL','Tous');
@@ -180,7 +181,7 @@
define('PANEL_STORE_ART','Art');
define('PANEL_STORE_CLOTHES','Vêtements');
define('PANEL_STORE_FOOD','Alimentation');
-define('PANEL_STORE_ORGANIC','Organic');
+define('PANEL_STORE_ORGANIC','Bio');
define('PANEL_STORE_ELECTRONIC','Électronique');
define('PANEL_STORE_HEALTH_AND_BEAUTY','Soins et beauté');
define('PANEL_STORE_TRANSPORT','Transport');
@@ -349,6 +350,7 @@
define('JS_LOADING','Chargement...');
define('JS_PLEASE_ZOOM_IN','Zoomez pour voir les points d\'intérêt');
define('JS_OPEN','Ouvert');
+define('JS_OPEN_OSM','Ouvrir dans OpenStreetMap');
define('JS_LAST_HOUR','Moins d\'une heure');
define('JS_CLOSE','Fermé');
define('JS_NO_DATA','Inconnu');
diff --git a/lang/it_IT.php b/lang/it_IT.php
index a3bc9e8..6427f55 100644
--- a/lang/it_IT.php
+++ b/lang/it_IT.php
@@ -138,6 +138,7 @@
define('PANEL_OFFICE_ASSOCIATION','Associazioni');
define('PANEL_OFFICE_LAWYER','Avvocato');
define('PANEL_OFFICE_NOTARY','Notarile');
+define('PANEL_OFFICE_POST_OFFICE','Post office');
define('PANEL_CRAFT_LIST','Tipo');
define('PANEL_CRAFT_ALL','Tutto');
@@ -345,6 +346,7 @@
define('JS_LOADING','Loading...');
define('JS_PLEASE_ZOOM_IN','Please zoom in');
define('JS_OPEN','Open');
+define('JS_OPEN_OSM','Open in OSM');
define('JS_LAST_HOUR','Last hour');
define('JS_CLOSE','Closed');
define('JS_NO_DATA','No data');
diff --git a/lang/ru_RU.php b/lang/ru_RU.php
index a56b586..438d2cb 100644
--- a/lang/ru_RU.php
+++ b/lang/ru_RU.php
@@ -143,6 +143,7 @@
define('PANEL_OFFICE_ASSOCIATION','Association');
define('PANEL_OFFICE_LAWYER','Юрист');
define('PANEL_OFFICE_NOTARY','Нотариус');
+define('PANEL_OFFICE_POST_OFFICE','Post office');
define('PANEL_CRAFT_LIST','Профессия');
define('PANEL_CRAFT_ALL','Все');
@@ -351,6 +352,7 @@
define('JS_LOADING','Идет загрузка...');
define('JS_PLEASE_ZOOM_IN','Приблизьте карту, чтобы увидеть объекты');
define('JS_OPEN','Открыто');
+define('JS_OPEN_OSM','Open in OSM');
define('JS_LAST_HOUR','Последний час');
define('JS_CLOSE','Закрыто');
define('JS_NO_DATA','Нет данных');
diff --git a/lang/uk_UA.php b/lang/uk_UA.php
index 7ba1eb3..f417b4e 100644
--- a/lang/uk_UA.php
+++ b/lang/uk_UA.php
@@ -143,6 +143,7 @@
define ('PANEL_OFFICE_ASSOCIATION', 'Товариство');
define ('PANEL_OFFICE_LAWYER', 'Юрист');
define ('PANEL_OFFICE_NOTARY', 'Нотаріус');
+define('PANEL_OFFICE_POST_OFFICE','Post office');
define ('PANEL_CRAFT_LIST', 'Професія');
define ('PANEL_CRAFT_ALL', 'Усе');
@@ -351,6 +352,7 @@
define ('JS_LOADING', 'Йде завантаження…');
define ('JS_PLEASE_ZOOM_IN', 'Наблизьте мапу, щоб побачити об’єкти');
define ('JS_OPEN', 'Відкрито');
+define('JS_OPEN_OSM','Open in OSM');
define ('JS_LAST_HOUR', 'Остання година');
define ('JS_CLOSE', 'Зачинено');
define ('JS_NO_DATA', 'Дані');
diff --git a/main.php b/main.php
index dc4eb30..d5606a5 100644
--- a/main.php
+++ b/main.php
@@ -95,7 +95,7 @@