[mapserver-users] imgbox works on Netscape but not Internet E xplorer

Hockaday, John JohnHockaday at auslig.gov.au
Thu Jun 21 17:01:12 PDT 2001


HI Steve,

Thanks for the reply.  Yes I am not using an applet.  Apparently some
Australian organisations still don't allow java through their firewalls so I
have some javascript code that uses <layer> and <div> tags to allow the user
to drag a box on the map.  I *borrowed* the drag box code off an Australian
Coastal Atlas interface which is a project that I use to work on at another
organisation.  When I make this public I will advertise it's URL on this
list.

Rob Ellis and I have been discussing a solution off the list and I seem to
have it working.  I removed the image map as an input type and used
javascript to submit the form thus removing the img.x and img.y submission
by image map.  This works well.  I have attached the email conversations
between Rob and myself at the end of this email if anyone is interested.

Thanks again for the help.  I have added some defaults to my imgbox values
as you suggested.  Still need to test some more.

John Hockaday

> -----Original Message-----
> From:	Stephen Lime [SMTP:steve.lime at dnr.state.mn.us]
> Sent:	Friday, June 22, 2001 3:46 AM
> To:	JohnHockaday at auslig.gov.au; mapserver-users at lists.gis.umn.edu
> Cc:	MeganWatson at auslig.gov.au
> Subject:	Re: [mapserver-users] imgbox works on Netscape but not
> Internet Explorer
> 
> What sort of javascript are you using? I mean, your not using an applet
> correct?
> That means you're using layers or something like that. Seems to me that
> you could
> just rename the image your dragging on to something other than "img". IE
> will still
> send the .x and .y but MapServer will not process them unless they are
> called
> img.x and img.y. You should also provide better defaults for the hidden
> vars. Use
> a center point for the image for imgxy and -1 -1 -1 -1 for imgbox.
> 
> Steve
> 
> Stephen Lime
> Internet Applications Analyst
> 
> Minnesota DNR
> 500 Lafayette Road
> St. Paul, MN 55155
> 651-297-2937
> 
	Email conversations between Rob Ellis and John Hockaday discussing a
solution:

Hi Robin,

I couldn't stand the suspense of waiting so I applied what you said.  It
works well.  Thanks for all your suggestion.

John

	-----Original Message-----
	From:	Robin.Ellis at dnr.qld.gov.au [SMTP:Robin.Ellis at dnr.qld.gov.au]
	Sent:	Wednesday, June 20, 2001 3:35 PM
	To:	JohnHockaday at auslig.gov.au
	Subject:	RE: [mapserver-users] imgbox works on Netscape but
not Internet E explorer

	I think you're very wise to wait and see if there's an easier
solution.

	You're also right in assuming that yuo'll still need the <form> with
hidden
	variables if you do go along this javascript path. I access these
from
	elements through the javascript and use their values in the URL
string that
	I build. You can emulate the same by accessing the appropriate form
	variables, updating the values and them form.submit() the whole lot.
With
	luck, by making your map image a static non-form element you won't
get the
	annoying img.x and img.y variables in the way.

	The only other problem with using DHTML for the drag box could be
the way
	different browsers 'render' the DHTML layers. I find that for NS4.x
and NS6
	I need to actually move my x and y coordinates of mouse clicks by a
few
	pixels to ensure that all users get the same results returned for
what
	appears visually to be the same command.

	Let me know how you get on

	Rob

	-----Original Message-----
	From: Hockaday, John [mailto:JohnHockaday at auslig.gov.au]
	Sent: Wednesday, 20 June 2001 3:06 PM
	To: 'Robin.Ellis at dnr.qld.gov.au'; Hockaday, John
	Subject: RE: [mapserver-users] imgbox works on Netscape but not
Internet
	E explorer


	Hi Robin,

	Thanks for your suggestions.  I use DHTML to do the drag box and I
guess I
	could remove the input type=image to get rid of the img.x and img.y
values
	from being generated.  (As you guessed I use the [img] as a form
input.)

	If I do this I *think* that I will still need the HTML form and the
	mapserver input type=hidden values so that on submit the mapserv
cgi-bin
	script is called.  Is this so?

	I don't see a problem in writing the javascript to do this
allocation of
	form elements however, I will wait a day or two to see if someone
else comes
	up with another suggestion.  That's not saying that your suggestion
is
	wrong, it just means that I may be able to save myself some coding
time if
	someone else comes up with a *quicker* suggestion.

	Thanks for your quick response.

	John

	> -----Original Message-----
	> From:	Robin.Ellis at dnr.qld.gov.au [SMTP:Robin.Ellis at dnr.qld.gov.au]
	> Sent:	Wednesday, June 20, 2001 10:42 AM
	> To:	JohnHockaday at auslig.gov.au
	> Subject:	RE: [mapserver-users] imgbox works on Netscape but
not
	> Internet E xplorer
	> 
	> John,
	> 	I use a lot of javascript in the DHTML & frames system I've
got
	> established. The advantage that this set up gives me is that to
send a
	> request to Mapserver I build a complete URL string with javascript
	> including
	> only the components that I want mapserver to process. In this way
I can
	> 'leave out' form elements like imgxy and only include an imgbox
element
	> with
	> the appropriate coordinates. This works well for me.
	> 
	> However, I'm assuming that you're using your map image as a form
input,
	> and
	> this is where Mapserver is picking up img.x and img.y from. I
don't think
	> you'll be able to stop this without making your map image a static
image,
	> removed from all form inputs. Of course, if you do this yuo'll
have to
	> find
	> new ways of picking up img.x and img.y for normal poiny queries
and zooms
	> etc, and this leads you back down the DHTML path.
	> 
	> This probably hasn't been much use to you, but I thought I'd throw
you in
	> my
	> 2 cents anyway. Hopefully somebody else on the list will have a
solution
	> that is a lot easier to implement.
	> 
	> Regards
	> 
	> Rob

> >>> "Hockaday, John" <JohnHockaday at auslig.gov.au> 06/19/01 07:08PM >>>
> Hi all,
> 
> I am using some javascript that sets the imgbox variable after a user
> drags a box 
> across the mapserver image.  This is then submitted to mapserv.  The drag
> box 
> seems to work on both Internet Explorer (IE) and Netscape but for some
> reason 
> IE seems to pass the img.x and img.y variables to mapserv in the query
> string 
> and so, instead of zooming to the defined box (as Netscape does), mapserv 
> uses the img.x and img.y values to execute either zoom in, pan or zoom out
> 
> according to which radio button has been selected by the user.   Thus
> Netscape 
> zooms in to the defined box are but IE zooms in, pans or zooms out.
> 
> Has anyone else observed this problem and if so were you able to solve it?
> 
> I am using MapServer Version 3.3.011 -FreeType -TIFF -EPPL7 -JPEG on a 
> Sun Solaris 2.6 UNIX box with Apache 1.3.12 as the web server.  The
> browsers
> are Netscape Communicator 4.77 and Internet Explorer version
> 5.00.2314.1003.
> 
> My code to set the imgbox is as follows:
> 
> Within the form I have:
>    <input type="hidden" name="imgxy" value="">
>    <input type="hidden" name="imgbox" value="">
>    <input type="hidden" name="imgext" value="[mapext]">
>    <input type="hidden" name="map" value="[map]">
> 
> Within the javascript I have:
>    document.mapserv.imgxy.value = "";
>    document.mapserv.imgbox.value = tx1 + " " + ty1 + " " + tx2 + " " +
> ty2;
>    document.mapserv.submit();
> 
> Thanks for any help or direction that you can give me.
> 
> John



More information about the MapServer-users mailing list