/** * Active Website Map Search * * @author Nick Verbeck * @since 10/1/2008 */ MapSearch = {}; MapSearch.version = '3-Beta'; /** * Map Search Console * * Used as a wrapper to Firebug console. To resolve IE not having cool tools. * * @author Nick Verbeck */ MapSearch.Console = { Levels: {None: 0,Info: 1,Warn: 2,Debug: 4,Error: 8,All: 15}, CurrentLevel: 0, debug: function(msg){ if (MapSearch.Console.CurrentLevel & MapSearch.Console.Levels.Debug != 0) { Try.these( function(){console.debug(msg);}, function(){alert(msg.toString());}, function(){alert(msg);} ); } }, error: function(msg){ if (MapSearch.Console.CurrentLevel & MapSearch.Console.Levels.Error != 0) { Try.these( function(){console.error(msg);}, function(){alert(msg.toString());}, function(){alert(msg);} ); } }, info: function(msg){ if (MapSearch.Console.CurrentLevel & MapSearch.Console.Levels.Info != 0) { Try.these( function(){console.info(msg);}, function(){alert(msg.toString());}, function(){alert(msg);} ); } }, warn: function(msg){ if (MapSearch.Console.CurrentLevel & MapSearch.Console.Levels.Warn != 0) { Try.these( function(){console.warn(msg);}, function(){alert(msg.toString());}, function(){alert(msg);} ); } } } /** * @author nick */ MapSearch.Office = {} MapSearch.Office.Collection = Class.create({ initialize: function() { this.offices = new Array(); this.length = 0; }, concat: function(office){ this.offices = this.offices.concat(office); this.length = this.offices.length; }, push: function(office){ this.offices.push(office); this.length = this.offices.length; }, clear: function(){ this.offices = new Array(); this.length = 0; }, each: function(call){ this.offices.each(call); }, getOfficeCodes: function(){ var codes = new Array(); this.each(function(iter){ codes = codes.concat(iter.info.codes); }); return codes; } }); MapSearch.Office.Collection.Instance = null; MapSearch.Office.Collection.I = function(){ if(MapSearch.Office.Collection.Instance == null){ MapSearch.Office.Collection.Instance = new MapSearch.Office.Collection(); } return MapSearch.Office.Collection.Instance; } MapSearch.Office.Office = Class.create(); MapSearch.Office.Office.prototype = { initialize: function(info) { this.info = { codes: new Array(), title: '', latitude: 0, longitude: 0, streetAddress: '', city: '', state: '', phone: '', image: '' } Object.extend(this.info, info || {}); this.pushpin = null; }, changeInfo: function(info){ Object.extend(this.info, info || {}); }, getPushpin: function(){ if(this.pushpin == null){ var html = MapSearch.Template.Bubble.Office.evaluate({ img:this.info.image, title:this.info.title, street:this.info.streetAddress, city:this.info.city, state:this.info.state, phone:this.info.phone }); //html = new Array(new GInfoWindowTab('Desc', html), new GInfoWindowTab('Test','Test Content')); this.point = new MapSearch.Map.LatLong(this.info.latitude, this.info.longitude); this.pushpin = MapSearch.Map.I().createPushpin(this.point.getObject(), html, MapSearch.Config.Icons.Base.office); } return this.pushpin; } }/** * @author nick */ MapSearch.Search = {}; MapSearch.Search.Instance = null; MapSearch.Search.I = function(){ if (MapSearch.Search.instance == null){ MapSearch.Search.instance = new MapSearch.Search.Base(); } return MapSearch.Search.instance; } MapSearch.Search.Base = Class.create({ initialize: function() { this.GUI = MapSearch.GUI.Base.I(); this.Map = MapSearch.Map.I(); this.Results = new MapSearch.Property.Collection(MapSearch.Property.Types.Results); this.pageing = false; this.Params = { propertyType: '', sqftMin: 0, sqftMax: '', priceMin: 0, priceMax: 0, beds: 0, baths: 0, mls: '', bounds: '', limit: 50, wkt: '', order: 'PriceDesc', offset: 0, owner_only: '', New_Property: '', WithPics: '', Virtual_Tour: '', video: '' } this.runUpdateParams = false; this.parseQueryString(); this.GUI.Panels.Search.loaded(function(){this.onLoadSearch();}.bind(this)); this.GUI.Status.setSearchResultsCallback(function(pEvent){ this.searchEvent(pEvent); }.bind(this)); }, onLoadSearch: function(){ try{ Event.observe(this.GUI.Panels.Search.items.searchBtn, 'click', this.searchEvent.bindAsEventListener(this)); } catch(e){} try{ Event.observe(this.GUI.Panels.Search.items.pagePrev, 'click', this.pageEvent.bindAsEventListener(this)); } catch(e){} try{ Event.observe(this.GUI.Panels.Search.items.pageNext, 'click', this.pageEvent.bindAsEventListener(this)); } catch(e){} try{ Event.observe(this.GUI.Panels.Search.items.sort, 'change', this.orderEvent.bindAsEventListener(this)); } catch(e){} this.updateSearchItems(); }, parseQueryString: function(){ this.query = document.location.search.toQueryParams(); $H(this.query).each(function(iter){ if(this.Params[iter.key] != undefined && this.Params[iter.key] != null){ this.Params[iter.key] = iter.value; this.runUpdateParams = true; } }.bind(this)); }, updateSearchItems: function(){ if(this.runUpdateParams){ this.GUI.Panels.Search.items.propType.value = this.Params.propertyType; this.GUI.Panels.Search.items.priceMin.value = this.Params.priceMin; this.GUI.Panels.Search.items.priceMax.value = this.Params.priceMax; this.GUI.Panels.Search.items.beds.value = this.Params.beds; this.GUI.Panels.Search.items.baths.value = this.Params.baths; this.GUI.Panels.Search.items.minSQFT.value = this.Params.sqftMin; this.GUI.Panels.Search.items.maxSQFT.value = this.Params.sqftMax; this.GUI.Panels.Search.items.MLS.value = this.Params.mls; this.searchEvent(); } }, orderEvent: function(pEvent){ if (this.Results.length > 0) { this.Params.offset = 0; this.pageing = true; this.searchEvent(pEvent); } }, pageEvent: function(pEvent){ var limit = Number(this.GUI.Panels.Search.items.limit.getValue()); if(limit != this.Params.limit){ //Reset Paging. They changed there limit to show per page. this.Params.offset = 0; this.searchEvent(pEvent); } else if(this.Results.length == 0){ this.searchEvent(pEvent); } else { //Continue Paging this.pageing = true; var element = Event.element(pEvent); if(element == this.GUI.Panels.Search.items.pagePrev){ //Page Prev if((this.Params.offset - limit) < 0){ this.Params.offset = 0; } else { this.Params.offset -= limit; } this.searchEvent(pEvent); } else { //Page Next this.Params.offset += limit; this.searchEvent(pEvent); } } }, searchEvent: function(pEvent){ this.GUI.Status.toggleMapStatus(true); this.GUI.Status.setMapStatus(MapSearch.Config.GUI.MSGs.MapSearch); this.Params.propertyType = this.GUI.Panels.Search.items.propType.getValue(); this.Params.priceMin = this.GUI.Panels.Search.items.priceMin.getValue(); this.Params.priceMax = this.GUI.Panels.Search.items.priceMax.getValue(); this.Params.beds = this.GUI.Panels.Search.items.beds.getValue(); this.Params.baths = this.GUI.Panels.Search.items.baths.getValue(); this.Params.sqftMin = this.GUI.Panels.Search.items.minSQFT.getValue().replace(',', '').replace("'", '').replace('"', ''); this.Params.sqftMax = this.GUI.Panels.Search.items.maxSQFT.getValue().replace(',', '').replace("'", '').replace('"', ''); this.Params.mls = this.GUI.Panels.Search.items.MLS.getValue(); this.Params.limit = this.GUI.Panels.Search.items.limit.getValue(); this.Params.order = this.GUI.Panels.Search.items.sort.getValue(); if(this.GUI.Panels.Search.searchOptionsWindow.created){ //this.GUI.Panels.Search.getSearchOptionItems(); this.Params.owner_only = this.GUI.Panels.Search.items.owner_only.checked == true ? 1 : ''; this.Params.New_Property = this.GUI.Panels.Search.items.New_Property.checked == true ? 30 : ''; this.Params.WithPics = this.GUI.Panels.Search.items.WithPics.checked == true ? 1 : ''; this.Params.Virtual_Tour = this.GUI.Panels.Search.items.Virtual_Tour.checked == true ? 1 : ''; this.Params.video = this.GUI.Panels.Search.items.video.checked == true ? 1 : ''; } this.Params.wkt = null; var polygons = MapSearch.GUI.Base.I().Tools.PanPoly.Polygons; polygons.each(function(iter){ var temp = new Array(); for(var i = 0; i 0) { this.GUI.Status.setMapStatus(MapSearch.Config.GUI.MSGs.MapPlotting); body.property.each(function(prop){ var prop = this.Results.createProperty(prop); }.bind(this)); this.Results.displayIcons(); this.Results.displayList(); $$('#SearchResultsTabAreaResults div.MapSearchSearchResult').each(function(iter){ Event.observe(iter, 'mouseover', this.resultMouseOver.bindAsEventListener(this)); }.bind(this)); $$('#SearchResultsTabAreaResults div.MapSearchSearchResult>table').each(function(iter){ Event.observe(iter, 'mouseover', this.resultMouseOverTable.bindAsEventListener(this)); }.bind(this)); if(this.Params.offset == 0){ this.GUI.Panels.Search.items.page.innerHTML = '1'; } else { var page = this.Params.offset/this.Params.limit + 1; this.GUI.Panels.Search.items.page.innerHTML = page; } } else { this.GUI.Panels.Search.items.page.innerHTML = '0'; } if (this.Params.mls != ''){ try{ var bounds = new GLatLngBounds(); this.Results.each(function(iter){ bounds.extend(iter.point.getObject()); }.bind(this)); MapSearch.Map.I().map.setZoom(MapSearch.Map.I().map.getBoundsZoomLevel(bounds)); MapSearch.Map.I().map.setCenter(bounds.getCenter()); } catch(e){ } } this.GUI.Status.toggleMapStatus(false); }, searchFail: function(response, json){ this.GUI.Status.postSearchResults(0); this.Results.clear(); this.GUI.Panels.Search.items.page.innerHTML = '0'; this.GUI.Status.toggleMapStatus(false); }, resultMouseOver: function(pEvent){ var element = Event.element(pEvent); try{ var pid = element.attributes['pid'].nodeValue; var property = this.Results.find(function(prop){if(prop.details.pid == pid){return true;}}); if(property){property.pushpin.showWindow();} } catch(e){} }, resultMouseOverTable: function(pEvent){ var element = Event.element(pEvent).parentNode; try{ var pid = element.attributes['pid'].nodeValue; var property = this.Results.find(function(prop){if(prop.details.pid == pid){return true;}}); if(property){property.pushpin.showWindow();} } catch(e){} } }); MapSearch.Search.Favorites = Class.create({ initialize: function(){ this.Results = new MapSearch.Property.Collection(MapSearch.Property.Types.Favorites); this.request(); }, request: function(){ var options = { method: 'post', parameters: {}, onSuccess: function(response, json){this.searchSuccess(response, json);}.bind(this), onFailure: function(response, json){this.searchFail(response, json);}.bind(this) }; var myAjax = new Ajax.Request('/map_search/favorites/', options); }, searchSuccess: function(response, json){ try{ var body = response.responseText.evalJSON(); if(body.property != null){ this.Results.clear(); body.property.each(function(prop){ var prop = this.Results.createProperty(prop); }.bind(this)); this.Results.displayIcons(); this.Results.displayList(); $$('#FavoritesTabArea div.MapSearchSearchResult').each(function(iter){ Event.observe(iter, 'mouseover', this.resultMouseOver.bindAsEventListener(this)); }.bind(this)); } } catch(e){} setTimeout(function(){this.request();}.bind(this), 17000); }, searchFail: function(response, json){ this.Results.clear(); setTimeout(function(){this.request();}.bind(this), 17000); }, resultMouseOver: function(pEvent){ var element = Event.element(pEvent); try{ var pid = element.attributes['pid'].nodeValue; var property = this.Results.find(function(prop){if(prop.details.pid == pid){return true;}}); if(property){property.pushpin.showWindow();} } catch(e){} } }); MapSearch.Search.Favorites.Instance = null; MapSearch.Search.Favorites.I = function(){ if (MapSearch.Search.Favorites.instance == null){MapSearch.Search.Favorites.instance = new MapSearch.Search.Favorites();} return MapSearch.Search.Favorites.instance; } MapSearch.Search.RecentViewed = Class.create({ initialize: function(){ this.Results = new MapSearch.Property.Collection(MapSearch.Property.Types.Viewed); this.request(); }, request: function(){ var options = { method: 'post', parameters: {}, onSuccess: function(response, json){this.searchSuccess(response, json);}.bind(this), onFailure: function(response, json){this.searchFail(response, json);}.bind(this) }; var myAjax = new Ajax.Request('/map_search/recentlyViewed/', options); }, searchSuccess: function(response, json){ try{ var body = response.responseText.evalJSON(); if(body.property != null){ this.Results.clear(); body.property.each(function(prop){ var prop = this.Results.createProperty(prop); }.bind(this)); this.Results.displayIcons(); this.Results.displayList(); $$('#RecentlyViewedTabArea div.MapSearchSearchResult').each(function(iter){ Event.observe(iter, 'mouseover', this.resultMouseOver.bindAsEventListener(this)); }.bind(this)); } } catch(e){} setTimeout(function(){this.request();}.bind(this), 15000); }, searchFail: function(response, json){ this.Results.clear(); setTimeout(function(){this.request();}.bind(this), 15000); }, resultMouseOver: function(pEvent){ var element = Event.element(pEvent); try{ var pid = element.attributes['pid'].nodeValue; var property = this.Results.find(function(prop){if(prop.details.pid == pid){return true;}}); if(property){property.pushpin.showWindow();} } catch(e){} } }); MapSearch.Search.RecentViewed.Instance = null; MapSearch.Search.RecentViewed.I = function(){ if (MapSearch.Search.RecentViewed.instance == null){MapSearch.Search.RecentViewed.instance = new MapSearch.Search.RecentViewed();} return MapSearch.Search.RecentViewed.instance; }/** * Manages a Collection of Property Objs * * Used for Paging and Sorting * * @author Nick Verbeck * @since 6/4/2008 */ MapSearch.Property = {} MapSearch.Property.Types = {} MapSearch.Property.Types.Results = 1; MapSearch.Property.Types.Favorites = 2; MapSearch.Property.Types.Viewed = 3; MapSearch.Property.Collection = Class.create(Enumerable, { initialize: function(type){ this.properties = new Array(); this.length = 0; this.cursor = 0; this.type = type; }, concat: function(properties){ this.properties = this.properties.concat(properties); this.length = this.properties.length; }, append: function(property){ this.properties[this.properties.length] = property; this.length = this.properties.length; }, clear: function(){ this.properties.each(function(iter){iter.del();}); this.properties = new Array(); this.length = 0; this.cursor = 0; }, _each: function(iterator){ this.properties.each(iterator); }, createProperty: function(data){ var property = new MapSearch.Property.Property(data, this.type) if (property.details.LatLong.Latitude != 0 && property.details.LatLong.Longitude != 0) { property.propertyNumber = this.properties.length + 1; this.append(property); return property; } }, displayIcons: function(){ this.properties.each(function(iter){ iter.getPushpin().add(); }); }, hideIcons: function(){ this.properties.each(function(iter){ iter.getPushpin().hide(); }); }, displayList: function(){ var html = new StringBuilder(); this.properties.each(function(iter){ try{ html.append(iter.getListHTML()); } catch(e){} }); try{ var index = 0; if(this.type == MapSearch.Property.Types.Results){ index = 0; } else if (this.type == MapSearch.Property.Types.Favorites){ index = 1; } else if (this.type == MapSearch.Property.Types.Viewed){ index = 2; } MapSearch.GUI.Base.I().Panels.Search.accordians.items[index].setHTML(html.toString()); } catch(e){ console.debug(e); } } }); /** * Represents a property * * Used for a Generic Representation of a Property * * @author Nick Verbeck * @since 6/4/2008 */ MapSearch.Property.Property = Class.create({ initialize: function(details, type){ this.propertyNumber = null; this.pushpin = null; this.point = null; this.type = type; this.isCompanyProperty = false; this.details = { pid: null, mls: null, ds: null, ds_raw: null, office: null, listing: { officeName: null, agentName: null }, address: { street: { number: null, direction: null, name: null, type: null }, unit_no: null, city: null, state: null, zip: null }, LatLong: { Latitude: null, Longitude: null }, date: { added: null, updated: null }, info: { beds: 0, baths: 0, baths_full: 0, baths_half: 0, baths_test: 0, price: 0, style: '', sqft: 0, photo_count: 0, photo: null }, generalInfo: { openhouse: null }, remarks: null } Object.extend(this.details, details || {}); if(this.details.info.beds == null){ this.details.info.beds = 0; } if(this.details.info.baths == null){ this.details.info.baths = 0; } if(this.details.listing.officeName == null){ this.details.listing.officeName = ''; } if(this.details.listing.agentName == null){ this.details.listing.agentName = ''; } try { if(this.details.date.added != null){ this.details.date.added = String(this.details.date.added).toDate('yyyy-mm-dd hh:ii:ss'); } } catch(e){MapSearch.Console.error(e);} try { if(this.details.date.updated != null){ this.details.date.updated = String(this.details.date.updated).toDate('yyyy-mm-dd hh:ii:ss'); } } catch(e){MapSearch.Console.error(e);} var codes = MapSearch.Office.Collection.I().getOfficeCodes(); if(codes.indexOf(this.details.office) != -1 ){ this.isCompanyProperty = true; switch(this.type){ case MapSearch.Property.Types.Results: if(this.details.generalInfo == 'true'){ this.iconSet = MapSearch.Config.Icons.Base.myOpenHouse; } else if(this.details.date.added >= MapSearch.Config.Dates.propAdded) { this.iconSet = MapSearch.Config.Icons.Base.myNewProp; } else if(this.details.date.added >= MapSearch.Config.Dates.propUpdated) { this.iconSet = MapSearch.Config.Icons.Base.myUpdatedProp; } else { this.iconSet = MapSearch.Config.Icons.Base.myOldProp; } break; case MapSearch.Property.Types.Favorites: this.iconSet = MapSearch.Config.Icons.Base.favorites; break; case MapSearch.Property.Types.Viewed: this.iconSet = MapSearch.Config.Icons.Base.viewed; break; } } else { switch(this.type){ case MapSearch.Property.Types.Results: if(this.details.generalInfo == 'true'){ this.iconSet = MapSearch.Config.Icons.Base.openHouse; } else if(this.details.date.added >= MapSearch.Config.Dates.propAdded) { this.iconSet = MapSearch.Config.Icons.Base.newProp; } else if(this.details.date.added >= MapSearch.Config.Dates.propUpdated) { this.iconSet = MapSearch.Config.Icons.Base.updatedProp; } else { this.iconSet = MapSearch.Config.Icons.Base.oldProp; } break; case MapSearch.Property.Types.Favorites: this.iconSet = MapSearch.Config.Icons.Base.favorites; break; case MapSearch.Property.Types.Viewed: this.iconSet = MapSearch.Config.Icons.Base.viewed; break; } } }, /** * Returns a Well Formated Street Address * * @since 6/6/2008 * @author Nick Verbeck */ getStreetAddress: function(){ var street = (this.details.address.street.number != null ? this.details.address.street.number : ''); if(this.details.address.street.direction != '' && this.details.address.street.direction != null) street += " "+ this.details.address.street.direction; street += " "+ (this.details.address.street.name != null ? this.details.address.street.name : '') +" "+ (this.details.address.street.type != null ? this.details.address.street.type : ''); if(this.details.address.unit_number != '' && this.details.address.unit_number != null) street += " #"+ this.details.address.unit_number; street = street.toProperCase(); return street; }, getStreetAddres: function(){ return this.getStreetAddress(); }, /** * Returns a Full Street Address * * @since 6/6/2008 * @author Nick Verbeck */ getAddress: function(){ var address = this.getStreetAddres() +' '+ this.getCityState(); return address; }, getCityState: function(){ var address = (this.details.address.city != null ? this.details.address.city : ''); address += (this.details.address.state != null && this.details.address.city ? ', ' : ''); address += (this.details.address.state != null ? this.details.address.state : ''); return address; }, calcDays: function(){ if(this.details.date.added != null){ try{ var today = new Date(); var diff = today.getTime() - this.details.date.added.getTime(); var days = Math.ceil(diff/(1000*60*60*24)); return days; } catch(e){ return 0; } } else { return 0; } }, getPushpinHTML: function(){ var tab1Vals = { image: this.details.info.photo ? this.details.info.photo + "&maxheight=110&maxwidth=150" : "http://photos.enterprise.activewebsite.com/get_photo.php?id="+this.details.mls+"&ds="+this.details.ds+"&maxheight=110&maxwidth=150", photocount:this.details.info.photo_count, price:this.details.info.price, beds:this.details.info.beds ? this.details.info.beds : 0, baths:this.details.info.baths ? this.details.info.baths : 0, sqft:this.details.info.sqft, streetAddress: this.getStreetAddres(), cityState: this.getCityState(), days: this.calcDays(), pid: this.details.pid, property_id: this.details.mls, office_name: this.details.listing.officeName.toProperCase(), agent_name: this.details.listing.agentName.toProperCase() } if(this.isCompanyProperty){ switch(this.type){ case MapSearch.Property.Types.Favorites: var tab1 = MapSearch.Template.Bubble.Client.Favorite.evaluate(tab1Vals); break; case MapSearch.Property.Types.Results: var tab1 = MapSearch.Template.Bubble.Client.Result.evaluate(tab1Vals); break; default: var tab1 = MapSearch.Template.Bubble.Client.Result.evaluate(tab1Vals); break; } } else { switch(this.type){ case MapSearch.Property.Types.Favorites: var tab1 = MapSearch.Template.Bubble.Generic.Favorite.evaluate(tab1Vals); break; case MapSearch.Property.Types.Results: var tab1 = MapSearch.Template.Bubble.Generic.Result.evaluate(tab1Vals); break; default: var tab1 = MapSearch.Template.Bubble.Generic.Result.evaluate(tab1Vals); break; } } tab1 = MapSearch.Template.Bubble.Base.evaluate({content:tab1, price:this.details.info.price,streetAddress: this.getStreetAddres(), pid: this.details.pid}); tab2 = MapSearch.Template.Bubble.Base.evaluate({content:MapSearch.Template.Bubble.Remarks.evaluate({remarks:this.details.remarks}), price:this.details.info.price,streetAddress: this.getStreetAddres(), pid: this.details.pid}); var tab3Vals = { pid: this.details.pid, zipcode:this.details.address.zip, lat:this.details.LatLong.Latitude, lng:this.details.LatLong.Longitude, fullStreetAddress: this.getAddress() } tab3 = MapSearch.Template.Bubble.Base.evaluate({content:MapSearch.Template.Bubble.Links.evaluate(tab3Vals), price:this.details.info.price,streetAddress: this.getStreetAddres(), pid: this.details.pid}); return new Array(new GInfoWindowTab('Details', tab1), new GInfoWindowTab('Remarks', tab2), new GInfoWindowTab('Links', tab3)); }, getListHTML: function(){ var vals = { icon: this.iconSet.result, number: this.propertyNumber, street: this.getStreetAddres(), cityState: this.getCityState(), zip: this.details.address.zip, pid: this.details.pid, idx_logo: '' } if(MapSearch.Config.IDX[this.details.ds_raw] != undefined && MapSearch.Config.IDX[this.details.ds_raw] != null){ vals.idx_logo = MapSearch.Config.IDX[this.details.ds_raw]; } if(this.isCompanyProperty){ switch(this.type){ case MapSearch.Property.Types.Favorites: var html = MapSearch.Template.Accordian.Favorite.Client.evaluate(vals); break; case MapSearch.Property.Types.Results: var html = MapSearch.Template.Accordian.Search.Client.evaluate(vals); break; default: var html = MapSearch.Template.Accordian.Search.Client.evaluate(vals); break; } } else { switch(this.type){ case MapSearch.Property.Types.Favorites: var html = MapSearch.Template.Accordian.Favorite.Generic.evaluate(vals); break; case MapSearch.Property.Types.Results: var html = MapSearch.Template.Accordian.Search.Generic.evaluate(vals); break; default: var html = MapSearch.Template.Accordian.Search.Generic.evaluate(vals); break; } } return html; }, getPushpin: function(){ if(this.pushpin == null){ var html = this.getPushpinHTML(); //html = new Array(new GInfoWindowTab('Desc', html), new GInfoWindowTab('Test','Test Content')); this.point = new MapSearch.Map.LatLong(this.details.LatLong.Latitude, this.details.LatLong.Longitude); this.pushpin = MapSearch.Map.I().createPushpin(this.point.getObject(), html, this.iconSet); } return this.pushpin; }, del: function(){ if(this.pushpin != null){ this.pushpin.del(); } //TODO: Remove from List View } }); /** * @author nick */ MapSearch.Base = Class.create(); MapSearch.Base.Instance = null; MapSearch.Base.I = function(){ if (MapSearch.Base.instance == null){ MapSearch.Base.instance = new MapSearch.Base(); } return MapSearch.Base.instance; } MapSearch.Base.prototype = { initialize: function() { MapSearch.Map.InitilizeCallback = function(){this.mapLoaded();}.bind(this) this.GUI = MapSearch.GUI.Base.I(); this.Map = MapSearch.Map.I(); this.isMapLoaded = false; }, mapLoaded: function(){ var icons = new Array(); MapSearch.Office.Collection.I().each( function(iter){ iter.getPushpin().add(); }.bind(this) ); this.isMapLoaded = true; MapSearch.Search.I(); }, addOffice: function(office){ MapSearch.Office.Collection.I().push(office); if(this.isMapLoaded){ office.getPushpin().add(); } }, setIconSet: function(set, icons){ Object.extend(MapSearch.Config.Icons.Base[set], icons); }, setPOIIconSet: function(set, icons){ Object.extend(MapSearch.Config.Icons.POI[set], icons); }, pushpinShowStreetview: function(lat,lng){ MapSearch.Map.Streetview.I().show(lat, lng); }, pushpinShowStats: function(zipcode){ MapSearch.GUI.Panels.Manager.I().changeItem(MapSearch.GUI.Base.I().Panels.Stats); MapSearch.GUI.Base.I().Panels.Stats.items.zipcode.value = zipcode; MapSearch.GUI.Base.I().Panels.Stats.search(); }, pushpinDrivingDirections: function(streetAddress){ var center = MapSearch.Map.I().getCenter(); var directionsWindow = window.open('/map_search/generic/directions/?action=directions&to='+ streetAddress +'&lat='+ center.lat() +'&lng='+ center.lng(), 'directionsWindow', 'width=850,height=650,resizable=1,scrollbars=0,toolbar=0,location=0,directories=0,status=0,menubar=0'); if(window.focus){ directionsWindow.focus(); } } }/** * @author nick */ MapSearch.GUI = { Theme: { Red: { Search: { active: '/images/system/map_search/Red_Search_Active.gif', inactive: '/images/system/map_search/Red_Search_Inactive.gif' }, POI: { active: '/images/system/map_search/Red_POI_Active.gif', inactive: '/images/system/map_search/Red_POI_Inactive.gif' }, Stats: { active: '/images/system/map_search/Red_Stats_Active.gif', inactive: '/images/system/map_search/Red_Stats_Inactive.gif' }, images: { searching: '/images/system/map_search/red_search.gif' } }, Blue: { Search: { active: '/images/system/map_search/Search_Active.gif', inactive: '/images/system/map_search/Search_Inactive.gif' }, POI: { active: '/images/system/map_search/POI_Active.gif', inactive: '/images/system/map_search/POI_Inactive.gif' }, Stats: { active: '/images/system/map_search/Stats_Active.gif', inactive: '/images/system/map_search/Stats_Inactive.gif' }, images: { searching: '/images/system/map_search/blue_search.gif' } }, Green: { Search: { active: '/images/system/map_search/Green_Search_Active.gif', inactive: '/images/system/map_search/Green_Search_Inactive.gif' }, POI: { active: '/images/system/map_search/Green_POI_Active.gif', inactive: '/images/system/map_search/Green_POI_Inactive.gif' }, Stats: { active: '/images/system/map_search/Green_Stats_Active.gif', inactive: '/images/system/map_search/Green_Stats_Inactive.gif' }, images: { searching: '/images/system/map_search/green_search.gif' } }, DarkGreen: { Search: { active: '/images/system/map_search/DarkGreen_Search_Active.gif', inactive: '/images/system/map_search/DarkGreen_Search_Inactive.gif' }, POI: { active: '/images/system/map_search/DarkGreen_POI_Active.gif', inactive: '/images/system/map_search/DarkGreen_POI_Inactive.gif' }, Stats: { active: '/images/system/map_search/DarkGreen_Stats_Active.gif', inactive: '/images/system/map_search/DarkGreen_Stats_Inactive.gif' }, images: { searching: '/images/system/map_search/DarkGreen_search.gif' } }, Teil: { Search: { active: '/images/system/map_search/Teil_Search_Active.gif', inactive: '/images/system/map_search/Teil_Search_Inactive.gif' }, POI: { active: '/images/system/map_search/Teil_POI_Active.gif', inactive: '/images/system/map_search/Teil_POI_Inactive.gif' }, Stats: { active: '/images/system/map_search/Teil_Stats_Active.gif', inactive: '/images/system/map_search/Teil_Stats_Inactive.gif' }, images: { searching: '/images/system/map_search/Teil_search.gif' } } } } /* * Base GUI */ MapSearch.GUI.Base = Class.create(); MapSearch.GUI.Base.Instance = null; MapSearch.GUI.Base.I = function(){ if(MapSearch.GUI.Base.Instance == null){MapSearch.GUI.Base.Instance = new MapSearch.GUI.Base();} return MapSearch.GUI.Base.Instance; } MapSearch.GUI.Base.prototype = { initialize: function() { this.Status = new MapSearch.GUI.Status(); this.Status.togglePageLoading(true); this.Status.setPageStatus(MapSearch.Config.GUI.MSGs.Loading); this.Panels = { Search: new MapSearch.GUI.Panels.Search(), POI: new MapSearch.GUI.Panels.POI(), Stats: new MapSearch.GUI.Panels.Stats() } this.Tools = { Legend: new MapSearch.GUI.Legend(), ShareSearch: null, Print: null, Help: null, PanPoly: null } Event.observe(window, 'load', this.onLoad.bindAsEventListener(this)); }, onLoad: function(pEvent){ this.Status.setPageStatus(MapSearch.Config.GUI.MSGs.BindingInterface); //Status Loads this.Status.onLoad(pEvent); //Panel Loads this.Panels.Search.onLoad(pEvent); this.Panels.POI.onLoad(pEvent); this.Panels.Stats.onLoad(pEvent); this.Status.togglePageLoading(false); //Tool Loads //this.Tools.Legend = $('Legend'); //this.Tools.ShareSearch = $('SendViaEmail'); this.Tools.Print = $('Print'); this.Tools.Help = $('Help'); this.Tools.Legend.onLoad(pEvent); this.Tools.PanPoly = new MapSearch.GUI.ToolManager(); Event.observe(this.Tools.Help, 'click', this._helpClick.bindAsEventListener(this)); Event.observe(this.Tools.Print, 'click', this._print.bindAsEventListener(this)); }, _helpClick: function(pEvent){ url = '/help/map_search/'; var fullSearchWindow = window.open(url, 'HelpWindow', 'width=700,height=600,resizable=0,scrollbars=0,toolbar=0,location=0,directories=0,status=0,menubar=0'); if(window.focus){ fullSearchWindow.focus(); } }, _print: function(pEvent){ var printWindow = window.open('/map_search/generic/print/?action=print', 'printWindow', 'width=850,height=650,resizable=1,scrollbars=0,toolbar=0,location=0,directories=0,status=0,menubar=0'); if(window.focus){ printWindow.focus(); } } } /* * Legend */ MapSearch.GUI.Legend = Class.create({ initialize: function(){ this.tool = null; this.window = null; }, onLoad: function(pEvent){ this.tool = $('Legend'); this.window = new MapSearch.GUI.Window.Window('Legend'); var html = ''; $H(MapSearch.Config.Icons.Base).each(function(iter){ var icon = iter.value.result; var name = iter.value.name.evaluate({company:MapSearch.Config.Company}); html += ''; }); html += ''; $H(MapSearch.Config.Icons.POI).each(function(iter){ var icon = iter.value.mid.icon; var name = iter.value.name; html += ''; }); html += '
Property Icons
'+ name +'
 
POI Icons
'+ name +'
' this.window.setHTML(html); Event.observe(this.tool, 'click', this.click.bindAsEventListener(this)); }, click: function(pEvent){ this.window.showCenter(); } }); /* * Advanced Search */ MapSearch.GUI.AdvancedSearch = Class.create({ initialize: function(){ } }); /* * Tool Manager */ MapSearch.GUI.ToolManager = Class.create({ initialize: function(){ MapSearch.Map.I().regEventCallback('rightClick', function(event){this._rightClick(event);}.bind(this)); MapSearch.Map.I().regEventCallback('click', function(event){this._click(event);}.bind(this)); this.Polygons = new Array(); this.PolygonTool = $('PolygonTool'); this.ResetPolygonsTool = $('ResetPolygonsTool'); this.ResetSearchTool = $('ResetSearchTool'); this.PolygonStatus = false; this.CurrentPolygon = null; this.PolygonEventsEnd = null; this.PolygonEventsCancel = null; Event.observe(this.PolygonTool, 'click', this._togglePolygon.bindAsEventListener(this)); Event.observe(this.ResetPolygonsTool, 'click', this._resetPolygons.bindAsEventListener(this)); Event.observe(this.ResetSearchTool, 'click', this._resetSearch.bindAsEventListener(this)); this.PanMenu = new MapSearch.GUI.ContextMenu.Menu(); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Legend', function(pEvent){this._legend(pEvent);}.bind(this))); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Print', function(pEvent){this._print(pEvent);}.bind(this))); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Help', function(pEvent){this._help(pEvent);}.bind(this))); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Seperator()); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Search', function(pEvent){this._search(pEvent);}.bind(this))); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Seperator()); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Map', function(pEvent){this._map(pEvent);}.bind(this))); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Satellite', function(pEvent){this._sat(pEvent);}.bind(this))); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Satellite with Labels', function(pEvent){this._hybrid(pEvent);}.bind(this))); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Seperator()); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Toggle Streeview', function(pEvent){this._street(pEvent);}.bind(this))); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Seperator()); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Reset Search', function(pEvent){this._resetSearch(pEvent);}.bind(this))); this.PanMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Reset Polygons', function(pEvent){this._resetPolygons(pEvent);}.bind(this))); this.PolygonMenu = new MapSearch.GUI.ContextMenu.Menu(); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Edit', function(pEvent){this._editPolygon(pEvent);}.bind(this))); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Delete', function(pEvent){this._deletePolygon(pEvent);}.bind(this))); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Seperator()); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Legend', function(pEvent){this._legend(pEvent);}.bind(this))); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Print', function(pEvent){this._print(pEvent);}.bind(this))); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Help', function(pEvent){this._help(pEvent);}.bind(this))); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Seperator()); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Search', function(pEvent){this._search(pEvent);}.bind(this))); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Seperator()); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Map', function(pEvent){this._map(pEvent);}.bind(this))); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Satellite', function(pEvent){this._sat(pEvent);}.bind(this))); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Satellite with Labels', function(pEvent){this._hybrid(pEvent);}.bind(this))); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Seperator()); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Toggle Streeview', function(pEvent){this._street(pEvent);}.bind(this))); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Seperator()); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Reset Search', function(pEvent){this._resetSearch(pEvent);}.bind(this))); this.PolygonMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Reset Polygons', function(pEvent){this._resetPolygons(pEvent);}.bind(this))); this.PolygonEditMenu = new MapSearch.GUI.ContextMenu.Menu(); this.PolygonEditMenu.addItem(new MapSearch.GUI.ContextMenu.Item('Finish Polygon', function(pEvent){this._finishEditPolygon(pEvent);}.bind(this))); this.street = false; }, _rightClick: function(mEvent){ if (!mEvent.getMapElement() && !this.PolygonStatus) { this.PanMenu.show(mEvent.getMouseXY().x, mEvent.getMouseXY().y); } else if(!this.PolygonStatus) { try { mEvent.getMapElement().getVertexCount(); this.CurrentPolygon = mEvent.getMapElement(); this.PolygonMenu.show(mEvent.getMouseXY().x, mEvent.getMouseXY().y); } catch(e){} } else if(this.PolygonStatus){ this.PolygonEditMenu.show(mEvent.getMouseXY().x, mEvent.getMouseXY().y); } }, _click: function(mEvent){ MapSearch.GUI.ContextMenu.Manager.I().hideLast(); }, _legend: function(pEvent){ MapSearch.GUI.Base.I().Tools.Legend.click(); }, _print: function(pEvent){ //TODO: Print Context Menu }, _help: function(pEvent){ MapSearch.GUI.Base.I()._helpClick(pEvent); }, _search: function(pEvent){ MapSearch.Search.I().searchEvent(pEvent); }, _map: function(pEvent){ MapSearch.Map.I().setType(MapSearch.Map.I().Types.Normal); }, _sat: function(pEvent){ MapSearch.Map.I().setType(MapSearch.Map.I().Types.Sat); }, _hybrid: function(pEvent){ MapSearch.Map.I().setType(MapSearch.Map.I().Types.Hybrid); }, _street: function(pEvent){ if (this.street) { MapSearch.Map.I().toggleStreetview(false); this.street = false; } else { MapSearch.Map.I().toggleStreetview(true); this.street = true; } }, _togglePolygon: function(){ if(!this.PolygonStatus){ this.CurrentPolygon = new GPolygon([], '#ff0000', 3, 1, '#00ff00', 0.2); this.Polygons[this.Polygons.length] = this.CurrentPolygon; this.PolygonEventsEnd = GEvent.addListener(this.CurrentPolygon, 'endline', function(){this._polygonEnd();}.bind(this)); this.PolygonEventsCancel = GEvent.addListener(this.CurrentPolygon, 'cancelline', function(){this._polygonEndCancel();}.bind(this)); MapSearch.Map.I().map.addOverlay(this.CurrentPolygon); this.CurrentPolygon.enableDrawing(); this.PolygonStatus = true; this.PolygonTool.style.backgroundPosition = '-157px 0px'; } else { this.CurrentPolygon.disableEditing(); this._polygonEndCancel(); } }, _polygonEnd: function(){ GEvent.removeListener(this.PolygonEventsEnd); GEvent.removeListener(this.PolygonEventsCancel); this.CurrentPolygon = null; this.PolygonStatus = false; this.PolygonTool.style.backgroundPosition = '0px 0px'; }, _polygonEndCancel: function(){ var v1 = this.CurrentPolygon.getVertex(0); var v2 = this.CurrentPolygon.getVertex(this.CurrentPolygon.getVertexCount()-1); if (v1.lat() == v2.lat() && v1.lng() == v2.lng()) { }else { this.CurrentPolygon.insertVertex(this.CurrentPolygon.getVertexCount(), this.CurrentPolygon.getVertex(0)); } this._polygonEnd(); }, _editPolygon: function(pEvent){ this.PolygonTool.style.backgroundPosition = '-157px 0px'; this.PolygonEventsEnd = GEvent.addListener(this.CurrentPolygon, 'endline', function(){this._polygonEnd();}.bind(this)); this.PolygonEventsCancel = GEvent.addListener(this.CurrentPolygon, 'cancelline', function(){this._polygonEndCancel();}.bind(this)); this.CurrentPolygon.enableDrawing(); this.PolygonStatus = true; }, _deletePolygon: function(pEvent){ this.Polygons[this.Polygons.indexOf(this.CurrentPolygon)] = null; MapSearch.Map.I().map.removeOverlay(this.CurrentPolygon); this.Polygons = this.Polygons.compact(); this._polygonEnd(); }, _finishEditPolygon: function(pEvent){ this.CurrentPolygon.disableEditing(); this._polygonEndCancel(); }, _resetSearch: function(pEvent){ MapSearch.Search.I().Results.clear(); MapSearch.Search.I().Results.displayList(); MapSearch.GUI.Base.I().Panels.Search.items.page.innerHTML = '0'; MapSearch.GUI.Base.I().Status.postSearchResults(0) }, _resetPolygons: function(pEvent){ this.Polygons.each(function(polygon){ MapSearch.Map.I().map.removeOverlay(polygon); }.bind(this)); this.Polygons = new Array(); } }); /* * Status Display */ MapSearch.GUI.Status = Class.create({ initialize: function(){ this.pageLoad = { Screen:$('MapSearchLoadingInterface'), MSG:$('MapSearchPageLoadStatus') } this.search = { results: $('PropertyFoundInfo'), resultsCallback: Prototype.emptyFunction } this.map = { Screen: $('MapSearchSearchingMap'), MSG: $('MapSearchSearchingMapStatus') } }, onLoad: function(pEvent){ Event.observe(this.search.results, 'click', this.onClickSearchResults.bindAsEventListener(this)); }, togglePageLoading: function(toggle){ if(toggle){ this.pageLoad.Screen.style.display = 'block'; } else { this.pageLoad.Screen.style.display = 'none'; this.pageLoad.MSG.innerHTML = ''; } }, setPageStatus: function(Msg){ this.pageLoad.MSG.innerHTML = Msg; }, postSearchResults: function(total){ this.search.results.innerHTML = total +' Properties Found'; }, setSearchResultsCallback: function(callback){ this.search.resultsCallback = callback; }, toggleMapStatus: function(toggle){ if(toggle){ this.map.Screen.style.display = 'block'; } else { this.map.Screen.style.display = 'none'; this.map.MSG.innerHTML = ''; } }, setMapStatus: function(Msg){ this.map.MSG.innerHTML = Msg; }, /* * Events */ onClickSearchResults: function(pEvent){ this.search.results.innerHTML = 'Searching..'; this.search.resultsCallback(pEvent); } }); /* * Panels */ MapSearch.GUI.Panels = {} MapSearch.GUI.Panels.Manager = Class.create({ initialize: function(){ this.items = new Array(); this.currentItem = null; }, onLoad: function(pEvent){ this.items.each(function(iter){iter.onLoad(pEvent);}.bind(this)); }, changeItem: function(item){ if (item != this.currentItem) { this.items.each(function(iter){iter.tab.style.zIndex = 1;}); item.tab.style.zIndex = 3; this.currentItem.tab.style.zIndex = 2; if (this.currentItem != null) {this.currentItem.hide();} item.show(); this.currentItem = item; } }, addItem: function(item){ if(this.items.length < 1){this.currentItem = item;} this.items.push(item); } }); MapSearch.GUI.Panels.Manager.Instance = null; MapSearch.GUI.Panels.Manager.I = function(){ if(MapSearch.GUI.Panels.Manager.Instance == null){MapSearch.GUI.Panels.Manager.Instance = new MapSearch.GUI.Panels.Manager();} return MapSearch.GUI.Panels.Manager.Instance; } MapSearch.GUI.Panels.Base = Class.create({ initialize: function() { this.accordians = new MapSearch.GUI.Panels.Accordians.Manager(); this.items = {} this.tab = null; this.panel = null; this.sized = false; MapSearch.GUI.Panels.Manager.I().addItem(this); }, onLoad: function(pEvent){ Event.observe(this.tab, 'click', this.tabClickEvent.bindAsEventListener(this)); this.accordians.onLoad(pEvent); }, tabClickEvent: function(pEvent){ var x = pEvent.pointerX(); if(x <= 66){ MapSearch.GUI.Panels.Manager.I().changeItem(MapSearch.GUI.Base.I().Panels.Search); } else if(x <= 188){ MapSearch.GUI.Panels.Manager.I().changeItem(MapSearch.GUI.Base.I().Panels.POI); } else { MapSearch.GUI.Panels.Manager.I().changeItem(MapSearch.GUI.Base.I().Panels.Stats); } }, resizeAccordians: function(){ this.sized = true; }, hide: function(){ this.panel.style.display = 'none'; }, show: function(){ this.panel.style.display = ''; this.resizeAccordians(); } }); MapSearch.GUI.Panels.Search = Class.create(MapSearch.GUI.Panels.Base, { initialize: function($super) { $super(); this.tab = $('SearchTab'); this.panel = $('SearchTabArea'); this.isLoaded = false; this.loadedCallback = Prototype.emptyFunction; this.accordians.addItem(new MapSearch.GUI.Panels.Accordians.SearchResults(this.accordians, 'SearchResultsTab', 'SearchResultsTabArea')); //this.accordians.addItem(new MapSearch.GUI.Panels.Accordians.Base(this.accordians, 'SavedSearchesTab', 'SavedSearchesTabArea')); this.accordians.addItem(new MapSearch.GUI.Panels.Accordians.Base(this.accordians, 'FavoritesTab', 'FavoritesTabArea')); this.accordians.addItem(new MapSearch.GUI.Panels.Accordians.Base(this.accordians, 'RecentlyViewedTab', 'RecentlyViewedTabArea')); this.searchOptionsWindow = new MapSearch.GUI.Window.Window('Search Options'); this.searchOptionsWindow.setHTML(MapSearch.Template.Search.SearchOptions.evaluate({})); }, onLoad: function($super, pEvent){ $super(pEvent); this.resizeAccordians(); this.items.priceMin = $('MapSearchFieldPriceMin'); this.items.priceMax = $('MapSearchFieldPriceMax'); this.items.beds = $('MapSearchFieldBeds'); this.items.baths = $('MapSearchFieldBaths'); this.items.minSQFT = $('MapSearchFieldsqftMin'); this.items.maxSQFT = $('MapSearchFieldSqftMax'); this.items.MLS = $('MapSearchFieldMLS'); this.items.limit = $('MapSearchFieldLimit'); this.items.sort = $('MapSearchFieldSort'); this.items.propType = $('MapSearchFieldPropertyType'); //this.items.advancedSearch = $('MapSearchAdvancedSearch'); //this.items.listView = $('PropertyListView'); this.items.searchBtn = $('MapPropertySearchButton'); this.items.pagePrev = $('SearchResultsPrevPage'); this.items.pageNext = $('SearchResultsNextPage'); this.items.page = $('SearchResultsPage'); this.items.searchOptions = $('MapSearchAdvancedSearch'); MapSearch.Search.Favorites.I(); MapSearch.Search.RecentViewed.I(); this.isLoaded = true; this.loadedCallback(); Event.observe(this.items.searchOptions, 'click', function(pEvent){this.searchOptionsWindow.showCenter();}.bindAsEventListener(this)); this.searchOptionsWindow.show(); this.getSearchOptionItems(); this.searchOptionsWindow.hide(); }, getSearchOptionItems: function(){ this.items.owner_only = $('MapSearchFieldOwner'); this.items.New_Property = $('MapSearchFieldNewProp'); this.items.WithPics = $('MapSearchFieldWithPics'); this.items.Virtual_Tour = $('MapSearchFieldVT'); this.items.video = $('MapSearchFieldVideo'); }, loaded: function(callback){ if(this.isLoaded){ callback(); } else { this.loadedCallback = callback; } }, resizeAccordians: function($super){ if (!this.sized) { $super(); var main = $('MapControls'); var container = $('SearchTabArea'); var containers = $$('#SearchTabAreaAccordian div.TabAreaAccordianTabArea'); var mainContainer = $('SearchResultsTabArea'); var height = main.getHeight() - container.getHeight() + mainContainer.getHeight(); height -= 30; //Browser ajust for some reason unknone to me but whatever. containers.each(function(iter){iter.style.height = height + "px";}.bind(this)); var sort = $('SearchResultsTabAreaSort'); var page = $('SearchResultsTabAreaPage'); var area = $('SearchResultsTabAreaResults'); height = height - sort.getHeight() - page.getHeight(); area.style.height = height + 'px'; } }, hide: function($super){ $super(); this.tab.style.backgroundImage = "url("+ MapSearch.Config.GUI.Theme.Search.inactive +")"; }, show: function($super){ $super(); this.tab.style.backgroundImage = "url("+ MapSearch.Config.GUI.Theme.Search.active +")"; } }); MapSearch.GUI.Panels.POI = Class.create(MapSearch.GUI.Panels.Base, { initialize: function($super) { $super(); this.tab = $('POITab'); this.panel = $('POITabArea'); this.panel.style.display = 'none'; this.searches = new Array(); //this.accordians.addItem(new MapSearch.GUI.Panels.Accordians.Base(this.accordians, 'POITab', 'POITabAreaPOIItems')); //this.accordians.addItem(new MapSearch.GUI.Panels.Accordians.Base(this.accordians, 'POIResultsTab', 'POITabAreaPOIResults')); }, onLoad: function($super, pEvent){ $super(pEvent); this.items.term = $('POIFindField'); this.items.search = $('POIFindFieldSearchButton'); this.items.searching = $('POISearching'); this.items.searchingIMG = $('POISearchingImg'); this.items.searchingIMG.src = MapSearch.Config.GUI.Theme.images.searching; this.items.newSearch = $('POITabAreaMyPOIItems'); Event.observe(this.items.search, 'click', this.newSearch.bindAsEventListener(this)); var poiLI = $$('#POITabAreaPOIItems>ul li>ul li>input'); poiLI.each(function(iter){ Event.observe(iter, 'change', this.prevSearch.bindAsEventListener(this)); }.bind(this)); }, hide: function($super){ $super(); this.tab.style.backgroundImage = "url("+ MapSearch.Config.GUI.Theme.POI.inactive +")"; }, show: function($super){ $super(); this.tab.style.backgroundImage = "url("+ MapSearch.Config.GUI.Theme.POI.active +")"; }, resizeAccordians: function($super){ if (!this.sized) { $super(); var main = $('MapControlTabAreas'); var container = $('POITabArea'); var containers = $$('#POITabAreaAccordian div.TabAreaAccordianTabArea'); var mainContainer = $('POITabAreaPOIItems'); var height = main.getHeight() - container.getHeight() + mainContainer.getHeight(); containers.each(function(iter){iter.style.height = height + "px";}.bind(this)); } }, newSearch: function(pEvent){ if (this.items.term.getValue() != '' && this.items.term.getValue() != null) { MapSearch.Map.Search.I().search(this.items.term.getValue(), function(results){this.newSearchResults(results);}.bind(this)) } }, newSearchResults: function(results){ var id = results.term.replace(' ', '').replace('-', '').replace('\'', '').replace('&', ''); if (typeof(this.searches[id]) == 'undefined') { this.items.newSearch.innerHTML += '
  • '; var element = $(id); element.checked = true; Event.observe(element, 'change', this.prevSearch.bindAsEventListener(this)); var pushpins = new Array(); results.results.each(function(iter){ var point = new MapSearch.Map.LatLong(iter.lat, iter.lng); var html = MapSearch.Template.POI.Generic.evaluate({ title: iter.title, streetAddress: iter.streetAddress, cityState: iter.cityState, phone: iter.phones[0].number, lat: iter.lat, lng: iter.lng, url: iter.url }); var iconSet = MapSearch.Config.Icons.POI.mySearch; var pushpin = new MapSearch.Map.Pushpin.Google(point.getObject(), html, iconSet); pushpin.add(); pushpins[pushpins.length] = pushpin; }); this.searches[id] = pushpins; } else if(this.searches[id] == null || this.searches[id].length <= 0) { var element = $(id); element.checked = true; var pushpins = new Array(); results.results.each(function(iter){ var point = new MapSearch.Map.LatLong(iter.lat, iter.lng); var html = MapSearch.Template.POI.Generic.evaluate({ title: iter.title, streetAddress: iter.streetAddress, cityState: iter.cityState, phone: iter.phones[0].number, lat: iter.lat, lng: iter.lng, url: iter.url }); var iconSet = MapSearch.Config.Icons.POI.mySearch; var pushpin = new MapSearch.Map.Pushpin.Google(point.getObject(), html, iconSet); pushpin.add(); pushpins[pushpins.length] = pushpin; }); this.searches[id] = pushpins; } else if(this.searches[id].length > 0) { var element = $(id); element.checked = true; this.searches[id].each(function(iter){ iter.del(); }); var pushpins = new Array(); results.results.each(function(iter){ var point = new MapSearch.Map.LatLong(iter.lat, iter.lng); var html = MapSearch.Template.POI.Generic.evaluate({ title: iter.title, streetAddress: iter.streetAddress, cityState: iter.cityState, phone: iter.phones[0].number, lat: iter.lat, lng: iter.lng, url: iter.url }); var iconSet = MapSearch.Config.Icons.POI.mySearch; var pushpin = new MapSearch.Map.Pushpin.Google(point.getObject(), html, iconSet); pushpin.add(); pushpins[pushpins.length] = pushpin; }); this.searches[id] = pushpins; } }, prevSearch: function(pEvent){ var id = pEvent.element().id; if (typeof(this.searches[id]) == 'undefined' || this.searches[id] == null || this.searches[id].length <= 0) { pEvent.element().checked = true; MapSearch.Map.Search.I().search(pEvent.element().getValue(), function(results){this.prevSearchResponse(results);}.bind(this)) } else { this.searches[id].each(function(iter){ iter.del(); }); this.searches[id] = null; } }, prevSearchResponse: function(results){ var id = results.term.replace(' ', '').replace('-', '').replace('\'', '').replace('&', ''); var pushpins = new Array(); results.results.each(function(iter){ var point = new MapSearch.Map.LatLong(iter.lat, iter.lng); var html = MapSearch.Template.POI.Generic.evaluate({ title: iter.title, streetAddress: iter.streetAddress, cityState: iter.cityState, phone: iter.phones[0].number, lat: iter.lat, lng: iter.lng, url: iter.url }); var iconSet = this.getIconSet(id); var pushpin = new MapSearch.Map.Pushpin.Google(point.getObject(), html, iconSet); pushpin.add(); pushpins[pushpins.length] = pushpin; }.bind(this)); this.searches[id] = pushpins; }, getIconSet: function(id){ switch(id){ case 'Restaurants': var returnSet = MapSearch.Config.Icons.POI.restaurant; break; case 'Bars': var returnSet = MapSearch.Config.Icons.POI.bar; break; case 'Coffee': var returnSet = MapSearch.Config.Icons.POI.coffee; break; case 'HighSchools': case 'MiddleSchools': case 'Elementary': var returnSet = MapSearch.Config.Icons.POI.school; break; case 'GroceryStores': var returnSet = MapSearch.Config.Icons.POI.grocery; break; case 'DepartmentStores': var returnSet = MapSearch.Config.Icons.POI.department; break; case 'BookStores': var returnSet = MapSearch.Config.Icons.POI.bookStore; break; case 'DrugStores': var returnSet = MapSearch.Config.Icons.POI.drugStore; break; case 'WineLiquor': var returnSet = MapSearch.Config.Icons.POI.wine; break; case 'MovieTheaters': var returnSet = MapSearch.Config.Icons.POI.movie; break; case 'HealthClubs': var returnSet = MapSearch.Config.Icons.POI.health; break; case 'GolfCourses': var returnSet = MapSearch.Config.Icons.POI.golf; break; case 'SportsStadiums': var returnSet = MapSearch.Config.Icons.POI.arena; break; case 'Recreation': var returnSet = MapSearch.Config.Icons.POI.recreation; break; case 'TouristAttractions': var returnSet = MapSearch.Config.Icons.POI.tourist; break; case 'Hotel': var returnSet = MapSearch.Config.Icons.POI.hotel; break; case 'Clinics': var returnSet = MapSearch.Config.Icons.POI.clinic; break; case 'Hospitals': var returnSet = MapSearch.Config.Icons.POI.hospital; break; case 'PostOffice': var returnSet = MapSearch.Config.Icons.POI.postOffice; break; case 'PublicLibraries': var returnSet = MapSearch.Config.Icons.POI.library; break; case 'FireDepartments': var returnSet = MapSearch.Config.Icons.POI.fire; break; case 'PoliceDepartments': var returnSet = MapSearch.Config.Icons.POI.police; break; case 'Courts': var returnSet = MapSearch.Config.Icons.POI.courts; break; case 'Airports': var returnSet = MapSearch.Config.Icons.POI.airport; break; case 'Banks': var returnSet = MapSearch.Config.Icons.POI.bank; break; case 'Laundry': var returnSet = MapSearch.Config.Icons.POI.laundry; break; case 'PlacesofWorshipandChurch': var returnSet = MapSearch.Config.Icons.POI.worship; break; default: var returnSet = MapSearch.Config.Icons.POI.mySearch; } return returnSet; } }); MapSearch.GUI.Panels.Stats = Class.create(MapSearch.GUI.Panels.Base, { initialize: function($super) { $super(); this.tab = $('StatsTab'); this.panel = $('StatsTabArea'); this.panel.style.display = 'none'; this.accordians.addItem(new MapSearch.GUI.Panels.Accordians.Base(this.accordians, 'DemographicsTab', 'DemographicsTabAreaDemographicsItems')); }, onLoad: function($super, pEvent){ $super(pEvent); this.items.zipcode = $('StatsFindField'); this.items.search = $('StatsFindFieldSearchButton'); this.items.searching = $('StatsLoading'); this.items.searchingIMG = $('StatsLoadingImg'); this.items.searchingIMG.src = MapSearch.Config.GUI.Theme.images.searching; Event.observe(this.items.search, 'click', this.search.bindAsEventListener(this)); }, hide: function($super){ $super(); this.tab.style.backgroundImage = "url("+ MapSearch.Config.GUI.Theme.Stats.inactive +")"; }, show: function($super){ $super(); this.tab.style.backgroundImage = "url("+ MapSearch.Config.GUI.Theme.Stats.active +")"; }, resizeAccordians: function($super){ if (!this.sized) { $super(); var main = $('MapControlTabAreas'); var container = $('StatsTabArea'); var containers = $$('#StatsTabAreaAccordian div.TabAreaAccordianTabArea'); var mainContainer = $('DemographicsTabAreaDemographicsItems'); var height = main.getHeight() - container.getHeight() + mainContainer.getHeight(); containers.each(function(iter){iter.style.height = height + "px";}.bind(this)); } }, search: function(pEvent){ this.items.searching.style.display = ''; var options = { method: 'post', parameters: {zipcode:this.items.zipcode.getValue()}, onSuccess: function(response, json){this.searchSuccess(response, json);}.bind(this), onFailure: function(response, json){this.searchFail(response, json);}.bind(this) }; var myAjax = new Ajax.Request('/map_search/demographics/', options); }, searchSuccess: function(response, json){ var html = MapSearch.Template.Stats.Demo.evaluate(json); this.accordians.items[0].content.innerHTML = html; this.items.searching.style.display = 'none'; }, searchFail: function(response, json){ this.items.searching.style.display = 'none'; } }); /* * Panel Accordians */ MapSearch.GUI.Panels.Accordians = {} MapSearch.GUI.Panels.Accordians.Manager = Class.create({ initialize: function(){ this.items = new Array(); this.currentItem = null; }, onLoad: function(pEvent){ this.items.each(function(iter){iter.onLoad(pEvent);}.bind(this)); }, changeItem: function(item){ if (item != this.currentItem) { if (this.currentItem != null) {this.currentItem.collapse();} item.expand(); this.currentItem = item; } }, addItem: function(item){ if(this.items.length < 1){this.currentItem = item;} this.items.push(item); } }); MapSearch.GUI.Panels.Accordians.Base = Class.create({ initialize: function(manager, tab, content){ this.manager = manager; this.tab = $(tab); this.content = $(content); }, onLoad: function(pEvent){ Event.observe(this.tab, 'click', this.toggleDisplay.bindAsEventListener(this)); }, toggleDisplay: function(pEvent){ MapSearch.Console.info({msg: 'Changing Accordian', event:pEvent}); this.manager.changeItem(this); }, expand: function(){ this.content.style.display = ''; }, collapse: function(){ this.content.style.display = 'none'; }, setHTML: function(html){ this.content.innerHTML = html; } }); MapSearch.GUI.Panels.Accordians.SearchResults = Class.create(MapSearch.GUI.Panels.Accordians.Base, { initialize: function($super, manager, tab, content){ $super(manager, tab, content); this.contentExpanded = $('SearchResultsTabAreaResults'); }, onLoad: function($super, pEvent){ $super(pEvent); }, setHTML: function(html){ this.contentExpanded.innerHTML = html; } });MapSearch.GUI.ContextMenu = {} MapSearch.GUI.ContextMenu.Manager = Class.create({ initialize: function(){ this.menus = new Array(); this.currentMenu = null; }, addMenu: function(menu){ this.menus[this.menus.length] = menu; menu.setID('Menu'+this.menus.length); }, displayMenu: function(menu){ if(this.currentMenu != null && this.currentMenu != menu){ this.currentMenu._hide(); } menu._show(); this.currentMenu = menu; }, hideLast: function(){ if(this.currentMenu != null){ this.currentMenu._hide(); this.currentMenu = null; } } }); MapSearch.GUI.ContextMenu.Manager.Instance = null; MapSearch.GUI.ContextMenu.Manager.I = function(){ if(MapSearch.GUI.ContextMenu.Manager.Instance == null){MapSearch.GUI.ContextMenu.Manager.Instance = new MapSearch.GUI.ContextMenu.Manager();} return MapSearch.GUI.ContextMenu.Manager.Instance; } MapSearch.GUI.ContextMenu.Menu = Class.create({ initialize: function(){ this.created = false; this.items = new Array(); this.menu = null; this.id = null; MapSearch.GUI.ContextMenu.Manager.I().addMenu(this); }, setID: function(id){ this.id = id; }, addItem: function(item){ this.items[this.items.length] = item; item.setID(this.id+'Item'+this.items.length); }, _hide: function(){ this.menu.style.display = 'none'; }, _show: function(){ this.menu.style.display = ''; }, show: function(x, y){ if(!this.created){ this.create(); } this.menu.style.top = y+'px'; this.menu.style.left = x+'px'; this.menu.style.zIndex = 1001; var dim = $(document.body).getDimensions(); var menuDim = this.menu.getDimensions(); if (dim.height < (menuDim.height+y)){ var mod = (menuDim.height+y) - dim.height + 5; this.menu.style.top = (y-mod)+'px'; } else if (dim.height == (menuDim.height+y)){ this.menu.style.top = (y-5)+'px'; } if (dim.width < (menuDim.width+x)){ var mod = (menuDim.width+x) - dim.width + 5; this.menu.style.left = (x-mod)+'px'; } else if (dim.width == (menuDim.width+x)){ this.menu.style.left = (y-5)+'px'; } MapSearch.GUI.ContextMenu.Manager.I().displayMenu(this); }, hide: function(){ MapSearch.GUI.ContextMenu.Manager.I().currentMenu = null; this._hide(); }, create: function(){ var html = '
    '; html += ''+ ' '+ ' '+ ' '+ ' '+ ' '; html += '
      ' this.items.each(function(iter){ if(iter.isSeperator){ html += '
     
      '; } else { html += '
    • '+ iter.title +'
    • '; } }); html += '
    '; html += ''+ ' '+ ' '+ ' '+ ' '+ ' '; html += '
    '; var wrapper = new Element('div'); wrapper.innerHTML = html; document.body.appendChild(wrapper.down()); this.menu = $(this.id); this.items.each(function(iter){iter.buildEvents()}); Event.observe(this.menu, 'click', this._click.bindAsEventListener(this)) this.created = true; }, _click: function(pEvent){ MapSearch.GUI.ContextMenu.Manager.I().hideLast(); } }); MapSearch.GUI.ContextMenu.Item = Class.create({ initialize: function(title, callback){ this.isSeperator = false; this.title = title; this.callback = callback; this.id = null; }, setID: function(id){ this.id = id; }, buildEvents: function(){ Event.observe($(this.id), 'click', this._click.bindAsEventListener(this)); }, _click: function(pEvent){ this.callback(pEvent); } }); MapSearch.GUI.ContextMenu.Seperator = Class.create({initialize: function(){this.isSeperator = true;}, buildEvents: function(){}, setID: function(){}});MapSearch.GUI.Window={} MapSearch.GUI.Window.Manager = Class.create({ initialize: function(){ this.windows = new Array(); }, addWindow: function(window){ this.windows[this.windows.length] = window; return 'Window'+ this.windows.length; } }); MapSearch.GUI.Window.Manager.Instance = null; MapSearch.GUI.Window.Manager.I = function(){ if(MapSearch.GUI.Window.Manager.Instance == null){MapSearch.GUI.Window.Manager.Instance = new MapSearch.GUI.Window.Manager();} return MapSearch.GUI.Window.Manager.Instance; } MapSearch.GUI.Window.Window = Class.create({ initialize: function(title){ this.title = title; this.html = null; this.htmlChanged = false; this.window = null; this.windowContent = null; this.closeButton = null; this.titleBar = null; this.created = false; this.isDragging = false; this.mousePOS = {x:0,y:0}; this.hideCallback = Prototype.emptyFunction; this.id = MapSearch.GUI.Window.Manager.I().addWindow(this); }, create: function(){ var html = ''+ '
    '+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ '
    '+ ' '+ this.title + '
    '+ '
    '+ this.html + '
    '+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ '
    '; var wrapper = new Element('div'); wrapper.innerHTML = html; document.body.appendChild(wrapper.down()); this.window = $(this.id); this.windowContent = $(this.id+'Content'); this.closeButton = $(this.id+'Close'); this.titleBar = $(this.id+'Title'); Event.observe(this.closeButton, 'click', this._closeClick.bindAsEventListener(this)); Event.observe(document, 'mouseover', this._mouseMove.bindAsEventListener(this)); Event.observe(this.titleBar, 'mousedown', this._mouseDown.bindAsEventListener(this)); Event.observe(document, 'mouseup', this._mouseUp.bindAsEventListener(this)); this.created = true; }, setHTML: function(html){ this.html = html; this.htmlChange = true; }, setDim: function(width, height){ if(!this.created){ this.create(); } this.window.style.width = (width+12)+'px'; this.windowContent.style.height = height+'px'; this.windowContent.style.width = width+'px'; this.windowContent.style.maxHeight = height+'px'; this.windowContent.style.maxWidth = width+'px'; }, setHideCallback: function(callback){ this.hideCallback = callback; }, show: function(){ if(!this.created){ this.create(); } if(this.htmlChanged){ this.windowContent.innerHTML = this.html; this.htmlChanged = false; } this.window.style.display = ''; }, showCenter: function(){ this.show(); var dim = $(document.body).getDimensions(); var wDim = this.window.getDimensions(); var top = (dim.height/2) - (wDim.height/2); var left = (dim.width/2) - (wDim.width/2); this.window.style.top = top+'px'; this.window.style.left = left+'px'; }, hide: function(){ this.hideCallback(); this.window.style.display = 'none'; }, _closeClick: function(pEvent){ this.hide(); }, _mouseMove: function(pEvent){ if(this.isDragging){ var top = (Event.pointerY(pEvent) - this.mousePOS.y); var left = (Event.pointerX(pEvent) - this.mousePOS.x); this.window.style.top = top +'px'; this.window.style.left = left +'px'; } }, _mouseDown: function(pEvent){ this.isDragging = true; //this.windowContent.innerHTML = ''; var x = Event.pointerX(pEvent); var y = Event.pointerY(pEvent); var wX = this.window.offsetLeft; var wY = this.window.offsetTop; this.mousePOS = {x:(x-wX), y:(y-wY)}; }, _mouseUp: function(pEvent){ this.isDragging = false; //this.windowContent.innerHTML = this.html; } });/** * @author nick */ MapSearch.Map = {} MapSearch.Map.Instance = null; MapSearch.Map.Type = 'Google'; MapSearch.Map.InitilizeCallback = Prototype.emptyFunction; MapSearch.Map.I = function(){ if(MapSearch.Map.Instance == null){ if(MapSearch.Map.Type == 'Google'){ MapSearch.Map.Instance = new MapSearch.Map.Google(); } } return MapSearch.Map.Instance; } MapSearch.Map.LatLong = Class.create({ initialize: function(Lat, Long){ this.Lat = Lat; this.Long = Long; this.object = null }, getObject: function(){ if(this.object == null){ if(MapSearch.Map.Type == 'Google'){ this.object = new google.maps.LatLng(this.Lat, this.Long); } } return this.object; } }); MapSearch.Map.Event = Class.create({ initialize: function(){ this.MapElement = false; this.LatLong = false; this.mousePOS = {x:0,y:0} }, getLatLong: function(){ return this.LatLong; }, getMapElement: function(){ return this.MapElement; }, getMouseXY: function(){ return this.mousePOS; }, setLatLong: function(LatLong){ this.LatLong = new MapSearch.Map.LatLong(LatLong.lat(), LatLong.lng()); }, setMouseXY: function(mXY){ this.mousePOS.x = mXY.x; this.mousePOS.y = mXY.y; }, setMapElement: function(){ var el = arguments[0]; this.MapElement = el; try { el.getIcon(); this.MapElement = el; } catch(e){ try{ el.getVertexCount(); this.MapElement = el; } catch(e){ this.MapElement = false; } } } }); MapSearch.Map.Base = Class.create({ Types:{ Normal: null, Sat: null, Hybrid: null }, initialize: function() { this.GUI = MapSearch.GUI.Base.I(); this.GUI.Status.toggleMapStatus(true); this.GUI.Status.setMapStatus(MapSearch.Config.GUI.MSGs.MapLoading); this.map = null; this.mapContainer = $('SearchMap'); MapSearch.Config.Map.defaultLocation = new MapSearch.Map.LatLong(MapSearch.Config.Map.defaultLatLong.Lat,MapSearch.Config.Map.defaultLatLong.Long); this.events = { rightClick: new Array(), click: new Array() } }, regEventCallback: function(event, callback){ this.events[event][this.events[event].length] = callback; } }); MapSearch.Map.Google = Class.create(MapSearch.Map.Base, { initialize: function($super) { $super(); //google.load("maps", "2", {'other_params': 'client=gme-activewebsite'}); //google.load("search", "1", {'other_params': 'client=gme-activewebsite'}); google.load("maps", "2"); google.load("search", "1"); google.setOnLoadCallback(function(){this.mapInitialize();}.bind(this)); Event.observe(window, 'unload', this.unLoadMap.bindAsEventListener(this)); }, mapInitialize: function(){ if (GBrowserIsCompatible()) { this.GUI.Status.setMapStatus(MapSearch.Config.GUI.MSGs.MapInit); this.map = new google.maps.Map2(this.mapContainer); this.setCenter(MapSearch.Config.Map.defaultLocation.getObject(), MapSearch.Config.Map.defaultZoom); this.map.enableScrollWheelZoom(); this.map.addControl(new GLargeMapControl()); this.map.addControl(new GHierarchicalMapTypeControl()); this.map.addControl(new GScaleControl()); function StreetViewControl(){} StreetViewControl.prototype = new GControl(); StreetViewControl.prototype.initialize = function(map){ var container = document.createElement("div"); container.style.backgroundColor = "white"; container.style.border = "1px solid #000000"; container.style.cursor = "pointer"; var streetView = document.createElement("div"); streetView.appendChild(document.createTextNode("Street View")); container.appendChild(streetView); //streetView.style.border = "1px solid #6C9DDF"; //streetView.style.borderTop = "1px solid #345684"; //streetView.style.borderBottom = "1px solid #6C9DDF"; //streetView.style.borderLeft = "1px solid #345684"; //streetView.style.borderRight = "1px solid #6C9DDF"; streetView.style.border = "1px solid #ffffff"; streetView.style.borderBottom = "1px solid #B0B0B0"; streetView.style.borderRight = "1px solid #B0B0B0"; streetView.style.fontSize = "12px"; streetView.style.fontBold = "bold"; streetView.style.paddingLeft = "10px"; streetView.style.paddingRight = "10px"; GEvent.addDomListener(streetView, "click", function() { if (MapSearch.Map.I().overlays.streetDisplay) { MapSearch.Map.I().toggleStreetview(false); } else { MapSearch.Map.I().toggleStreetview(true); } }); map.getContainer().appendChild(container); return container; } StreetViewControl.prototype.getDefaultPosition = function(){ return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(147, 7)); } try { this.map.addControl(new StreetViewControl()); } catch(e){ alert(e.message); } this.Types.Normal = G_NORMAL_MAP; this.Types.Sat = G_SATELLITE_MAP; this.Types.Hybrid = G_HYBRID_MAP; this.overlays = { street: new GStreetviewOverlay(), streetDisplay: false } this.addEvent('singlerightclick', function(){this._rightClick(arguments[0], arguments[1], arguments[2]);}.bind(this)); this.addEvent('click', function(){this._click(arguments[0], arguments[1], arguments[2]);}.bind(this)); MapSearch.Map.Search.I(); this.GUI.Status.toggleMapStatus(false); MapSearch.Map.InitilizeCallback(); } else { this.GUI.Status.setMapStatus(MapSearch.Config.GUI.MSGs.MapInCompatible); } }, unLoadMap: function(pEvent){ GUnload(); }, createPushpin: function(point, html, iconSet){ return new MapSearch.Map.Pushpin.Google(point, html, iconSet); }, addPushpins: function(pushpins){ pushpins.each( function(iter){ this.map.addOverlay(iter); }.bind(this) ); }, setType: function(type){ this.map.setMapType(type); }, toggleStreetview: function(display){ if(display && !this.overlays.streetDisplay){ this.map.addOverlay(this.overlays.street); this.overlays.streetDisplay = true; if(MapSearch.Map.Streetview.I().icon != null){ MapSearch.Map.Streetview.I().icon.show(); } else { var center = this.getCenter(); MapSearch.Map.Streetview.I().createIcon(center); } } else if(!display && this.overlays.streetDisplay) { this.map.removeOverlay(this.overlays.street); this.overlays.streetDisplay = false; if(MapSearch.Map.Streetview.I().icon != null){ MapSearch.Map.Streetview.I().icon.hide(); } } }, /* * Sets */ setMapType: function(type){ this.map.setMapType = type; }, setCenter: function(LatLong, Zoom){ this.map.setCenter(LatLong, Zoom); }, /* * Gets */ getBounds: function(){ return this.map.getBounds(); }, getSouthWest: function(){ var temp = this.getBounds().getSouthWest(); return new MapSearch.Map.LatLong(temp.lat(), temp.lng()); }, getNorthEast: function(){ var temp = this.getBounds().getNorthEast(); return new MapSearch.Map.LatLong(temp.lat(), temp.lng()); }, getZoom: function(){ return this.map.getZoom(); }, getCenter: function(){ return this.map.getCenter(); }, /* * Events */ zoomIn: function(){ this.map.zoomOut(); }, zoomOut: function(){ this.map.zoomIn(); }, panTo: function(LatLong){ this.map.panTo(LatLong); }, addEvent: function(event, callback){ return GEvent.addListener(this.map, event, callback); }, _rightClick: function(mXY, tileURL, gMarker){ var event = new MapSearch.Map.Event(); var pos = $GetAbsPos($('SearchMap')); pos.x += mXY.x; pos.y += mXY.y; event.setMouseXY(pos); event.setMapElement(gMarker); this.events.rightClick.each(function(iter){ iter(event); }); }, _click: function(){ var event = new MapSearch.Map.Event(); if (arguments[0] != null) { event.setMapElement(arguments[0]); event.setLatLong(arguments[2]); } else { event.setLatLong(arguments[1]); } this.events.click.each(function(iter){ iter(event); }); } }); /** * @author nick */ MapSearch.Map.Search = Class.create({ initialize: function(){ this.localSearch = new google.search.LocalSearch(); this.localSearch.setNoHtmlGeneration(); this.localSearch.setCenterPoint(MapSearch.Map.I().map); this.localSearch.setResultSetSize(google.search.Search.LARGE_RESULTSET); this.localSearch.setSearchCompleteCallback(this, this.searchReturn); this.searchQueue = new Array(); this.searching = false; }, search: function(term, callback){ this.searchQueue[this.searchQueue.length] = {term: term, callback: callback} if(!this.searching){ this._search(term); } }, _search: function(term){ this.searching = true; this.localSearch.execute(term); }, searchReturn: function(){ var results = new Array(); this.localSearch.results.each(function(result){ var temp = { streetAddress: result.addressLines[0], cityState: result.addressLines[1], title: result.titleNoFormatting, url: result.url, lat: result.lat, lng: result.lng, phones: result.phoneNumbers } results[results.length] = temp; }); results = {results:results, term: this.searchQueue[0].term} this.searchQueue[0].callback(results); this.searchQueue[0] = null; this.searchQueue = this.searchQueue.compact(); if(this.searchQueue.length > 0){ this._search(this.searchQueue[0].term); } else { this.searching = false; } } }); MapSearch.Map.Search.Instance = null; MapSearch.Map.Search.I = function(){ if(MapSearch.Map.Search.Instance == null){MapSearch.Map.Search.Instance = new MapSearch.Map.Search();} return MapSearch.Map.Search.Instance; } MapSearch.Map.Pushpin = {} MapSearch.Map.Pushpin.Manager = Class.create({ initialize: function(){ this.markers = new Array(); this.zoomLevel = null; this.map = MapSearch.Map.I(); this.zoomEvent = this.map.addEvent('zoomend', function(){this.mapZoom();}.bind(this)); }, mapZoom: function(){ var zoom = Number(this.map.getZoom()); if(this.zoomLevel == null){ this.zoomLevel = zoom; this.updateZoom(zoom); } else if(zoom != this.zoomLevel){ if(zoom >= 0 && zoom <= MapSearch.Config.Map.iconLevels.tier1 && this.zoomLevel >= 0 && this.zoomLevel <= MapSearch.Config.Map.iconLevels.tier1){ //Do nothing Still in the same zone 1 } else if(zoom > MapSearch.Config.Map.iconLevels.tier1 && zoom <= MapSearch.Config.Map.iconLevels.tier2 && this.zoomLevel > MapSearch.Config.Map.iconLevels.tier1 && this.zoomLevel <= MapSearch.Config.Map.iconLevels.tier2) { //Do nothing Still in the same zone 2 } else if(zoom > MapSearch.Config.Map.iconLevels.tier2 && zoom <= MapSearch.Config.Map.iconLevels.tier3 && this.zoomLevel > MapSearch.Config.Map.iconLevels.tier2 && this.zoomLevel <= MapSearch.Config.Map.iconLevels.tier3) { //Do nothing Still in the same zone 3 } else { this.updateZoom(zoom); } this.zoomLevel = zoom; } }, updateZoom: function(zoom){ this.markers.each(function(iter){ iter.updateIcon(zoom); }); }, addMarker: function(marker){ this.markers[this.markers.length] = marker; }, removeMarker: function(marker){ var index = this.markers.indexOf(marker); if (index != -1) { this.markers[index] = null; this.markers = this.markers.compact(); } } }); MapSearch.Map.Pushpin.Manager.Instance = null; MapSearch.Map.Pushpin.Manager.I = function(){ if(MapSearch.Map.Pushpin.Manager.Instance == null){ MapSearch.Map.Pushpin.Manager.Instance = new MapSearch.Map.Pushpin.Manager(); } return MapSearch.Map.Pushpin.Manager.Instance; } MapSearch.Map.Pushpin.Base = Class.create({ initialize: function(id, point, html){ } }); MapSearch.Map.Pushpin.Google = Class.create(MapSearch.Map.Pushpin.Base, { initialize: function($super, point, html, iconSet, iconOptions){ $super(); this.html = html; this.point = point; this.iconSet = iconSet; this.icon = new GIcon(G_DEFAULT_ICON); this.icon.image = this.iconSet.near.icon; this.icon.shadow = this.iconSet.near.shadow; this.icon.iconSize = new GSize(this.iconSet.near.iconW,this.iconSet.near.iconH); this.icon.shadowSize = new GSize(this.iconSet.near.shadowW,this.iconSet.near.shadowH); this.icon.iconAnchor = new GPoint(this.iconSet.near.anchorX,this.iconSet.near.anchorY); if (this.iconSet.near.windowX != null && this.iconSet.near.windowY != null) { this.icon.infoWindowAnchor = new GPoint(this.iconSet.near.windowX, this.iconSet.near.windowY); } var MarkerOptions = { icon:this.icon } Object.extend(MarkerOptions, iconOptions || {}); this.pushpin = new GMarker(point, MarkerOptions); this.map = MapSearch.Map.I(); //this.zoomEvent = this.map.addEvent('zoomend', function(){this.mapZoom();}.bind(this)); this.event = GEvent.addListener(this.pushpin, 'click', function(){this.iconClick();}.bind(this)); this.extendedEvents = new Array(); MapSearch.Map.Pushpin.Manager.I().addMarker(this); }, setPoint: function(point){ this.pushpin.setLatLng(point); this.point = point; }, setHTML: function(html){ this.html = html; }, showWindow: function(){ if ($E.isArray(this.html)) { this.pushpin.openInfoWindowTabsHtml(this.html); } else { this.pushpin.openInfoWindowHtml(this.html); } }, del: function(){ GEvent.removeListener(this.event); this.extendedEvents.each(function(iter){GEvent.removeListener(iter);}); this.map.map.removeOverlay(this.pushpin); MapSearch.Map.Pushpin.Manager.I().removeMarker(this); }, add: function(){ this.map.map.addOverlay(this.pushpin); this.updateIcon(this.map.getZoom()); }, show: function(){ this.pushpin.show(); }, hide: function(){ this.pushpin.hide(); }, isHidden: function(){ return this.pushpin.isHidden(); }, updateIcon: function(zoom){ if(zoom <= MapSearch.Config.Map.iconLevels.tier1){ this.icon.image = this.iconSet.far.icon; this.icon.iconSize = new GSize(this.iconSet.far.iconW,this.iconSet.far.iconH); this.icon.shadow = this.iconSet.far.shadow; this.icon.shadowSize = new GSize(this.iconSet.far.shadowW,this.iconSet.far.shadowH); this.icon.iconAnchor = new GPoint(this.iconSet.far.anchorX,this.iconSet.far.anchorY); if (this.iconSet.far.windowX != null && this.iconSet.far.windowY != null) { this.icon.infoWindowAnchor = new GPoint(this.iconSet.far.windowX, this.iconSet.far.windowY); } } else if(zoom <= MapSearch.Config.Map.iconLevels.tier2){ this.icon.image = this.iconSet.mid.icon; this.icon.iconSize = new GSize(this.iconSet.mid.iconW,this.iconSet.mid.iconH); this.icon.shadow = this.iconSet.mid.shadow; this.icon.shadowSize = new GSize(this.iconSet.mid.shadowW,this.iconSet.mid.shadowH); this.icon.iconAnchor = new GPoint(this.iconSet.mid.anchorX,this.iconSet.mid.anchorY); if (this.iconSet.mid.windowX != null && this.iconSet.mid.windowY != null) { this.icon.infoWindowAnchor = new GPoint(this.iconSet.mid.windowX, this.iconSet.mid.windowY); } } else { this.icon.image = this.iconSet.near.icon; this.icon.iconSize = new GSize(this.iconSet.near.iconW,this.iconSet.near.iconH); this.icon.shadow = this.iconSet.near.shadow; this.icon.shadowSize = new GSize(this.iconSet.near.shadowW,this.iconSet.near.shadowH); this.icon.iconAnchor = new GPoint(this.iconSet.near.anchorX,this.iconSet.near.anchorY); if (this.iconSet.near.windowX != null && this.iconSet.near.windowY != null) { this.icon.infoWindowAnchor = new GPoint(this.iconSet.near.windowX, this.iconSet.near.windowY); } } this.pushpin.remove(); this.pushpin.initialize(this.map.map); this.pushpin.redraw(true); }, /* * Events */ mapZoom: function(){ //Deprecated MapSearch.Console.warn('[Deprecated]: MapSearch.Map.Pushpin.Google.mapZoom'); this.updateIcon(); }, iconClick: function(){ this.showWindow(); }, addEvent: function(event, callback){ var event = GEvent.addListener(this.pushpin, event, callback); this.extendedEvents[this.extendedEvents.length] = event; return event; } }); MapSearch.Map.Streetview = Class.create({ initialize: function(){ this.window = new MapSearch.GUI.Window.Window('Streetview'); this.window.setHideCallback(function(){this._hide();}.bind(this)); this.window.setHTML(''); this.location = null; this.pano = null; this.created=false; this.client = new GStreetviewClient(); this.icon = null; }, create: function(){ this.window.setDim(700,400); this.window.showCenter(); this.pano = new GStreetviewPanorama(this.window.windowContent); GEvent.addListener(this.pano, 'initialized', function(data){this._updateLocation(data);}.bind(this)); this.created = true; }, createIcon: function(latLng){ if (this.icon == null) { this.icon = new MapSearch.Map.Pushpin.Google(latLng, 'Steetview Location', MapSearch.Config.Icons.Base.littleMan, {draggable:true, bouncy:true, title:'StreetView'}); this.icon.add(); this.icon.setHTML(MapSearch.Template.Streetview.littleManBlank.evaluate({ lat: latLng.lat(), lng: latLng.lng() })); this.icon.addEvent('dragend', function(latLng){this.iconDragend(latLng);}.bind(this)); } }, show: function(Lat, Lng){ this.location = new GLatLng(Lat, Lng); if (this.icon == null) { this.createIcon(this.location); } else { if(this.icon.isHidden()){ this.icon.show(); } } this.client.getNearestPanorama(this.location, function(data){this._show(data);}.bind(this)); }, _show: function(data){ if (data.code != 200) { alert('Sorry but we could not locate a Streetview near this Property.'); //this.icon.hide(); } else { if (!this.created) { this.create(); } else { this.window.show(); this.pano.show(); } //Display Streetview Overlay MapSearch.Map.I().toggleStreetview(true); MapSearch.GUI.Base.I().Tools.PanPoly.street=true; this.icon.setHTML(MapSearch.Template.Streetview.littleMan.evaluate({ description: data.Location.description, lat: data.Location.lat, lng: data.Location.lng, copyright: data.Data.copyright })); this.location = data.Location.latlng; this.icon.setPoint(this.location); this.pano.setLocationAndPOV(this.location); } }, _hide: function(){ this.pano.hide(); }, _updateLocation: function(data){ this.location = data.latlng; this.icon.setPoint(this.location); this.icon.setHTML(MapSearch.Template.Streetview.littleMan.evaluate({ description: data.description, lat: data.lat, lng: data.lng, copyright: '© Google' })); }, iconDragend: function(latLng){ this.icon.setHTML(MapSearch.Template.Streetview.littleManBlank.evaluate({ lat: latLng.lat(), lng: latLng.lng() })); } }); MapSearch.Map.Streetview.Instance = null; MapSearch.Map.Streetview.I = function(){ if(MapSearch.Map.Streetview.Instance == null){ MapSearch.Map.Streetview.Instance = new MapSearch.Map.Streetview(); } return MapSearch.Map.Streetview.Instance; } /** * Map Search Configs * * @author Nick Verbeck * @file /js/map_search/MapSearch.Config.js */ MapSearch.Config = {Company:'Active Website'} MapSearch.Config.GUI = { windowSize: {width:1000, height:700}, Theme: MapSearch.GUI.Theme.Blue } MapSearch.Config.Urls = {} MapSearch.Config.Urls.Base = { imageServer: '' } MapSearch.Config.GUI.MSGs = { Loading: 'Loading Map Interface.....', BindingInterface: 'Binding Events to Interface.....', MapLoading: 'Loading Map', MapInit: 'Initilizing Map', MapInCompatible: 'We are sorry to inform you that your browser is not supported by this map', MapSearch: 'Searching for Real Estate in the Area', MapPlotting: 'Properties Found. Plotting Results.' } MapSearch.Config.Map = { defaultLatLong: { Lat: 39.73042572969996, Long: -104.99908447265625 }, defaultLocation:null, defaultZoom: 16, iconLevels: { tier1: 9, tier2: 13, tier3: 19 } } MapSearch.Config.Dates = { propAdded: new Date(), propUpdated: new Date() } MapSearch.Config.Dates.propAdded.setDate(MapSearch.Config.Dates.propAdded.getDate()-30); MapSearch.Config.Dates.propUpdated.setDate(MapSearch.Config.Dates.propUpdated.getDate()-10); MapSearch.Config.IDX = new Array(); //IRES MapSearch.Config.IDX[1] = ''; //Jackson MapSearch.Config.IDX[3] = ''; //AAAR MapSearch.Config.IDX[4] = ''; //Metrolist MapSearch.Config.IDX[5] = ''; //Reinhart MapSearch.Config.IDX[6] = ''; //Tricmls MapSearch.Config.IDX[7] = ''; //MRed MapSearch.Config.IDX[8] = ''; //GNair MapSearch.Config.IDX[9] = ''; //Swmric MapSearch.Config.IDX[10] = ''; //Statewide MapSearch.Config.IDX[11] = ''; //NTreis MapSearch.Config.IDX[12] = ''; //Rubloff MapSearch.Config.IDX[13] = ''; //VAIL MapSearch.Config.IDX[14] = ''; //GSMLS MapSearch.Config.IDX[15] = ''; //Resi MapSearch.Config.IDX[16] = ''; //CMLS MapSearch.Config.IDX[17] = ''; //Trend MapSearch.Config.IDX[18] = ''; //Piedmont MapSearch.Config.IDX[19] = ''; //Ebby MapSearch.Config.IDX[20] = ''; /** * Map Search Base Icon Configs * * @author Nick Verbeck * @file /js/map_search/MapSearch.Config.Icons.Base.js */ MapSearch.Config.Icons = {} MapSearch.Config.Icons.Base = { newProp: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/GreenFar.png', iconH: 14, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-house-far.png', shadowH: 14, shadowW: 20, anchorX: 5, anchorY: 13, windowX: 6, windowY: 0 }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/GreenMid.png', iconH: 26, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-house-mid.png', shadowH: 26, shadowW: 36, anchorX: 10, anchorY: 25, windowX: 11, windowY: 0 }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/GreenNewHouse.png', iconH: 39, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-house-close.png', shadowH: 39, shadowW: 53, anchorX: 14, anchorY: 37, windowX: 18, windowY: 0 }, result: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/Green-Result.gif', name: new Template('New Properties') }, oldProp: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/OrangeFar.png', iconH: 14, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-house-far.png', shadowH: 14, shadowW: 20, anchorX: 5, anchorY: 13, windowX: 6, windowY: 0 }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/OrangeMid.png', iconH: 26, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-house-mid.png', shadowH: 26, shadowW: 36, anchorX: 10, anchorY: 25, windowX: 11, windowY: 0 }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/OrangeOldHouse.png', iconH: 39, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-house-close.png', shadowH: 39, shadowW: 53, anchorX: 14, anchorY: 37, windowX: 18, windowY: 0 }, result: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/Orange-Result.gif', name: new Template('Current Listings') }, updatedProp: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/BlueFar.png', iconH: 14, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-house-far.png', shadowH: 14, shadowW: 20, anchorX: 5, anchorY: 13, windowX: 6, windowY: 0 }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/BlueMid.png', iconH: 26, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-house-mid.png', shadowH: 26, shadowW: 36, anchorX: 10, anchorY: 25, windowX: 11, windowY: 0 }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/BlueUpdatedHouse.png', iconH: 39, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-house-close.png', shadowH: 39, shadowW: 53, anchorX: 14, anchorY: 37, windowX: 18, windowY: 0 }, result: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/Blue-Result.gif', name: new Template('Recently Updated Properties') }, viewed: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/viewed-far.png', iconH: 14, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-house-far.png', shadowH: 14, shadowW: 20, anchorX: 5, anchorY: 13, windowX: 6, windowY: 0 }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/viewed-mid.png', iconH: 26, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-house-mid.png', shadowH: 26, shadowW: 36, anchorX: 10, anchorY: 25, windowX: 11, windowY: 0 }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/viewed.png', iconH: 39, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-house-close.png', shadowH: 39, shadowW: 53, anchorX: 14, anchorY: 37, windowX: 18, windowY: 0 }, result: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/Yellow-Result.gif', name: new Template('Recently Viewed') }, openHouse: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/OpenHouseFar.png', iconH: 24, iconW: 20, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-openhouse-far.png', shadowH: 26, shadowW: 35, anchorX: 5, anchorY: 19, windowX: 14, windowY: 0 }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/OpenHouseMid.png', iconH: 43, iconW: 35, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-openhouse-mid.png', shadowH: 57, shadowW: 43, anchorX: 10, anchorY: 35, windowX: 23, windowY: 2 }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/OpenHouseClose.png', iconH: 62, iconW: 51, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-openhouse-close.png', shadowH: 63, shadowW: 83, anchorX: 14, anchorY: 51, windowX: 34, windowY: 2 }, result: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/Open-Result.gif', name: new Template('Open House') }, office: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/office-far.png', iconH: 15, iconW: 15, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-office-far.png', shadowH: 16, shadowW: 25, anchorX: 7, anchorY: 7, windowX: 7, windowY: 0 }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/office-mid.png', iconH: 24, iconW: 24, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-office-mid.png', shadowH: 37, shadowW: 24, anchorX: 12, anchorY: 12, windowX: 12, windowY: 0 }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/office-close.png', iconH: 35, iconW: 35, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-office-close.png', shadowH: 35, shadowW: 53, anchorX: 17, anchorY: 17, windowX: 17, windowY: 0 }, result: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/office-close.png', name: new Template('#{company} Offices') }, favorites: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/FavFar.png', iconH: 11, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-fav-far.png', shadowH: 10, shadowW: 18, anchorX: 2, anchorY: 9, windowX: 6, windowY: 0 }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/FavMid.png', iconH: 20, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-fav-mid.png', shadowH: 19, shadowW: 32, anchorX: 9, anchorY: 19, windowX: 11, windowY: 0 }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/FavHeart.png', iconH: 27, iconW: 30, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-fav-close.png', shadowH: 27, shadowW: 46, anchorX: 12, anchorY: 23, windowX: 15, windowY: 0 }, result: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/FavHeart.png', name: new Template('My Favorites') }, littleMan: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/person.png', iconH: 35, iconW: 20, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-person.png', shadowH: 35, shadowW: 38, anchorX: 10, anchorY: 35, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/person.png', iconH: 35, iconW: 20, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-person.png', shadowH: 35, shadowW: 38, anchorX: 10, anchorY: 35, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/person.png', iconH: 35, iconW: 20, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/shadow-person.png', shadowH: 35, shadowW: 38, anchorX: 10, anchorY: 35, windowX: null, windowY: null }, result: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/Base_Icons/person.png', name: new Template('Streetview Location') } } //Lets reduce as much code as we can. MapSearch.Config.Icons.Base.myOpenHouse = {}; MapSearch.Config.Icons.Base.myNewProp = {}; MapSearch.Config.Icons.Base.myOldProp = {}; MapSearch.Config.Icons.Base.myUpdatedProp = {}; Object.extend(MapSearch.Config.Icons.Base.myOpenHouse, MapSearch.Config.Icons.Base.openHouse); Object.extend(MapSearch.Config.Icons.Base.myNewProp, MapSearch.Config.Icons.Base.newProp); Object.extend(MapSearch.Config.Icons.Base.myOldProp, MapSearch.Config.Icons.Base.oldProp); Object.extend(MapSearch.Config.Icons.Base.myUpdatedProp, MapSearch.Config.Icons.Base.updatedProp); MapSearch.Config.Icons.Base.myOpenHouse.name = new Template('#{company} Open House'); MapSearch.Config.Icons.Base.myNewProp.name = new Template('#{company} New Listing'); MapSearch.Config.Icons.Base.myOldProp.name = new Template('#{company} Current Listing'); MapSearch.Config.Icons.Base.myUpdatedProp.name = new Template('#{company} Recently Updated');/** * Map Search POI Icon Configs * * @author Nick Verbeck * @file /js/map_search/MapSearch.Config.Icons.POI.js */ MapSearch.Config.Icons.POI = { golf: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attraction-golf-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attraction-golf-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attraction-golf.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Golf Courses' }, health: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attraction-health_club-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attraction-health_club-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attraction-health_club.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Health Clubs' }, movie: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attraction-movie_theater-fa.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attraction-movie_theater-mi.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attraction-movie_theater.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Movie Theaters' }, arena: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attractions-arena-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attractions-arena-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attractions-arena.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Sports Stadiums' }, recreation: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attractions-recreation-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attractions-recreation-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attractions-recreation.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Recreation' }, tourist: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attraction-tourist-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attraction-tourist-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/attraction-tourist.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Tourist Attractions' }, courts: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-courts-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-courts-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-courts.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Courts' }, fire: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-fire-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-fire-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-fire.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Fire Departments' }, library: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-library-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-library-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-library.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Libraries' }, police: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-police-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-police-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-police.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Police Departments' }, postOffice: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-post_office-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-post_office-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/government-post_office.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Post Offices' }, clinic: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/healthcare-clinic-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/healthcare-clinic-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/healthcare-clinic.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Clinics' }, hospital: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/healthcare-hospital-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/healthcare-hospital-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/healthcare-hospital.png', iconH: 57, iconW: 33, shadow: 'http://www.google.com/mapfiles/shadow50.png', shadowH: 34, shadowW: 37, anchorX: 13, anchorY: 55, windowX: '', windowY: '' }, name: 'Hospitals' }, airport: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/other-airport-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/other-airport-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/other-airport.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Airports' }, bank: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/other-bank-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/other-bank-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/other-bank.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Banks' }, laundry: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/other-laundry-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/other-laundry-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/other-laundry.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Laundry' }, worship: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/other-worship-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/other-worship-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/other-worship.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Places of Worship' }, bar: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/restaurant-bar-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/restaurant-bar-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/restaurant-bar.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Bars' }, coffee: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/restaurant-coffee-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/restaurant-coffee-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/restaurant-coffee.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Coffee Shops' }, restaurant: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/restaurant-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/restaurant-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/restaurant.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Restaurants' }, school: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/school-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/school-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/schools.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Schools' }, bookStore: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shopping-book_store-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shopping-book_store-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shopping-book_store.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Book Stores' }, department: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shopping-department-far.png', iconH: 21, iconW: 12, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-far.png', shadowH: 21, shadowW: 23, anchorX: 5, anchorY: 20, windowX: null, windowY: null }, mid: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shopping-department-mid.png', iconH: 38, iconW: 22, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-mid.png', shadowH: 39, shadowW: 42, anchorX: 9, anchorY: 38, windowX: null, windowY: null }, near: { icon: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shopping-department.png', iconH: 57, iconW: 33, shadow: MapSearch.Config.Urls.Base.imageServer +'/images/system/map_search/POI_Icons/shadow-poi-close.png', shadowH: 57, shadowW: 61, anchorX: 13, anchorY: 55, windowX: null, windowY: null }, name: 'Department Stores' }, drugStore: { far: { icon: MapSearch.Config.Urls.Base.imageServer +'/