Merge pull request #63 from v1r0x/load-multiple-addresses
display all contact addresses as marker
This commit is contained in:
Коммит
f238ce4527
|
@ -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<count($r['ADR']); $i++){
|
||||
$lookupAdr = implode(',', array_filter($r['ADR'][$i]));
|
||||
$lookup = $this -> doAdresslookup($lookupAdr);
|
||||
$contact ['location'][] = $lookup[0];
|
||||
}
|
||||
array_push($response['contacts'],$contact);
|
||||
}
|
||||
$response['nodes'] = $this->bboxSearch($kw, $bbox);
|
||||
|
|
25
js/script.js
25
js/script.js
|
@ -473,17 +473,19 @@ Array.prototype.unique = function() {
|
|||
});
|
||||
}
|
||||
|
||||
var markerHTML = '<b>' + contact.FN + "</b>";
|
||||
|
||||
var street = [contact.ADR[0][0], contact.ADR[0][1], contact.ADR[0][2]].clean('').join('<br />');
|
||||
var city = (contact.ADR[0][3]) ? contact.ADR[0][3] : '';
|
||||
markerHTML += '<br />' + street + " " + city;
|
||||
markerHTML += (contact.TEL) ? '<br />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<contact.location.length; i++){
|
||||
if(contact.location[i] == null) continue;
|
||||
var markerHTML = '<b>' + contact.FN + "</b>";
|
||||
var street = [contact.ADR[i][0], contact.ADR[i][1], contact.ADR[i][2]].clean('').join('<br />');
|
||||
var city = (contact.ADR[i][3]) ? contact.ADR[i][3] : '';
|
||||
markerHTML += '<br />' + street + ", " + city;
|
||||
markerHTML += (contact.TEL) ? '<br />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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче