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

alucas alucas at srtec.com
Fri Mar 30 17:12:13 EDT 2007


Hello,

I've another way to do this without modify the template files. In my main
page, when I've the viewer iframe, I handle the follwoing events:

OnScaleChanged -> For all zoom types.
All Pan events -> via OncommandExecuted
the most important!! -> OnMapOverlayImageLoaded for know when the PNG has
benn generated.

When the user do zoom or pan, in my handler y show a animated gif that is
shown in the viewer, then, when the OnMapOverlayImageLoaded is fired, in my
event handler I hide the gif.

This way, is not necessari to modify the template files and you can use the
standard installer and you do have all control in your application.

this is a real world example in development  I'm working on: (popups
allowed!!!)
http://sigcarreteras.dival.es

(Sorry for my english...)
Best regards.


Jose Manuel C G wrote:
> 
> 
> 
> 
>   
> 
> 
> 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 .
> 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 
>  
> 
> 
> 
> 
> 
> 
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: http://www.nabble.com/patch-for-Mouse-Wheel-Zoom%2C-set-scale-and-image-on-loading-map-in-Ajax.-tf3491633s16610.html#a9760958
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list