Opened 14 years ago

Closed 14 years ago

#1493 closed defect (fixed)

Resize window caused dynamic layers disappear if the map with Base layers in Chrome/Safari

Reported by: yangte Owned by: yangte
Priority: medium Milestone:
Component: AJAX Viewer Version: 2.2.0
Severity: major Keywords: resize
Cc: External ID: 1356304

Description

Steps:

  1. Create one map and add one dynamic layer
  2. Add one base layer group with base layer(important)
  3. New basic web layout with the new map.
  4. Open the web layout in Chrome/Safari.
  5. Resize the window

Results: Only base layers will be shown in the map.

Attachments (1)

Fix Ticket 1493.patch (388 bytes ) - added by yangte 14 years ago.

Download all attachments as: .zip

Change History (3)

by yangte, 14 years ago

Attachment: Fix Ticket 1493.patch added

comment:1 by yangte, 14 years ago

When the map has base layer group, the ajaxviewer will hide the dynamic map image div first.

function HideMapImage()
{
    if(!HasVisibleBaseGroups())
        return;
    document.getElementById("img1").style.display = "none";
}

In the code for IE/Firefox, the Ajax viewer will unhide the map image div:

function OnMapOverlayImageLoaded(e)
{
...
var imgdiv = document.getElementById("img1");
...
    {
        img.src = overlayimg.src;
        img.style.position = "absolute";
        img.style.visibility = "visible";
        img.style.width = mapDevW;
        img.style.height = mapDevH;
        img.style.left = 0;
        img.style.top = 0;
    }
    imgdiv.style.display = "block";
...
}

However, in the code for Chrome/Safari, someone forgot to unhide the map image div:

function OnAlternateImageLoaded()
{
...	
    // Show the newly loaded image
    img.style.position = "absolute";
    img.style.visibility = "visible";
    img.style.width = mapDevW;
    img.style.height = mapDevH;
    img.style.left = 0;
    img.style.top = 0;
 ...
}

so the solution is to simply unhide the div.

comment:2 by liuar, 14 years ago

Milestone: 2.3
Resolution: fixed
Status: newclosed

The patch looks good to me. I've submitted the code. Changeset [5325] by liuar

Note: See TracTickets for help on using tickets.