Activate hyperlink by double click in Ajax viewer of AIMS 2013

By Daniel Du

As you know, it is possible to set up a hyper link for features, and open a link by ctrl+click. For those who does not know, you can open a layer by double clicking the layer from Site Explorer of Infrastructure Studio, and click the … button to set a hyperlink expression for “URL activated for feature”:

image

With this setting, user can activate an URL by clicking one feature while pressing CTRL key.

But many users, especially users who are used to MapGuide 6.5, are willing to change this behavior to double click, it is possible? The answer is yes. here is a thread on MapGuide Open Source discussion group,, and it applies to AIMS 2013 as well. I presume it works for other versions of MapGuide Enterprise or AIMS with or without minor changes.

Here it goes. Open C:Program FilesAutodeskAutodesk Infrastructure Web Server Extension 2013wwwviewerfilesajaxmappane.templ and search “OnDblClick”, around line 867, and implement the “OnDblClick” function as below:

function OnDblClick(e)    {        // Override this method in an external script to implement        // your own double-click handler.        // e.g. mapFrame.OnDblClick = MyOnDblClick        // where MyOnDblClick() is a function in your script.             hidePopup(tbMenu)         hidePopup(infoMenu)         hidePopup(ctxMenu)         parent.ForwardMouseDown(document, e);              var x = e.clientX - mapPosX;         var y = e.clientY;              if(x < 0) {             if(safari && x > -5) {                 moveType = RESIZING;                 return false;             }             return false;         }              var processed = parent.ClickMap(x,y);         if (msie) {            e.cancelBubble = true;         }        else {            e.stopPropagation();         }             if (!processed) {             HideHyperlinkTip();             if(tool != 6) {                 if(hlData.url != "") {                    ExecuteHyperlink(hlData.url);                 }                else {                     hlData.curx = x; hlData.cury = y;                     RequestHyperLinkData(++ hlData.reqId, 
                    hlData.curx, hlData.cury, true);                 }             }          }     }

Hope this helps.


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading