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

Ivan Miličević ivan at ineo.hr
Mon Apr 2 17:13:08 EDT 2007


You're the man!

 

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 1:36 PM
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 --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20070402/c380935d/attachment.html


More information about the mapguide-users mailing list