[mapguide-internals] FW: [mapguide-users] patch for Mouse Wheel Zoom, set scale and image on loading map in Ajax.

Jason Birch Jason.Birch at nanaimo.ca
Mon Apr 2 17:21:37 EDT 2007


How invasive are these changes?  Is it something that we could add to 1.2 during the beta stages? :)

________________________________

From: mapguide-users-bounces at lists.osgeo.org [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of José Manuel Cerrejón González
Sent: Friday, March 30, 2007 04:36
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] patch for Mouse Wheel Zoom, set scale and image on loading map in Ajax.


I've try to post the code in the internal list, but I don't how to register. Anyway here the code. I've applied the changes on the 1.0.2, but in the last version works fine.

Somebody who know how to do it, please e-mail me.

This patch use javascript to zoom with the wheel mouse, like in AutoCAD.

Another patch is to input in the scale bar, a scale manually. 

You can see an icon in the toolbar when the map is loading.

All these changes in action here <http://wms.diphuelva.es/mapguide/phpviewersample/index.php> . Click on the help icon to see more features.


E-mail me with any problem.

Thank you.


________________________________


[toolbar.templ]

In css: 
________________________________


        div.cssRefresh
        {
            position: absolute; 
            right:10px;
            top:4px;        
        }

________________________________

The body seems like this. Rotating_arrow.gif is the image. You can design it or use the attached:

________________________________

<body class="Toolbar" onload="InitDocument()" leftmargin=10 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0>
    <div id="divRefresh" name="divRefresh" class="cssRefresh"><img alt="loading" src="../phpviewersample/images/common/rotating_arrow.gif"></div>
    <span id="ToolbarContent"><td></td></span>
    <div class="TextMetricsDiv" id="TextMetricsDiv"><span class="TextMetrics" id="Metrics"></span></div>
  </body>

________________________________

[ajaxmappane.templ]

About line 1350:

________________________________

  if(requestObj.responseXML)
    {
        var resp = ParseEnvelope(requestObj.responseXML.documentElement);
        if(resp == null)
            RequestFailed("Invalid XML response");
        else
        {
            var frmParent = parent.frames ["tbFrame"];
            var objDivRefresh = frmParent.document.getElementById("divRefresh");
            if(objDivRefresh!=null){  objDivRefresh.style.display='block'; }
            
            panX1 = extX1 = resp.lowerLeft.X;
          ...

________________________________

Line 1463 after the changes:

________________________________

    if(safari)
        curimg = (curimg == "mapImage1"? "mapImage2": "mapImage1");
        
    var frmParent = parent.frames ["tbFrame"];
    var objDivRefresh = frmParent.document.getElementById("divRefresh");
    if(objDivRefresh!=null){    objDivRefresh.style.display='none'; }
    
    return false;
}


________________________________

Jose Manuel Cerrejon Gonzalez
jose.cerrejon at mapas-sll.com | gis at mapas-sll.com
I+D
MAPAS SLL <http://mapas-sll.com>  

-------------- next part --------------
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


More information about the mapguide-internals mailing list