diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php index 697c3c84..41259a91 100644 --- a/controller/pagecontroller.php +++ b/controller/pagecontroller.php @@ -104,10 +104,11 @@ class PageController extends Controller { foreach ($contacts as $r) { $data = array(); $contact = $r; - $lookupAdr = implode(',', array_filter($r['ADR'][0])); - $lookup = $this -> doAdresslookup($lookupAdr); - $contact ['location'] = $lookup[0]; - $contact -> image = $r['thumbnail']; + for($i=0; $i doAdresslookup($lookupAdr); + $contact ['location'][] = $lookup[0]; + } array_push($response['contacts'],$contact); } $response['nodes'] = $this->bboxSearch($kw, $bbox); diff --git a/js/script.js b/js/script.js index 542cb49f..5f2dc048 100644 --- a/js/script.js +++ b/js/script.js @@ -473,17 +473,19 @@ Array.prototype.unique = function() { }); } - var markerHTML = '' + contact.FN + ""; - - var street = [contact.ADR[0][0], contact.ADR[0][1], contact.ADR[0][2]].clean('').join('
'); - var city = (contact.ADR[0][3]) ? contact.ADR[0][3] : ''; - markerHTML += '
' + street + " " + city; - markerHTML += (contact.TEL) ? '
Tel: ' + escape(contact.TEL[0]) : ''; - var marker = L.marker([contact.location.lat * 1, contact.location.lon * 1], { - icon : iconImage - }); - toolKit.addMarker(marker, markerHTML) - mapSearch.searchItems.push(marker); + for(i=0; i"; + var street = [contact.ADR[i][0], contact.ADR[i][1], contact.ADR[i][2]].clean('').join('
'); + var city = (contact.ADR[i][3]) ? contact.ADR[i][3] : ''; + markerHTML += '
' + street + ", " + city; + markerHTML += (contact.TEL) ? '
Tel: ' + escape(contact.TEL[0]) : ''; + var marker = L.marker([contact.location[i].lat * 1, contact.location[i].lon * 1], { + icon : iconImage + }); + toolKit.addMarker(marker, markerHTML) + mapSearch.searchItems.push(marker); + } } mapSearch._ids.push(contact.id) }) @@ -1134,3 +1136,4 @@ Array.prototype.unique = function() { }, timeout); } })(jQuery, OC); +