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

Chris Tallman ctallman at innomap.com
Tue Apr 3 07:45:23 EDT 2007


Jose, 
 
I missed where you posted the rest of the code for the zooming.  Can you send that to me or post it again.  Or point me to the post that contains the code.
 
Chris

________________________________

From: mapguide-users-bounces at lists.osgeo.org [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Ivan Milicevic
Sent: Monday, April 02, 2007 5:13 PM
To: 'MapGuide Users Mail List'
Subject: RE: [mapguide-users] patch for Mouse Wheel Zoom,set scale and image on loading map in Ajax.



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/20070403/dd253303/attachment.html


More information about the mapguide-users mailing list