*/
public function mapIcon($data)
{
+ static $currentRecordNumber = 1;
$searchResultNumbered =& $this->config
->getItem('section', 'conf')
->getItem('directive', 'searchResultNumbered')
->getContent();
extract($data['record']);
+ if (!$lat || !$lon) {
+ return false;
+ }
+
if ($searchResultNumbered && $this->memberMap) {
$format = BASE_URL . 'map/5680FC/%s.png';
}
if (empty($format)) {
return false;
}
- $currentRecordNumber
- = $data['currRow'] + $this->getCurrentRecordNumberStart();
- return array(
+ $html = array(
'id' => $currentRecordNumber - 1,
'icon' => sprintf(
$format,
$currentRecordNumber
)
);
+ ++$currentRecordNumber;
+ return $html;
}
// }}}
; to use map numbers for search results
searchResultNumbered = On
; turn on to have the member icon click to go up to the member location on map
-searchMapIconActive = Off
+searchMapIconActive = On
[add your business]
approvalNeeded = Off
; show billing module
billing = Off
; the rest of the billing module config setting are in
-; Toolkit/Members/Billing/config.ini
\ No newline at end of file
+; Toolkit/Members/Billing/config.ini
Map._infoWindow = new google.maps.InfoWindow;
$.get("member-db-google-map/"+location.search, Map._loadData, 'xml');
+ if (typeof glm_searchMapIconActive != 'undefined' && glm_searchMapIconActive) {
+ $(".map-link").live('click', function(e){
+ e.preventDefault();
+
+ var linkId = $(this).attr("rel");
+ console.log(linkId);
+ new google.maps.event.trigger(Map.arrMarkers[linkId], 'click');
+
+ Map._map.setZoom(14);
+ myAnchor = '#map-canvas';
+ window.location = String(window.location).replace(/\#.*$/, "") + myAnchor;
+ return false;
+ });
+ }
},
_loadData: function(data)
{
var markers = data.documentElement.getElementsByTagName("marker");
+ var index = 0;
for (i = 0; i < markers.length; i++) {
var name = markers[i].getAttribute('member_name');
var street = markers[i].getAttribute('street');
position: point
});
}
+
Map.arrMarkers.push(marker);
+ index++;
+ console.log('Add marker at ' + index);
Map._bindInfoWindow(marker, Map._map, Map._infoWindow, html);
}
);
Map._map.fitBounds(Map._latLngBounds);
- if (glm_searchMapIconActive) {
- $(".map-link").click(function (){
- var linkId = $(this).attr("rel");
- google.maps.event.trigger(Map.arrMarkers[linkId], "click");
- myAnchor = '#map-canvas';
- window.location = String(window.location).replace(/\#.*$/, "") + myAnchor;
- Map._map.setZoom(14);
- });
- }
},
_bindInfoWindow: function(marker, map, infoWindow, html)