Functions | Variables
search_results_map.js File Reference

This file will be optimized and embedded in the HTML that is returned for a meeting search map result. More...

Functions

function LoadMapMain ()
 This fills the entire window with a map. The scale (zoom) is automatically determined, based upon the radius.
function MarkerSetCallback (in_result)
 This is a callback that comes from the Google Bar being used to do a map search. What it does is hide the default search result marker (for the first result), and moves the center marker (and the search itself) to the location of the first result.
function ChooseZoom (in_radius)
 This chooses a zoom level that should accommodate the the given radius.
function MapClicked (overlay, in_point)
 If the map is clicked, the main marker is moved there, and a new AJAX search is performed.
function DragStart ()
 This "clears the decks" before a drag is started.
function ZoomEnd ()
 This redraws the circle, and starts a new AJAX search.
function DragEnd ()
 This redraws the circle, and starts a new AJAX search.
function ChangeRadius (in_radius)
 This responds to the popup menu in the main marker window.
function CreateCenterMarkerHTML (filter_message)
 This creates the info window HTML for the main marker.
function CreateCenterMarker (in_lat, in_lng)
 This creates the central marker on the map.
function ClearCircularOverlay ()
 This clears the circular overlay.
function CreateCircularOverlay ()
 This creates a translucent circular overlay that represents the radius of the search.
function ClearMarkers ()
 Clears all the current meeting markers.
function DisplayMapMeetings ()
 This calls an AJAX function to fetch the search results and display them.
function DisplayMapSearchCallback (in_text, in_param_1, in_param_2, in_last_call)
 This is the AJAX callback for the map search. The AJAX handler returns a JSON object with the basic meeting data. This creates a number of markers, each representing a meeting.
function CreateMapMarker (in_mtg_obj_array)
 This creates a single meeting's marker on the map.
function MapOverlappingMarkers (in_meeting_array)
 This returns an array, mapping out markers that overlap.
function openMarkerInfoWindow (in_marker)
 This simply opens whatever window was assigned to a marker.
function destVincenty (inGLatLng, dist, brng)
 Calculate destination point given start point lat/long (numeric degrees), bearing (numeric degrees) & distance (in m).
function GetPixelsPerMile (inPoint)

Variables

var main_lat = null
var main_lng = null
var main_map = null
var main_overlay = null
var main_marker = null
var main_radius = null
var main_kbh = null
var main_allocated_markers = null
var g_last_callback_result = null
Number prototype toRad
Number prototype toDeg

Detailed Description

This file will be optimized and embedded in the HTML that is returned for a meeting search map result.

This file is part of the Basic Meeting List Toolbox (BMLT).

Find out more at: http://magshare.org/bmlt

BMLT is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

BMLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this code. If not, see <http://www.gnu.org/licenses/>.


Function Documentation

function ChangeRadius (   in_radius)

This responds to the popup menu in the main marker window.

Parameters:
in_radiusA floating-point value. The radius of the circle, in miles.
function ChooseZoom (   in_radius)

This chooses a zoom level that should accommodate the the given radius.

Returns:
an integer, denoting the chozen zoom level.
Parameters:
in_radiusA floating-point value. The radius of the circle, in miles.

Referenced by LoadMapMain().

function ClearCircularOverlay ( )

This clears the circular overlay.

Referenced by CreateCircularOverlay(), DisplaySearchSpecification(), DragStart(), MapClicked(), and ZoomEnd().

function ClearMarkers ( )

Clears all the current meeting markers.

Referenced by ChangeRadius(), DragStart(), MapClicked(), and ZoomEnd().

function CreateCenterMarker (   in_lat,
  in_lng 
)

This creates the central marker on the map.

Parameters:
in_latA floating-point value. The latitude of the center of the map.
in_lngA floating-point value. The longitude of the center of the map.

Referenced by LoadMapMain(), and SmallMapClicked().

function CreateCenterMarkerHTML (   filter_message)

This creates the info window HTML for the main marker.

Referenced by CreateCenterMarker(), and DragEnd().

function CreateCircularOverlay ( )

This creates a translucent circular overlay that represents the radius of the search.

Referenced by DisplayMapSearchCallback(), DisplaySearchSpecification(), and SmallMapClicked().

function CreateMapMarker (   in_mtg_obj_array)

This creates a single meeting's marker on the map.

