40: editing, which includes a CTAGS implementation. That means it can generate a function list
85: function GxMagnifierNamespace() {
// Constructor
// - GMap underlyingMap = a reference to the main map
// - bool makeCopy? can be false to cause a new map to be created
// - HTMLElement customContainer? can be specified as a target for magnified map
106: function GxMagnifierb(underlyingMap, useBlank, customContainer) { // [PUBLIC]
141: function _____INITIALIZATION() {} // [DELETELINE]
// Called by GxMagnifier constructor to set the GxMagnifier default configuration state
144: GxMagnifierb.prototype.p_initDefaults = function(useBlank, customContainer) { // [PRIVATE]
// Creates a new container inside the underlying map's container to hold the
// magnified map. Requires this.um to be set. Sets this.container.
228: GxMagnifierb.prototype.p_createContainer = function() { // [PRIVATE]
// Sets up a custom container (keep it to a minimum - we don't want to fool around with user's
// container any more than we have to).
// This is also called by gxmCreateContainer() to avoid code duplication.
254: GxMagnifierb.prototype.p_setupContainerMinimal = function() { // [PRIVATE]
// Create the magnified GMap. Sets this.map.
// - bool makeCopy? determines whether the underlying map should be copied, or whether a
// new blank map (more API-safe) should be created.
261: GxMagnifierb.prototype.p_createMagnifiedMap = function(useBlank) { // [PRIVATE]
// Performs initial setup on the magnified map
288: GxMagnifierb.prototype.p_setupMagnifiedMap = function(wasAPICopied) { // [PRIVATE]
// Creates the "Loading tiles" div and appends to the magnified map's container.
// Sets this.loadingMessageContainer.
307: GxMagnifierb.prototype.p_createLoadingMessage = function(msg) { // [PRIVATE]
326: function _____EVENT_HANDLING() {} // [DELETELINE]
328: GxMagnifierb.prototype.p_setupListeners = function() { // [PRIVATE]
333: function() {
343: function() {
351: function(o) {
359: function(o) {
364: function() {
// Document mouse move callback
// Sets this.mousePt, this.mousePtUmc, this.mouseIsInUmc.
// Note we can't cache the size/position of the map/container, because they can be change without
// us knowing it (especially in parked mode).
381: GxMagnifierb.prototype.p_onDocMouseMove = function(event) {
// Should only call when in parked mode
410: GxMagnifierb.prototype.p_checkFireMouseEvent = function() {
// Magnified map click callback
419: GxMagnifierb.prototype.p_onContainerClick = function(event) {
439: GxMagnifierb.prototype.p_queueDelayedZoom = function() {
446: GxMagnifierb.prototype.p_cancelDelayedZoom = function() {
// A utility for the user
452: GxMagnifierb.prototype.createImage = function(imageSrc) {
// Also just here as utility for user
458: GxMagnifierb.prototype.centerElementOn = function(el, pt, borderAdjustment) {
465: function _____CONTROL() {} // [DELETELINE]
467: GxMagnifierb.prototype.show = function() {
474: GxMagnifierb.prototype.hide = function() {
// Sets the size of the magnifier window
483: GxMagnifierb.prototype.setSize = function(size) {
493: GxMagnifierb.prototype.showLoadingMessage = function(html) {
498: GxMagnifierb.prototype.hideLoadingMessage = function() {
// Ignored if using custom container
503: GxMagnifierb.prototype.park = function(pt) {
// Park the magnifier at the given marker. Note that it is NOT attached to the marker,
// and will not move around as the map scrolls. If you wanted to implement attaching,
// a new state flag (e.g. attachedToLngLat).
// Ignored if using custom container
527: GxMagnifierb.prototype.parkAtMarker = function(m, offsetLeft, offsetTop) {
542: GxMagnifierb.prototype.unpark = function(w) {
550: function _____OVERLAY_SYNC() {} // [DELETELINE]
// Synchronize overlays with those of the main map, by clearing existing ones
// and rebuilding. Not efficient. Intended to be used after making a new map with
// the makeCopy=false parameter.
555: // This was written based on a similar function in the API internals
// Synchronize overlays with those of the main map, by clearing existing ones
// and rebuilding. Not efficient. Intended to be used after making a new map with
// the makeCopy=false parameter.
// This was written based on a similar function in the API internals
556: GxMagnifierb.prototype.syncOverlays = function() { // [PUBLIC]
// Creates a circular reference situation, but Javascript GC should be
// able to deal with that, even if p_removeSyncedOverlay doesn't get called
// Returns the newly added overlay
567: GxMagnifierb.prototype.p_addSyncedOverlay = function(orgOverlay) {
577: GxMagnifierb.prototype.p_removeSyncedOverlay = function(orgOverlay) {
598: function _____REFRESH() {} // [DELETELINE]
// Especially if using a custom container, the user may have decided to hide
601: // it while we "weren't looking". This function determines if we're visible
// Especially if using a custom container, the user may have decided to hide
// it while we "weren't looking". This function determines if we're visible
// or not (although the user really should call our show() and hide()).
603: GxMagnifierb.prototype.isVisible = function() {
// Perform a full refresh of the magnified map's center/zoom/type.
// Mainly used in response to a show() command if prefetching was off,
// to set the map to the correct place before it is shown, but also
// can be called from refresh() or any event handlers that don't
// care about really fast execution.
613: GxMagnifierb.prototype.p_refreshMap = function(force) {
// If we're not visible and prefetch is off, then don't do any
// refreshing on the map unless forced. Never do any refreshing before
// this.map is set.
623: GxMagnifierb.prototype.p_okayToRefreshMap = function(force) {
// Set magnifier map to same type as main map
// ignoreMapSyncSetting is just for use during startup
640: GxMagnifierb.prototype.p_syncMapTypes = function(force, ignoreMapSyncSetting) {
// Set the magnifier zoom to the appropriate level
647: GxMagnifierb.prototype.p_refreshMapZoom = function(force) {
653: GxMagnifierb.prototype.p_getNewZoomLevel = function() {
// Sets the center Lat/Lng of the magnified map to where its supposed to be
// after either a) the cursor has moved, or b) the underlying map has moved,
// resulting in the cursor hovering over a new Lat/Lng.
663: // Since this function can be invoked from a handful of sources (including
// Sets the center Lat/Lng of the magnified map to where its supposed to be
// after either a) the cursor has moved, or b) the underlying map has moved,
// resulting in the cursor hovering over a new Lat/Lng.
// Since this function can be invoked from a handful of sources (including
// this.p_onDocMouseMove, this.refresh, and the underlying map's zoom event)
// we go through all applicable state validation checks.
666: GxMagnifierb.prototype.p_refreshMapLatLng = function(force) {
706: GxMagnifierb.prototype.p_centerMapAtUmcCoord = function(pt) {
// Centers the magnified map window after the mouse has moved, and updates
// the map. Also invokes autoPanning if required.
// Requirements:
// - not in parked mode, mouse coordinates set
714: GxMagnifierb.prototype.p_refreshWindowCenter = function() {
751: function _____AUTOPAN() {} // [DELETELINE]
761: GxMagnifierb.prototype.enableAutoPan = function() {
765: GxMagnifierb.prototype.disableAutoPan = function() {
774: GxMagnifierb.prototype.p_doAutoPan = function() {
779: // Reuse same function to check for vertical pan
785: GxMagnifierb.prototype.p_stopAutoPan = function() {
// This is the "control" portion of the autoPanEnabled logic. It decides what to do
// when the mouse is in an autoPanEnabled region. Given that p_getAutoPanRatio() returns
797: // a fraction, this function could theoretically be extended to accelerate
// This is the "control" portion of the autoPanEnabled logic. It decides what to do
// when the mouse is in an autoPanEnabled region. Given that p_getAutoPanRatio() returns
// a fraction, this function could theoretically be extended to accelerate
// panning as the mouse travels further away from the center of the map.
799: GxMagnifierb.prototype.p_checkPan = function(x, umcLeft, umcWidth, mapWidth, panning, rightKey, leftKey) {
// This is the "evaluate" portion of the autoPanEnabled logic. It determines if the mouse
// is in an autoPanEnabled region, and returns a fraction indicating how far into that
// region the mouse has gone.
// Returns a positive value if mouse is in right/bottom region, a negative value if its in
// left/top region, and otherwise 0.
// The specific value returned is between 0 and 1, proportional to how far into the AutoPan
// region the mouse is (i.e. larger the farther away the mouse is from the map center).
822: GxMagnifierb.prototype.p_getAutoPanRatio = function(x, containerLeft, containerWidth, mapWidth) {
// Returns how far into an imaginary box a co-ordinate is.
// If x is outside of [left, right], 0 is returned, otherwise
// a value between 0 and 1 is returned, proportional to much
// bigger x is than left.
// (Imagine a horizontal slider control)
844: GxMagnifierb.prototype.p_getOverlapRatio = function(x, left, right) {
855: function _____CONFIGURATION() {} // [DELETELINE]
// EXPOSE
858: GxMagnifierb.prototype.setMagnification = function(levels) {
864: GxMagnifierb.prototype.enableMapSync = function() {
868: GxMagnifierb.prototype.disableMapSync = function() {
872: GxMagnifierb.prototype.enableAutoMagnify = function() {
876: GxMagnifierb.prototype.disableAutoMagnify = function() {
880: GxMagnifierb.prototype.enableMouseTracking = function() {
884: GxMagnifierb.prototype.disableMouseTracking = function() {
888: GxMagnifierb.prototype.enableAutoPan = function() {
892: GxMagnifierb.prototype.disableAutoPan = function() {
897: GxMagnifierb.prototype.enablePanBeforeZoomIn = function() {
901: GxMagnifierb.prototype.disablePanBeforeZoomIn = function() {
905: GxMagnifierb.prototype.enablePrefetch = function() {
909: GxMagnifierb.prototype.disablePrefetch = function() {
913: GxMagnifierb.prototype.enableDefaultClickHandler = function() {
917: GxMagnifierb.prototype.disableDefaultClickHandler = function() {
921: GxMagnifierb.prototype.enableOverlaySync = function() {
925: GxMagnifierb.prototype.disableOverlaySync = function() {
929: GxMagnifierb.prototype.setBorderWidth = function(w) {
934: GxMagnifierb.prototype.setCursor = function(c) {
941: function _____BOUNDING_HELPERS() {} // [DELETELINE]
// Returns the given value, adjusting it if required so that it falls between
// minVal and maxVal
954: function getBoundedValue(val, minVal, maxVal) {
960: function isValueInBounds(val, minVal, maxVal) {
964: function isPtInBounds(p, bound) {
970: function isPtInGSize(p, gs) {
// Determines whether the given point is in bounds of the given element.
// Point must be specified in terms of the ELEMENT'S coordinate system,
// not its offsetParent's (i.e. if pt is (0,0) then it falls on the
// top-left corner of the element).
// Primarily for use with a point returned from pageCoordToElement.
981: function isPtContained(pt, el) {
// Adjusts the point's x and y as required to ensure it falls within
// the given GBound.
988: function getBoundedPt(pt, bounds) {
// Returns a new GBounds whose limits are grown/shrunk by the
// given amounts. If amountVert is not specified, then the
// bounds is shrinked evenly on all sides by amountHorz.
// If justShift is true then the bounds are shifted right
// and down by the given amount instead of expanded (used by
// offsetBounds()).
1001: function expandBounds(bounds, amountHorz, amountVert, justShift) {
// Returns a new GBounds whose limits are shifted by the
// given amounts. If amountVert is not specified, then
// amountHorz is used for both the right and down shift.
1015: function offsetBounds(bounds, amountHorz, amountVert) {
// Gets the outer boundaries for an html element (like a div) and returns in
// a new GBound object. The result is in a co-ordinate system who's origin
// is the top-left of the element's offsetParent.
1023: function getElementBounds(container) {
1033: function getElementSize(container) {
// Tests whether a point in page coordinates (typically the cursor location)
// is inside of a particular container
1039: function hitTest(pt, el) {
1047: function _____OTHER_HELPERS() {} // [DELETELINE]
// Add a line to the trace
1050: function trace(s, newline, clearfirst) {
// This one probably needs a good bit of improvement.
1060: function createImageC(imageSrc, container, ownerDocument) {
// Adapted from API internals
1074: function setCursorC(a,b){
// Returns the center position of the element (in terms of its offsetParent)
// BUG: In FireFox and IE under Windows in strict mode at least, the offsetWidth
1086: // function doesn't include the element's border width(s). For a 2px border
// Returns the center position of the element (in terms of its offsetParent)
// BUG: In FireFox and IE under Windows in strict mode at least, the offsetWidth
// function doesn't include the element's border width(s). For a 2px border
1087: // this function will give a result 2px further left and 2px higher up than
// Returns the center position of the element (in terms of its offsetParent)
// BUG: In FireFox and IE under Windows in strict mode at least, the offsetWidth
// function doesn't include the element's border width(s). For a 2px border
// this function will give a result 2px further left and 2px higher up than
// we would like. For now, this solved with a "borderAdjustment" hack.
1089: function getElementCenter(el, borderAdjustment) {
// Centers the given element on the given point (in terms of its offsetParent).
// See "BUG" note in getElementCenter().
1099: function centerElementOnP(el, pt, borderAdjustment) {
1106: function getBorderWidth(el) { // Really should be checking a bunch of styles
// Convert a coordinate based on the page body to one relative to to the container,
// by walking up all offsetParent's until we hit the document.
// See "BUG" note in getElementCenter().
1117: function pageCoordToElement(pt, el) {
// Detect mouse coordinates relative to the document body
// Based on http://www.devarticles.com/c/a/JavaScript/Handling-events-with-the-DOM-Part-III/5/
1128: function getMouseCoordinates(e) {
// Perform a delayed zoom
1142: function GxMagnifierDelayedZoomb(mapContainer, level) {
1156: function _____GX_MAGNIFIER_CONTROL() {} // [DELETELINE]
1158: function GxMagnifierControlb(createNewMap) {
// This is called by the API to create the control
1164: GxMagnifierControlb.prototype.initialize = function(map) {
// This isn't doing anything
// GEvent.addListener(this.div, "contextmenu",
1178: // function() {alert('GxMagnifier powered by Google Mappers.com')});
// Just here to make life easier for programmers
1185: GxMagnifierControlb.prototype.map = function() {
// If image is undefined, uses simple text "Z"
1190: GxMagnifierControlb.prototype.setMagnifyImage = function(image) {
1194: GxMagnifierControlb.prototype.show = function() {
1198: GxMagnifierControlb.prototype.hide = function() {
1203: GxMagnifierControlb.prototype.createControlButtons = function() {
1219: function() {
// Required by API
1234: GxMagnifierControlb.prototype.getDefaultPosition = function() {
1235: // This function is required for the control interface
// Move the control buttons (only works if set before initialized)
1240: GxMagnifierControlb.prototype.setDefaultPosition = function(p) {
// Probably required by the API
1245: GxMagnifierControlb.prototype.remove=function(){
// Handle the magnify button's click event
// Note the user can override this function, so keep it exposed.
1253: GxMagnifierControlb.prototype.onMagnifyClick = function() {
1262: function _____GX_BUTTONS_CLASS() {} // [DELETELINE]
1264: function GxButtonsb() {}
// Generate a container for the buttons, but don't append it to main document yet
1267: GxButtonsb.prototype.generateContainer = function(ownerDocument) {
// Append button container to document and return it
// Generates a container if not done already.
1278: GxButtonsb.prototype.appendToDom = function(container) {
// Add an image button
1286: GxButtonsb.prototype.addImageButton = function(imageSrc, tooltipText) {
// Add a text button
1297: GxButtonsb.prototype.addTextButton = function(text, tooltipText) {
1323: function _____G_CONTROL_POSITION_HACK() {} // [DELETELINE]
1325: function GxControlPositionHackb(a,b,c){
// These appear to be called by the API
1332: GxControlPositionHackb.prototype.apply=function(a){
1338: GxControlPositionHackb.prototype.getWidthMeasure=function(){
1347: GxControlPositionHackb.prototype.getHeightMeasure=function(){
1356: function _____SCRATCH_AREA() {} //[DELETELINE]
// Make public interface (expose objects)
1364: function makeInterface(a) {
1404: function getBoundedLatLng(val, minVal, maxVal) {}
// Return a copy of the given map by using undocumented API function. Doesn't worry about
// copying center lat/lng or zoom. Can be removed.
1411: function copyMapAPI(map) {
1423: function getMouseCoordinates2(e) {
1474: function captureMouseMove(callback) {
// Netscape mousemove handler
1490: function mouseMoveNN(e) {
// IE mousemove handler
1498: function mouseMoveIE() {