[mapguide-commits] r7473 - sandbox/jng/queryfeatures_v2/Web/src/viewerfiles

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri May 3 15:23:24 PDT 2013


Author: jng
Date: 2013-05-03 15:23:24 -0700 (Fri, 03 May 2013)
New Revision: 7473

Modified:
   sandbox/jng/queryfeatures_v2/Web/src/viewerfiles/ajaxmappane.templ
   sandbox/jng/queryfeatures_v2/Web/src/viewerfiles/browserdetect.js
Log:
Here's the AJAX viewer side of the equation:
 - Fix bad ie check in browserdetect.js
 - Update tooltip request to use QUERYMAPFEATURES 2.6.0
 - Reorder the browserdetect vars when checking for data URI support
 - Fix use of non-existent XML DOM APIs in IE.

Modified: sandbox/jng/queryfeatures_v2/Web/src/viewerfiles/ajaxmappane.templ
===================================================================
--- sandbox/jng/queryfeatures_v2/Web/src/viewerfiles/ajaxmappane.templ	2013-05-03 22:21:33 UTC (rev 7472)
+++ sandbox/jng/queryfeatures_v2/Web/src/viewerfiles/ajaxmappane.templ	2013-05-03 22:23:24 UTC (rev 7473)
@@ -3036,7 +3036,7 @@
     if(geom.indexOf("NaN") >= 0) return;
     
     var reqData = 1; //attributes
-    if (!msie || msie8plus)
+    if (msie8plus || !msie)
         reqData |= 2; //inline selection
     var reqParams = "OPERATION=QUERYMAPFEATURES&VERSION=2.6.0&PERSIST=1&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&SEQ=" + Math.random();
     reqParams += "&LAYERNAMES=" + encodeURIComponent(GetVisSelLayers()) + "&GEOMETRY=" + geom + "&SELECTIONVARIANT=" + queryVariant + "&CLIENTAGENT=" + encodeURIComponent(clientAgent);
@@ -3150,7 +3150,17 @@
                 }
             }
             parent.OnSelectionChanged();
-            RequestSelectionImage(++ selMapId, "");
+            var mtEls = xmlIn.getElementsByTagName("MimeType");
+            var cntEls = xmlIn.getElementsByTagName("Content");
+            var bDataUriSupport = (msie8plus || !msie);
+            if (bDataUriSupport && mtEls.length == 1 && cntEls.length == 1) {
+                var mt = msie ? mtEls[0].text : mtEls[0].textContent;
+                var cnt = msie ? cntEls[0].text : cntEls[0].textContent;
+                var dataUri = "data:" + mt + ";base64," + cnt;
+                PutSelectionImageUrl(++ selMapId, dataUri);
+            } else {
+                RequestSelectionImage(++ selMapId, "");
+            }
         }
     }
     if(which & 2)
@@ -3789,7 +3799,8 @@
     pt1 = ScreenToMapUnits(x1,y1);
     pt2 = ScreenToMapUnits(x2,y2);
     geom = MakeWktPolygon(pt1.X, pt1.Y, pt2.X, pt2.Y);
-    reqParams = "OPERATION=QUERYMAPFEATURES&VERSION=1.0.0&PERSIST=0&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&SEQ=" + Math.random() + "&LAYERNAMES=" + encodeURIComponent(GetVisLayers()) + "&GEOMETRY=" + geom + "&SELECTIONVARIANT=INTERSECTS&MAXFEATURES=1&LAYERATTRIBUTEFILTER=5" + "&CLIENTAGENT=" + encodeURIComponent(clientAgent);
+    var reqData = (4 | 8); //Tooltips + Hyperlinks
+    reqParams = "OPERATION=QUERYMAPFEATURES&VERSION=2.6.0&PERSIST=0&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&SEQ=" + Math.random() + "&LAYERNAMES=" + encodeURIComponent(GetVisLayers()) + "&GEOMETRY=" + geom + "&SELECTIONVARIANT=INTERSECTS&MAXFEATURES=1&LAYERATTRIBUTEFILTER=5&REQUESTDATA=" + reqData + "&CLIENTAGENT=" + encodeURIComponent(clientAgent);
     obj = new HlRequest(id, x, y, req, exec);
     req.onreadystatechange = obj.OnHl;
     try { req.send(reqParams); } catch(ex) {}
@@ -4172,8 +4183,8 @@
         for (var j = 0; j < propEls.length; j++)
         {
             //Name,Type,Value
-            var name = propEls[j].childNodes[0].textContent;
-            var value = propEls[j].childNodes[2].textContent;
+            var name = msie ? propEls[j].childNodes[0].text : propEls[j].childNodes[0].textContent;
+            var value = msie ? propEls[j].childNodes[2].text : propEls[j].childNodes[2].textContent;
             if (name == "_MgLayerName")
             {
                 if (!featuresByLayer[value])

Modified: sandbox/jng/queryfeatures_v2/Web/src/viewerfiles/browserdetect.js
===================================================================
--- sandbox/jng/queryfeatures_v2/Web/src/viewerfiles/browserdetect.js	2013-05-03 22:21:33 UTC (rev 7472)
+++ sandbox/jng/queryfeatures_v2/Web/src/viewerfiles/browserdetect.js	2013-05-03 22:23:24 UTC (rev 7473)
@@ -34,9 +34,10 @@
     msie = true;
     var msieVersion = agent.substr(msieIndex + 5, 2);
 
-    if(parseFloat(msieVersion) >= 7)
+    if(parseFloat(msieVersion) == 7)
     {
         msie7plus = true;
+        msie8plus = false;
     }
     else if (parseFloat(msieVersion) >= 8)
     {



More information about the mapguide-commits mailing list