gremmie@1: var mmap = { gremmie@1: map: null, gremmie@1: geocoder: null, gremmie@1: users: Object, gremmie@1: userOnMap: false, gremmie@1: userClick: function() { gremmie@1: var name = $('option:selected', this).text(); gremmie@1: if (name != mmap.selectText) gremmie@1: { gremmie@1: mmap.clickUser(name); gremmie@1: } gremmie@1: }, gremmie@1: clickUser: function(name) { gremmie@1: pt = new GLatLng(mmap.users[name].lat, mmap.users[name].lon); gremmie@1: mmap.map.setCenter(pt); gremmie@1: mmap.users[name].marker.openInfoWindowHtml(mmap.users[name].message); gremmie@1: }, gremmie@1: clear: function() { gremmie@1: mmap.users.length = 0; gremmie@1: }, gremmie@1: resizeUserList: function() { gremmie@1: var sel = $('#member_map_members'); gremmie@1: sel[0].size = Math.min(29, sel[0].length); gremmie@1: $('#member_map_count').html(sel[0].length); gremmie@1: }, gremmie@1: selectText: "(select)", gremmie@1: onMapDir: 'You have previously added yourself to the member map. Your information appears below. You may change ' + gremmie@1: 'the information if you wish. To delete yourself from the map, click the Delete button.', gremmie@1: offMapDir: 'Your location is not on the map. If you would like to appear on the map, please fill out the form below ' + gremmie@1: 'and click the Submit button.' gremmie@1: }; gremmie@1: $(document).ready(function() { gremmie@1: if (GBrowserIsCompatible()) gremmie@1: { gremmie@1: $(window).unload(GUnload); gremmie@1: mmap.map = new GMap2($('#member_map_map')[0]); gremmie@1: mmap.map.setCenter(new GLatLng(15.0, -30.0), 2); gremmie@1: mmap.map.enableScrollWheelZoom(); gremmie@1: mmap.map.addControl(new GLargeMapControl()); gremmie@1: mmap.map.addControl(new GMapTypeControl()); gremmie@1: mmap.geocoder = new GClientGeocoder(); gremmie@1: gremmie@1: if (mmapUser.userName) gremmie@1: { gremmie@1: $.getJSON('/member_map/query/', gremmie@1: function(data) { gremmie@1: mmap.map.clearOverlays(); gremmie@1: var sel = $('#member_map_members'); gremmie@1: sel[0].length = 0; gremmie@1: mmap.clear(); gremmie@1: $.each(data.users, function(i, item) { gremmie@1: sel.append($('