Opened 16 years ago

Closed 16 years ago

#678 closed defect (fixed)

Vertical Extent of Rendering Excessive - or Labels 'Apparently' Missing

Reported by: crispinatime Owned by: chrisclaydon
Priority: medium Milestone:
Component: General Version: 2.0.1
Severity: minor Keywords:
Cc: External ID:

Description

Hi,

When rendering a map the vertical extent of the image is way in excess of the map frame display for "small" maps... I think that the image is at least 800px tall.

This can be seen if using a non-tiled map and resizing to a "small" widow of a few hundred pixels. Panning left, right or down will show the background OK. Panning *upwards" will continue to display a lot of map rendered and downloaded off-screen.

I have also seen this when intercepting the image coming from .fcgi, though in some cases the PNG image header defined 800px high but mapping was only created in the top (map-size) of the image and the lower part was blank.

This affects download sizes considerably for small window maps.

Crispin

Change History (9)

comment:1 by crispinatime, 16 years ago

Additional - this occurs with the AGG and GD renderers and you have to make the layout window pretty small (in width) to see the effect.

comment:2 by tomfukushima, 16 years ago

Milestone: 2.1
Version: 2.0.1

Hi Crispin, I assume that this is in 2.0.1 so I've set the version on this ticket to that. Also, which of the viewers does this problem occur in? Fusion or basic or both? Thanks, Tom

comment:3 by crispinatime, 16 years ago

Tom,

I have seen this in MGE 2009 and 2.0.1 (earlier versions not available at present).

This has been with the classic (non-Fusion) layout and using the .net AJAX viewer. When I get back to base I will try the a PHP preview (in Studio) to compare.

To get the effect you need a map width pretty small, such as 100px.

comment:4 by crispinatime, 16 years ago

OK,

What actually is happening is that "mapDevH" in "ajaxmappane.templ" never decreases if a browser window is resized, it only gets bigger. Start with a window of "Y" height, request a map, reduce the height and the map is still rendered to the original (or maximum) "Y" height with potentially huge performance issues if someone maximises a window then restores.

You can see the effect by adding an alert to "ajaxmappane.templ" in the function below. Shame I couldn't actually debug the JavaScript!

<SNIP> function RequestMapImage(reqId) {

alert( " RequestMapImage height " + mapDevH);

<SNIP>

comment:5 by crispinatime, 16 years ago

Summary: Vertical Extent of Rendering ExcessiveVertical Extent of Rendering Excessive - or Labels 'Apparently' Missing

Tom,

There is more - which I think justifies a 2.1 milestone.

Because labels are centred on the map - within a polygon for example - if the user increased the size of a layout and then decreases it the label is centred vertically on the erroneous 'max' Y and will therefore be off-middle and may be off the visible map giving the impression that the label was not generated (but pan-up to see it!).

I was going to add a "labels not always work" ticket until I realised it was a different manifestation of the same issue.

comment:6 by tomfukushima, 16 years ago

Hi Crispin. I deleted the milestone because there is no fix for this problem. If someone supplies a fix that is approved and submitted, I think that setting the milestone to 2.1 sounds good. I find that it doesn't make sense to set the milestone if there's no one to fix the problem in the first place. Tom

comment:7 by cagray, 16 years ago

Hi,

I work at 1Spatial with Crispin and have found a fix for this issue. The issue is caused by the definition of mapDevH in the ajaxmappane.templ file using offsetHeight. This can be resolved by using the clientHeight of the document body instead. This works because the map is in an iframe so the clientHeight refers to the iframe and not the whole browser. Change the code below as follows in ajaxmappane.templ:

in the delayedInit function change:

mapDevH = safari? document.body.clientHeight: mapCell.clientHeight; height of inner elements not set on safari

to:

mapDevH = document.body.clientHeight;

And in the ResizeMapSpace function change:

mapDevH = safari? document.body.offsetHeight: mapCell.offsetHeight;

to:

mapDevH = document.body.clientHeight;

Finally to make this work in all browsers you need to set the vertical alignment of the table cell the map is in:

so:

<td id="map" onmouseout="return ExitMap(event)">

becomes:

<td id="map" onmouseout="return ExitMap(event)" style="vertical-align: top;">

Now when you pan up or down you will see the map get cut off at the map frames top and bottom edges and also if you reduce the height of your map it will resize to the new height instead of rendering the map too large height wise. I tested this in IE6/7, Firefox 3, Opera, Safari and Chrome and it seemed to work fine in each of them.

Thanks Colin

comment:8 by tomfukushima, 16 years ago

Owner: set to chrisclaydon

Hi Chris, will you be able to verify and check this in?

comment:9 by chrisclaydon, 16 years ago

Resolution: fixed
Status: newclosed

Submitted Colin's fix to trunk: http://trac.osgeo.org/mapguide/changeset/3728

Tested on Windows XP with Safari 3, IE 7, Firefox 3, Google Chrome and Opera 9.6.

Note: See TracTickets for help on using tickets.