[MAPSERVER-USERS] How to implement jBox in asp.netusing C# or VB.....

Cavalieri Piero Piero.Cavalieri at heidi.it
Wed May 21 11:01:00 EDT 2008


If you use jbox, you don't have to use an Image Button.  

Jbox has a function, which you have to implement, which is triggered on mouse relased.

For my case it's so implemented:

 

function setbox_handler(name, minx, miny, maxx, maxy) {

      //alert("Set handler: name: " + name + "  minx: " + minx + "  miny: " + miny);

      document.mapserv.imgbox.value = minx + " " + miny + " " + maxx + " " + maxy;

      document.mapserv.imgxy.value = minx + " " + miny;

      doAction(mode);

    }

 

Also, as explained in jbox (and dbox) tutorial you have to implement also:

seterror_handler

reset_handler

..

..

You can leave the functions body empty, if you don't use them, but at least  setbox_handler must be implemented.

Also there are some hidden variables to write in the aspx page (again read jbox docs).

 

What I do in doAction(mode) is to make a query to Mapserver cgi (as I don't use C# bindings to mapserver) with javascript The  javascript call is done to a C# function via Ajax, the C# function make the query to the cgi with HttpWebRequest method, and the results is parsed. In the result I have the URL of the new created image. This url is send back to the aspx page where, with javascript, I change the url of the displayed image:

 

This is quite complicated round trip, if you want to implement it in few hours (or days...), but then it works fine. What you can do, to simplify things, is to implement doAction to make a post to the aspx page which contains the jbox applet, and then in code behind of the page, make the query to Mapserver (cgi or using C# bindings). Then in code-behind you have to change the url of the image in the applet (maybe you can't do it dynamically server side, as jbox is not a server control, however you can set the new image url in a hidden server control, then via javascriot take that value and change the image url of the applet).

 

Cheers

 Piero

 

________________________________

From: yatendra jaiswal [mailto:yatendra.jaiswal at gmail.com] 
Sent: mercoledì 21 maggio 2008 07:29
To: Cavalieri Piero
Subject: Re: [MAPSERVER-USERS] How to implement jBox in asp.netusing C# or VB.....

 

Dear Cavalieri,

Thanks for immediate response.

I have tried as you explained. But i am not getting any possitive result. 

 

I am using image button. How to implement jbox on image button?

 

Please if possible explain in brief.

 

Thanks regards...



 

On 5/20/08, Cavalieri Piero <Piero.Cavalieri at heidi.it> wrote: 

You use it exatly the same as with other languages (jbox is an applet):

In aspx:

<APPLET codebase="java" code="jBox.class" archive="jBox.jar"
                                width="<%=mapwidth%>" height="<%=mapheight%>" name="jbox" MAYSCRIPT>
                           <PARAM name="image" value="http://<%=host%><%=img%>">
                           <PARAM name="box" value="true">
                           <PARAM name="thickness" value="2">
                           <PARAM name="color" value="red">
                                                       <PARAM name="jitter" value="2">
                           <PARAM name="verbose" value="true">
                       </APPLET>

Values inside <%=...%> are setted here in the code behind of the page, for the first request (if(!IsPostBack)), then I use ajax to build appropriate requests and to swap the old image with the new returned ones (document.jbox.setimage(newImage.src));

Be sure to read jbox tutorials (you need setbox_handler ecc. as indicated in the tutorial).

Cheers
Piero



> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-
> bounces at lists.osgeo.org] On Behalf Of yatendra
> Sent: martedì 20 maggio 2008 15:06
> To: mapserver-users at lists.osgeo.org
> Subject: [MAPSERVER-USERS] How to implement jBox in asp.netusing C# or
> VB.....
>
>
> Hi Friends,
> i need some help to create rubberband zoom in funtionality.....
> Can any one know hoe to use jBox functionality asp.net <http://asp.net/> .
> or How to create zoom in funtionality using rubberband?
> Please explain..
> Thanks Regards
> --
> View this message in context: http://www.nabble.com/How-to-implement-jBox-
> in-asp.netusing-C--or-VB.....-tp17339858p17339858.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users




-- 
Yatendra Jaiswal
yatendra.jaiswal at gmail.com
+91-9423344396 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080521/bb8c93a9/attachment-0001.html


More information about the mapserver-users mailing list