From c957259ef866224508cbd5747e490fc575a1ecd3 Mon Sep 17 00:00:00 2001
From: Matthew Juhl <mjuhl24@gmail.com>
Date: Thu, 18 Feb 2010 17:02:42 +0000
Subject: [PATCH] Fix JS error on homepage (this._flash.addOverlay is not a
 function)

---
 plugins/customindex/views/default/customindex/globesplash.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/plugins/customindex/views/default/customindex/globesplash.js b/plugins/customindex/views/default/customindex/globesplash.js
index c0e37985..fe12b46a 100644
--- a/plugins/customindex/views/default/customindex/globesplash.js
+++ b/plugins/customindex/views/default/customindex/globesplash.js
@@ -120,6 +120,9 @@ function letsdothisloop(delay) {
 };
 
 function openLocation(lng, lat, username, location, displayname, title, comment, linkname) {
+	if (!map1._flash.addOverlay) {
+		return;
+	}
 	if(!pinsonly)
 		clearTimeout(t);
 	var latlng = new FE.LatLng(lat,lng);
@@ -131,7 +134,7 @@ function openLocation(lng, lat, username, location, displayname, title, comment,
 	//make pins clickable
 	if(pinsonly) 
 		FE.Event.addListener(label, 'click', function() { openLocation(lng, lat, username, location, displayname, title, comment, linkname);});
-	map1.addOverlay(label);
+		map1.addOverlay(label);
 	if(!pinsonly)
 		applylabel(latlng, location, title, comment, displayname, username, linkname);
 };
-- 
GitLab