Bug 668

Summary: [Chameleon-Widget] KeyMapDHTML extents wrong in sample_enhanced
Product: Chameleon Reporter: Paul Spencer <pspencer@dmsolutions.ca>
Component: WidgetAssignee: Paul Spencer <pspencer@dmsolutions.ca>
Status: RESOLVED FIXED    
Severity: major CC: chameleon-dev@lists.maptools.org
Priority: P2    
Version: 1.99   
Target Milestone: 1.99 beta 4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description From 2004-09-14 10:06:02
see bug 462 for initial report.  When viewing the enhanced sample app, the
extents of the keymap are shifted south when in LCC projection.
------- Comment #1 From 2004-09-14 10:06:39 -------
take a look at this for beta 3.
------- Comment #2 From 2004-10-07 14:25:37 -------
as best as I can tell, this works fine.  There doesn't seem to be any shift at
all.
------- Comment #3 From 2004-10-25 16:38:30 -------
Verified on Fedora Core 2 with Chameleon 20041022
------- Comment #4 From 2004-10-26 12:00:44 -------
found the problem(s): :)
* load: http://localhost/chameleon/samples/sample_enhanced.phtml
* Go to Tools tab
* Select Projection button
* Pick a Lat/Long projection from popup.
* Click "OK" button on Popup.

* When new projected map is loaded notice:
================================================
(These are observation along the way to the actual bug, that could be
interpreted as other bugs. Paul may have to comment on these points)
  1) that the extent of the map has changed (it is no longer the extent of
Canada, only a subset) It does not look nice but I am not sure this is fixable
this is a risk of re projecting.
  2) notice that keymap is no longer active (no red rectangle). This makes sense
since the keymap cannot re project its map image or turn the red rectangle to a
curved polygon (that would be cool). The problem here is the keymap looks
broken, when there should be some form of indication of this inactivity.
  3) if the user decides to use the keymap to move around the map. the re
centered map becomes blank.
================================================================================
* ok once loaded with a different projection than the original LCC application
project and have observed the changes to the main map and keymap. 

* You can set the project back to LCC.
* the expected result should be:
 * the extent of the map should be at full extent. Since no map navigation has
occurred between the change of projection (ie. LCC -> Lat/Long -> LCC)
 * the key map should represent this for the LCC projection. Mean the red
rectangle should be at the edges of the keymap view.

This not the case. Please review following issues that I think are the failing
results we are looking for, for this particular bug:
  *  The keymap red tangle is shifted south when the main map view shows an LCC
map of Canada at full extent.
------- Comment #5 From 2004-10-26 12:54:29 -------
in response to Chris' comment above:

1) this is the expected behaviour of the projection widget.  It preserves scale
and center point when changing projection.

2) the keymapdhtml widget in sample_enhanced.html has no SRS so it is unable to
reproject.  It would normally reproject the four corners and then draw a box. 
It's not ideal, but that is how it works.

3) navigation is broken for the same reason, no SRS in the keymapdhtml widget

as for switching back, this happens because you changed to the wrong LCC
projection when switching back (you picked WGS84 / LCC Canada instead of NAD 83
/ NRCan LCC Canada).  Again, this shouldn't happen if you add an SRS to the
keymapdhtml widget because it would reproject for you.

BUT ...

having looked at the code, SRS is an attribute of the widget but is never used
anywhere.  Adding SRS to the widget does not correct the problems so the real
bug here is that the keymapdhtml widget does not support working in reprojected
maps.
------- Comment #6 From 2004-10-27 08:54:06 -------
Darren, I'm chaning this to RC1 since the dynamic keymap is not a basic widget
(in the sense that it is not part of the minimal set of widgets that people
would need to build an application) AND this bug only happens if you change
projections or have a keymap image in a different projection from the map (also
not something that we are putting into the minimal capabilities I think).

But I do want to fix this for 1.99.
------- Comment #7 From 2004-10-27 08:58:02 -------
OK, Chris. No Problem. Thanks.
------- Comment #8 From 2004-11-24 21:09:52 -------
fixed in cvs, but it can produce some wierd looking results.