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