Ticket #300 (new defect)

Opened 2 years ago

Last modified 2 years ago

zooming in and selecting a note from the history view results in the icon not being displayed

Reported by: sbenthall Owned by: (openlayers)
Priority: major Milestone: 1.0 Initial
Component: FrontEnd.History Keywords:
Cc: tschaub

Description (last modified by sbenthall) (diff)

http://trac.openplans.org/openplans/ticket/2380

"if one is on a high zoom level and one selects a node from the history view (which is presumedly off the current map), the location of the note and the pop-up is displayed, but the icon for the note will not be shown. this doesn't seem to occur completely consistently, but this is the usual case when one is in the three most magnified zoom levels."

Attachments

spherical-svg-test.html (3.5 kB) - added by sbenthall 2 years ago.
OL trunk example that demonstrates the problem (I think)

Change History

  Changed 2 years ago by sbenthall

  • description modified (diff)

  Changed 2 years ago by sbenthall

  • owner set to sbenthall
  • status changed from new to assigned

  Changed 2 years ago by sbenthall

  • cc tschaub added

It looks like something's up with the rendering in this situation. This is what the HTML for the WFSV layer looks like

{{{<div id="Vespucci.Feature.WFSFilterLayer_6" class="olLayerDiv" style="position: absolute; width: 100%; height: 100%; z-index: 749; left: -14208px; top: 16672px;"> <svg id="Vespucci.Feature.WFSFilterLayer_6_svgRoot" width="1432" height="641" viewBox="-14208 16672 1432 641"> <g id="Vespucci.Feature.WFSFilterLayer_6_root" style="visibility: visible;"> <image id="OpenLayers.Geometry.Point_802_background" x="NaN" y="NaN" width="30" height="30" href="./Vespucci/Theme/img/shadow.png" style="opacity: 1;" fill="#ee9900" fill-opacity="0" stroke="#ee9900" stroke-opacity="0" stroke-width="1" stroke-linecap="round" pointer-events="visiblePainted"/> <image id="OpenLayers.Geometry.Point_802" x="NaN" y="NaN" width="30" height="30" href="./Vespucci/Theme/img/kids.png" style="opacity: 1;" fill="#ee9900" fill-opacity="0" stroke="#ee9900" stroke-opacity="0" stroke-width="1" stroke-linecap="round" pointer-events="visiblePainted"/> </g> </svg> </div>}}}}

Notice that the (x,y) values of both of these vector graphics is NaN, even though the appropriate src image urls are being assigned to them. That's pretty wild!

CCing tschaub just to ask: have you ever seen anything like it?

  Changed 2 years ago by sbenthall

Fixing the formatting on this.

<div id="Vespucci.Feature.WFSFilterLayer_6" class="olLayerDiv" style="position: absolute; width: 100%; height: 100%; z-index: 749; left: -14208px; top: 16672px;">
    <svg id="Vespucci.Feature.WFSFilterLayer_6_svgRoot" width="1432" height="641" viewBox="-14208 16672 1432 641">
        <g id="Vespucci.Feature.WFSFilterLayer_6_root" style="visibility: visible;">
            <image id="OpenLayers.Geometry.Point_802_background" x="NaN" y="NaN" width="30" height="30" href="./Vespucci/Theme/img/shadow.png" style="opacity: 1;" fill="#ee9900" fill-opacity="0" stroke="#ee9900" stroke-opacity="0" stroke-width="1" stroke-linecap="round" pointer-events="visiblePainted"/>
            <image id="OpenLayers.Geometry.Point_802" x="NaN" y="NaN" width="30" height="30" href="./Vespucci/Theme/img/kids.png" style="opacity: 1;" fill="#ee9900" fill-opacity="0" stroke="#ee9900" stroke-opacity="0" stroke-width="1" stroke-linecap="round" pointer-events="visiblePainted"/>
        </g>
    </svg>
</div>

  Changed 2 years ago by sbenthall

So, I think I've isolated it down to this line in the SVG renderer. The problem is that the numbers are just too crazy--my guess because the resolution is too small.

We get this problem when this.inValidRange(x, y) returns false in this code below:

drawCircle: function(node, geometry, radius) {
    var resolution = this.getResolution();
    var x = (geometry.x / resolution + this.left);
    var y = (this.top - geometry.y / resolution);

    if (this.inValidRange(x, y)) {
        node.setAttributeNS(null, "cx", x);
        node.setAttributeNS(null, "cy", y);
        node.setAttributeNS(null, "r", radius);
    } else {
        if (node.parentNode == this.root) {
           this.root.removeChild(node);
        }
    }

 },}}}

Here is the code for inValidRange :

{{{
    inValidRange: function(x, y) {
        return (x >= -this.MAX_PIXEL && x <= this.MAX_PIXEL &&
                y >= -this.MAX_PIXEL && y <= this.MAX_PIXEL);
    },
}}}

This MAX_PIXEL business is apparently a hack around a firefox bug.

{{{
    /**
     * Constant: MAX_PIXEL
     * {Integer} Firefox has a limitation where values larger or smaller than  
     *           about 15000 in an SVG document lock the browser up. This 
     *           works around it.
      */
    MAX_PIXEL: 15000,
}}}

That's frustrating.

follow-up: ↓ 7   Changed 2 years ago by sbenthall

It turns out that the icon here isn't not on the map. It is getting put by the SVG renderer into the upper left corner of the SVG panel.

in reply to: ↑ 6   Changed 2 years ago by tschaub

Replying to sbenthall:

It turns out that the icon here isn't not on the map. It is getting put by the SVG renderer into the upper left corner of the SVG panel.

I think I understand what you're saying. If so, then you should find a fix for it in the OL trunk. Let's talk tomorrow.

  Changed 2 years ago by sbenthall

"I think I understand what you're saying. If so, then you should find a fix for it in the OL trunk. Let's talk tomorrow."

Right -- I mentioned this to you yesterday, I think, and I already have brought in that fix.

But now I think the features are not showing up at all, as opposed to in the corner of the renderer. I need to double check on that though.

  Changed 2 years ago by sbenthall

I've got a new example to show this using the OL trunk--should run it by tschaub ASAP.

Changed 2 years ago by sbenthall

OL trunk example that demonstrates the problem (I think)

  Changed 2 years ago by sbenthall

tschaub, OL action hero, has reopened the relevant OL ticket:

http://trac.openlayers.org/ticket/1360

  Changed 2 years ago by sbenthall

  • owner sbenthall deleted
  • status changed from assigned to new

Now the relevant ticket is here: http://trac.openlayers.org/ticket/1431

  Changed 2 years ago by sbenthall

  • owner set to (openlayers)
Note: See TracTickets for help on using tickets.