/******************************************************* / Navigetter / / Main firing point Navigetter / Author: Scott R. Prelewicz, COMAND Solutions / Code Changes: Tim Sodhi, COMAND Solutions 11/19/09 & 05/10/10 / Notes: Made changes to the procedure to work with pagination, the correct way. / Notes: 05/10 - changes made to make the page load work with AJAX. / /******************************************************* /************************************* / Marker Info Box /**************************************/ var MyOverlay = function(marker, html) { this.marker = marker; this.html = html; this.divHeight = 0; //Element.getHeight('MainContent'); this.anchorOffsetX = -7; this.anchorOffsetY = 50; } MyOverlay.prototype = new GOverlay(); MyOverlay.prototype.initialize = function(map) { var div = document.createElement("div"); div.style.position = "absolute"; div.id = 'MessageOverlayText'; div.innerHTML = this.html; div.style.left = (map.fromLatLngToDivPixel(this.marker.getPoint()).x - this.anchorOffsetX)+ 'px'; div.style.top = (map.fromLatLngToDivPixel(this.marker.getPoint()).y - this.divHeight - this.anchorOffsetY) + 'px'; this.map_ = map; this.div_ = div; map.getPane(G_MAP_MARKER_PANE).appendChild(div); // info window dimensions var infoWindowHeight = Element.getHeight(div); var infoWindowWidth = 325; //Element.getWidth(div); var panX = 0; var panY = 0; var mapNE = map.fromLatLngToDivPixel(map.getBounds().getNorthEast()); var mapSW = map.fromLatLngToDivPixel(map.getBounds().getSouthWest()); // see if the infoWindow is going to be outside of the current map bounds if(div.offsetTop + 10 < mapNE.y) { panY = mapNE.y - div.offsetTop + 20; } if(div.offsetTop + infoWindowHeight + 10 > mapSW.y) { panY = mapSW.y - (div.offsetTop + 40) - infoWindowHeight; } if(div.offsetLeft + infoWindowWidth + this.anchorOffsetX > mapNE.x) { panX = ((div.offsetLeft + infoWindowWidth + this.anchorOffsetX + 20) - mapNE.x) * -1; } if((div.offsetLeft - this.anchorOffsetX) < mapSW.x) { panX = (div.offsetLeft - mapSW.x - (infoWindowWidth/2)) * -1; } // if info window is outside of map bounds, scroll map if(panX != 0 || panY != 0) { map.panBy(new GSize(panX - 10, panY)); } } MyOverlay.prototype.remove = function(){ this.div_.parentNode.removeChild(this.div_); } MyOverlay.prototype.redraw = function() { this.div_.style.left = (map.fromLatLngToDivPixel(this.marker.getPoint()).x - this.anchorOffsetX)+ 'px'; this.div_.style.top = (this.map_.fromLatLngToDivPixel(this.marker.getPoint()).y - this.divHeight - this.anchorOffsetY) + 'px'; } function closeOverlay() { if (currentMarker) { map.removeOverlay(currentMarker.overlay); //currentMarker.show(); } currentMarker = ''; } var timeout = 100; var closetimer = 0; var ddmenuitem = 0; function tagLayerOpen(id) { // cancel close timer tagLayerCancelClosetime(); //ddmenuitem = $(id); // close old layer if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; // get new layer and show it ddmenuitem = document.getElementById(id); ddmenuitem.style.visibility = 'visible'; ddmenuitem.style.display = 'block'; } // close showed layer function tagLayerClose() { if(ddmenuitem) { ddmenuitem.style.visibility = 'hidden'; ddmenuitem.style.display = 'none'; } } function tagLayerClosetime() { closetimer = window.setTimeout(tagLayerClose, timeout); } function tagLayerCancelClosetime() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null; } } // close layer when click-out document.onClick = tagLayerClose; /********************************* * Settings: **********************************/ var listWrapperDiv = "ListWrapper"; var listContentDiv = "ListContent"; var mapWrapperDiv = "MapWrapper"; var mapDiv = "Map"; var geocoder,map,point,postInterval,latlngPost,timeset, manager,currentMarker,adInterval = null; var mapListener; // The "click" listener for the map to post var moveListener; // The "dragend" listener for the map to update map in map lock view var dropDownListener; var postButtonListener; var zoomListener; var allowedBounds = new GLatLngBounds(new GLatLng(42.787338531,-79.3199157714844), new GLatLng(43.2210337757554,-78.4739685058594)); var Calendar; var ourSplitPane; var page = 1; //********* STATES ***************// var currentTag = new Array(); // array for current Tag. Associative. Will have "tag" and "tagName" keys. var maxNumberResults=0; var currentSearchDate; // If we are doing a date search, hold the date var isLive = 0; // Are we in live view? 1=Yes, 0=No var inBoundsOnly = 0; // Only Get Posts within the view of the map? var BlogUserID = 0; var CalOrWeather = 0; var disableMapApplicationLock = false; //********** MARKER PINS ***************// // Set up our marker pins for use throughout var markerPins = []; var popupMarkerPins = []; markerPins[0] = 'images/markerpins/MarkerTBD.gif'; popupMarkerPins[0] = 'images/markerpins/popup-MarkerTBD.gif'; markerPins[1] = 'images/markerpins/MarkerRed.gif'; popupMarkerPins[1] = 'images/markerpins/popup-MarkerRed.gif'; markerPins[2] = 'images/markerpins/MarkerOrange.gif'; popupMarkerPins[2] = 'images/markerpins/popup-MarkerOrange.gif'; markerPins[3] = 'images/markerpins/MarkerGreen.gif'; popupMarkerPins[3] = 'images/markerpins/popup-MarkerGreen.gif'; markerPins[4] = 'images/markerpins/MarkerDarkBrown.gif'; popupMarkerPins[4] = 'images/markerpins/popup-MarkerDarkBrown.gif'; markerPins[5] = 'images/markerpins/MarkerCrimson.gif'; popupMarkerPins[5] = 'images/markerpins/popup-MarkerCrimson.gif'; markerPins[6] = 'images/markerpins/MarkerBlack.gif'; popupMarkerPins[6] = 'images/markerpins/popup-MarkerBlack.gif'; markerPins[7] = 'images/markerpins/MarkerPurple.gif'; popupMarkerPins[7] = 'images/markerpins/popup-MarkerPurple.gif'; markerPins[8] = 'images/markerpins/MarkerHunter.gif'; popupMarkerPins[8] = 'images/markerpins/popup-MarkerHunter.gif'; markerPins[9] = 'images/markerpins/MarkerDarkRed.gif'; popupMarkerPins[9] = 'images/markerpins/popup-MarkerDarkRed.gif'; markerPins[10] = 'images/markerpins/MarkerDarkBlue.gif'; popupMarkerPins[10] = 'images/markerpins/popup-MarkerDarkBlue.gif'; markerPins[11] = 'images/markerpins/MarkerBrown.gif'; popupMarkerPins[11] = 'images/markerpins/popup-MarkerBrown.gif'; markerPins[12] = 'images/markerpins/MarkerAqua.gif'; popupMarkerPins[12] = 'images/markerpins/popup-MarkerAqua.gif'; markerPins[13] = 'images/markerpins/MarkerYellow.gif'; popupMarkerPins[13] = 'images/markerpins/popup-MarkerYellow.gif'; markerPins[14] = 'images/markerpins/MarkerPink.gif'; popupMarkerPins[14] = 'images/markerpins/popup-MarkerPink.gif'; markerPins[15] = 'images/markerpins/MarkerGrey.gif'; popupMarkerPins[15] = 'images/markerpins/popup-MarkerGrey.gif'; markerPins[16] = 'images/markerpins/MarkerDarkGreen.gif'; popupMarkerPins[16] = 'images/markerpins/popup-MarkerDarkGreen.gif'; markerPins[17] = 'images/markerpins/MarkerCyan.gif'; popupMarkerPins[17] = 'images/markerpins/popup-MarkerCyan.gif'; markerPins[18] = 'images/markerpins/MarkerBlue.gif'; popupMarkerPins[18] = 'images/markerpins/popup-MarkerBlue.gif'; markerPins[19] = 'images/markerpins/MarkerDarkPink.gif'; popupMarkerPins[19] = 'images/markerpins/popup-MarkerDarkPink.gif'; window.dhtmlHistory.create({ toJSON: function(o) { return Object.toJSON(o); }, fromJSON: function(s) { return s.evalJSON(); } }); function doResize() { $('Map').setStyle({ 'width': + Element.getWidth('MapWrapper') - 8 + 'px' }); map.checkResize(); } //****************************************************** // onload Handlers for different browsers, meant to fix the variances in onload // handlers between them. //****************************************************** /* for Mozilla/Opera9 */ if (document.addEventListener) { document.addEventListener("DOMContentLoaded", setupApplication, false); } /* for Internet Explorer */ /*@cc_on @*/ /*@if (@_win32) document.write("