Index: src/hg/hgTracks/chromGraphTrack.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/chromGraphTrack.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -b -B -U 4 -r1.16 -r1.17
--- src/hg/hgTracks/chromGraphTrack.c	17 Jul 2009 18:21:40 -0000	1.16
+++ src/hg/hgTracks/chromGraphTrack.c	27 Aug 2009 00:10:15 -0000	1.17
@@ -180,22 +180,24 @@
 xOff = hvGfxAdjXW(hvg, xOff, width);
 
 char *encodedTrack = cgiEncode(tg->mapName);
 #ifdef IMAGEv2_UI
-if(curMap != NULL)
+if(theImgBox && curMap)
     {
     char link[512];     // FIXME: winStart/winEnd are not right when using a portal
-    safef(link,sizeof(link),"%s&o=%d&t=%d&g=%s&db=%s&pix=%d", hgcNameAndSettings(),
-        winStart, winEnd, encodedTrack, database, tl.picWidth);
+    safef(link,sizeof(link),"%s&o=%d&t=%d&g=%s", hgcNameAndSettings(),
+        winStart, winEnd, encodedTrack);
     mapSetItemAdd(curMap,link,NULL,xOff,yOff,xOff+width,yOff+height);
     }
-#else//ifndef IMAGEv2_UI
-hPrintf("<AREA SHAPE=RECT COORDS=\"%d,%d,%d,%d\" ", xOff, yOff, xOff+width,
+else
+#endif//def IMAGEv2_UI
+    {
+    hPrintf("<AREA SHAPE=RECT COORDS=\"%d,%d,%d,%d\" ", xOff, yOff, xOff+width,
 	yOff+height);
-hPrintf("HREF=\"%s&o=%d&t=%d&g=%s&c=%s&l=%d&r=%d&db=%s&pix=%d\">\n",
+    hPrintf("HREF=\"%s&o=%d&t=%d&g=%s&c=%s&l=%d&r=%d&db=%s&pix=%d\">\n",
 	    hgcNameAndSettings(), winStart, winEnd, encodedTrack, chromName, winStart, winEnd,
 	    database, tl.picWidth);
-#endif//ndef IMAGEv2_UI
+    }
 }
 
 static void cgDrawItems(struct track *tg, int seqStart, int seqEnd,
         struct hvGfx *hvg, int xOff, int yOff, int width,

