FW: [fusion-users] I dont know how zoom a point in fusion

Paul Deschamps pdeschamps at dmsolutions.ca
Fri Jul 11 09:49:03 EDT 2008


forgot to include the list :)

You can use parseFloat() js function as well. ;)

function zoomToExtents(minx,miny,maxx,maxy) {
    var a = [];
    a[0] = parseFloat(minx);
    a[1] = parseFloat(miny);
    a[2] = parseFloat(maxx);
    a[3] = parseFloat(maxy);

    var mapWidget = Fusion.getMapById('mapArea');
    var maps = mapWidget.getAllMaps();
    var map = maps[0];

    map.mapWidget.setExtents(new OpenLayers.Bounds(a[0], a[1], a[2],
a[3]));
}

Cheers

Paul D.


On Fri, Jul 11, 2008 at 9:04 AM, Tómas Guðmundsson <tomas at snertill.is>
wrote:

> Forgot to include the list.
>
> -----Original Message-----
> From: Tómas Guðmundsson
> Sent: 10. júlí 2008 08:26
> To: 'Miguel Vasquez'
> Subject: RE: [fusion-users] I dont know how zoom a point in fusion
>
> Hi Miguel.
>
> I understand your problem. What I did to zoom in and move to the point
> Is that I created a box (extents) around the point I want to zoom in to.
> This is shown in CenterSelection.js I think and here is how I did it.
>
> var lowerLeftX = x - 100;
> var lowerLeftY = y - 100;
> var upperRightX = x - (-100); // This is a hack for when the result of x +
> 100 equals in a string
> var upperRightY = y - (-100); // due to wrong type coersion by javascript.
> this.getMap().setExtents(new OpenLayers.Bounds(lowerLeftX, lowerLeftY,
> upperRightX, upperRightY));
>
> You could just replace "this.getMap()" with your oMap variable. Somehow,
> and I don't know why, but Bounds function could not accept upperRightX and
> Y when I did "x + 100" because then it turned out to be a string, according
> to Firebug, which is very weird but this little hack does the trick. Hope
> this helps.
>
> Regards,
> Tómas.
>
> -----Original Message-----
> From: fusion-users-bounces at lists.osgeo.org [mailto:
> fusion-users-bounces at lists.osgeo.org] On Behalf Of Miguel Vasquez
> Sent: 9. júlí 2008 19:18
> To: fusion-users at lists.osgeo.org
> Subject: [fusion-users] I dont know how zoom a point in fusion
>
> Hi all, i new in the list i try to do a zooming of a point in Mapguide
> Open source but i cant do that i type a script in my app but it
> zooming but dont int the point of i type. The script its the next.
>
> function ZoomToPoint()
> {
>     var Fusion = window.top.Fusion;
>     var oMap = Fusion.getMapByIndice(0);
>     oMap.zoom(2.5637,78.2993, 10);
> }
>
> the error its when i click in the button that fire this function the
> scale change but dont move to the point. The x and y valor its from
> status bar display this valor.
>
> my web app.
>
> http://200.48.28.8:8008/mapguide/msssig/SIGFrmPrincipal.jsp its my
> first application. In opcion in task panel "Nombre de vía" type
> benavides and the result has a button in the final page when click
> show the problem.
>
> PD. sorry for my english i am latinamerican.
>
> Atte
> Miguel Vasquez
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fusion-users/attachments/20080711/712833de/attachment.html


More information about the fusion-users mailing list