Bug 398 - [Chameleon - Widget] KeyMapDHTML2 error when aspect ratio differs from map
: [Chameleon - Widget] KeyMapDHTML2 error when aspect ratio differs from map
Status: CLOSED FIXED
: Chameleon
Widget
: 1.99
: PC Windows XP
: P2 normal
: 2.0 RC 1
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2004-05-20 22:10 by
Modified: 2004-07-05 10:30 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-05-20 22:10:26
Reported by Bart.

Note none of the sample templates test this case, propose to modify one of the
samples to test this and to have a test for it in the future.

> Hi list,
> 
> I have a problem with the KeyMapDHTML2 widget. The box indicated on the
> key map is not correct when the pixel width/height proportions differ
> between KeyMap and MapDHTMLWidget.
> 
> My MapDHTML widget has the following dimensions: width 800 height 560
> 
> My key map has the following dimensions:
> 
> <cwc2 type="KeyMapDHTML2"
> image="C:/ms4w/apps/geoservices05/htdocs/images/nederland.png" SRS="28992"
> WIDTH="135" HEIGHT="157" MINX="20000" MAXX="285000" MINY="305000"
> MAXY="620000" />
> 
> Is this to be considered a bug in the KeyMap, or is this by design? I.e.
> should all applications use a key map in the same proportions as the main
> map?
------- Comment #1 From 2004-05-20 22:10:51 -------
look at this after the beta
------- Comment #2 From 2004-06-17 06:11:25 -------
Paul,

any news on this one? We would need this one before the end of June. If it 
needs some funding to get it fixed, let me know.

Bart
------- Comment #3 From 2004-06-17 22:24:28 -------
Bart I think I have this problem fixed, can you update the KeyMapDHTML2 widget
and retest ...
------- Comment #4 From 2004-06-18 04:16:27 -------
Hi Paul,

I checked this one, but it still has problems.

The main problem is that the width and height ratio from the box drawn in the 
keymap widget, are the width and height ratio from the keymap dimensions, and 
not from the main map dimension.

You can see the behaviour in action at:
http://www.vz.geodan.nl:1112/geoservices05/index.phtml

In my demo the box in the keymap should be a lot wider than it is. I think when 
it is wider, it will be right, also with regard to the position.

Bart
------- Comment #5 From 2004-06-18 11:54:30 -------
Bart, I have come to realize that the KeyMapDHTML2 widget is missing a fairly
important capability.  The attribute list includes minx, miny, maxx, maxy and
SRS, but these values are never used in the code.

The problem I fixed before made navigation on the keymap seem to work correctly,
but now I am not entirely sure.  The navigation code does not take into
consideration the extents of the keymap and the SRS of the keymap.

This means that the widget only works correctly when the keymap extents and SRS
match the map's extents ... I believe that it is correctly accomodating aspect
ratio differences, but not geographic differences.

This is a non-trivial amount of work to fix.
------- Comment #6 From 2004-06-22 04:00:59 -------
I changed my Chameleon MAP EXTENT values to match the minx, maxx, miny, maxy
values of my reference image. Also, the SRS of both are the same (EPSG:28992).

The problem still exists though.

Extent in MAP file:
  EXTENT 20000 285000 305000 620000
  SIZE 800 560

<cwc2 type="KeyMapDHTML2"
image="C:/ms4w_20/apps/geoservices05/htdocs/images/nederland.png" SRS="28992"
WIDTH="135" HEIGHT="157" MINX="20000" MAXX="285000" MINY="305000" MAXY="620000" />

Size of the MapDHTMLWidget is also 800 by 560 pixels.
------- Comment #7 From 2004-06-29 14:15:38 -------
I have fixed this to calculate the bbox to the correct aspect ratio, cvs has
been updated.  I am not marking this as fixed because in my testing I may have
ran accross another issue with the same symptoms.

Bart can you please see if my fix solves your problem?
------- Comment #8 From 2004-06-30 06:59:13 -------
OK, I tracked down the additional problem I was having.  When chameleon was
drawing the bbox on the keymap it was also using the map height and width ratio
instead of the reference map height and width ratio.  Fixed in CVS.  Everything
seems to be working now.
------- Comment #9 From 2004-07-05 09:59:50 -------
Verified with CVS. Works swell now.
------- Comment #10 From 2004-07-05 10:30:50 -------
Closing bug