Parameters:
in_mtg_obj_arrayA meeting object array.

Referenced by DisplayMapSearchCallback().

function destVincenty (   inGLatLng,
  dist,
  brng 
)

Calculate destination point given start point lat/long (numeric degrees), bearing (numeric degrees) & distance (in m).

from: Vincenty direct formula - T Vincenty, "Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations", Survey Review, vol XXII no 176, 1975 www.ngs.noaa.gov/PUBS_LIB/inverse.pdf

Returns:
a GLatLng, containing the new point, as determined by distance and bearing.

This came from here: www.movable-type.co.uk/scripts/latlong-vincenty-direct.html

final bearing

Parameters:
inGLatLngThe GLatLng for a point.
distThe distance to be calculated (Defaults to 100 Km)
brngThe bearing to the next point, in degrees (defaults to 90 degrees -parallel to Equator)

Referenced by GetPixelsPerMile().

function DisplayMapMeetings ( )

This calls an AJAX function to fetch the search results and display them.

Referenced by DragEnd().

function DisplayMapSearchCallback (   in_text,
  in_param_1,
  in_param_2,
  in_last_call 
)

This is the AJAX callback for the map search. The AJAX handler returns a JSON object with the basic meeting data. This creates a number of markers, each representing a meeting.

Parameters:
in_textThis is the text returned by the AJAX handler. It is a JSON object.

Referenced by DisplayMapMeetings(), and ZoomEnd().

function DragEnd ( )

This redraws the circle, and starts a new AJAX search.

Referenced by ChangeRadius(), CreateCenterMarker(), LoadMapMain(), and MapClicked().

function DragStart ( )

This "clears the decks" before a drag is started.

Referenced by CreateCenterMarker().

function GetPixelsPerMile (   inPoint)
Parameters:
inPointIf this is not given, the map center is used.

Referenced by CreateCircularOverlay().

function LoadMapMain ( )

This fills the entire window with a map. The scale (zoom) is automatically determined, based upon the radius.

Referenced by DisplaySearchResultsMap().

function MapClicked (   overlay,
  in_point 
)

If the map is clicked, the main marker is moved there, and a new AJAX search is performed.

Referenced by LoadMapMain(), and MarkerSetCallback().

function MapOverlappingMarkers (   in_meeting_array)

This returns an array, mapping out markers that overlap.

Returns:
An array of arrays. Each array element is an array with n >= 1 elements, each of which is a meeting object. Each of the array elements corresponds to a single marker, and all the objects in that element's array will be covered by that one marker. The returned sub-arrays will be sorted in order of ascending weekday.
Parameters:
in_meeting_arrayAn array of JSON objects that will be sorted.

Referenced by DisplayMapSearchCallback().

function MarkerSetCallback (   in_result)

This is a callback that comes from the Google Bar being used to do a map search. What it does is hide the default search result marker (for the first result), and moves the center marker (and the search itself) to the location of the first result.

Parameters:
in_resultA search result object array.
function openMarkerInfoWindow (   in_marker)

This simply opens whatever window was assigned to a marker.

Referenced by CreateCenterMarker(), and CreateMapMarker().

function ZoomEnd ( )

This redraws the circle, and starts a new AJAX search.

Referenced by LoadMapMain(), and MakeSmallMap().


Variable Documentation

Contains the JSON object from the last search callback.

Referenced by ChangeRadius(), DisplayMapSearchCallback(), and ZoomEnd().

This will hold all of the allocated markers.

Referenced by ClearMarkers(), and CreateMapMarker().

var main_kbh = null

The keyboard handler.

var main_lat = null

The latitude of the center point

Referenced by LoadMapMain(), MakeSmallMap(), and ToggleMapVisibility().

var main_lng = null

The longitude of the center point

Referenced by DisplaySearchResultsMap(), LoadMapMain(), MakeSmallMap(), and ToggleMapVisibility().

var main_map = null
var main_marker = null
var main_overlay = null

The main circular overlay.

Referenced by ClearCircularOverlay(), and CreateCircularOverlay().

var main_radius = null
Number prototype toDeg
Initial value:
 function()
{
  return this * 180 / Math.PI;
}
Number prototype toRad
Initial value:
 function()
{
  return this * Math.PI / 180;
}
 All Classes Files Functions Variables Enumerations