OpenLayers OpenLayers

Ticket #415 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

The OpenLayers.Feature fails on showing a popup

Reported by: penyaskito Assigned to: euzuro
Priority: minor Milestone: 2.3 Release
Component: Popup Version:
Keywords: approved Cc:
State:

Description

When we click on a feature, it doesn't show the popup.

Event thread: mousedown
Error:
name: TypeError
message: Statement on line 682: Could not convert undefined or null to object
Backtrace:
  Line 682 of linked script http://localhost:2653/Extranet/Website/Georreferenciacion/OpenLayers/lib/OpenLayers/BaseTypes.js
    opp += quadrant.charAt(0) == "t" ? "b" : "t";
  Line 158 of linked script http://localhost:2653/Extranet/Website/Georreferenciacion/OpenLayers/lib/OpenLayers/Popup/AnchoredBubble.js
    var corner = OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);
  Line 130 of linked script http://localhost:2653/Extranet/Website/Georreferenciacion/OpenLayers/lib/OpenLayers/Popup/AnchoredBubble.js
    var corners = this.getCornersToRound(this.relativePosition);
  Line 75 of linked script http://localhost:2653/Extranet/Website/Georreferenciacion/OpenLayers/lib/OpenLayers/Popup/AnchoredBubble.js
    this.setRicoCorners(! this.rounded);
  Line 254 of inline#4 script in http://localhost:2653/Extranet/Website/Georreferenciacion/Default.aspx
    popup.setSize(new OpenLayers.Size(250, 150));
  Line 282 of linked script http://localhost:2653/Extranet/Website/Georreferenciacion/OpenLayers/lib/OpenLayers/Events.js
    continueChain = callback.func.call(callback.obj, evt);
  Line 310 of linked script http://localhost:2653/Extranet/Website/Georreferenciacion/OpenLayers/lib/OpenLayers/Events.js
    this.triggerEvent(evt.type, evt);
  Line 886 of linked script http://localhost:2653/Extranet/Website/Georreferenciacion/OpenLayers/lib/OpenLayers/BaseTypes.js
    return __method.call(object, event || window.event);

Attachments

featurepopup.html (1.9 kB) - added by penyaskito on 11/19/06 08:44:57.
An example where it fails
popup.patch (0.8 kB) - added by crschmidt on 11/19/06 14:42:03.

Change History

11/19/06 08:44:57 changed by penyaskito

  • attachment featurepopup.html added.

An example where it fails

11/19/06 09:30:16 changed by crschmidt

Okay, this one's a mess. Apparently, it's broken in FF, Opera, and IE on Windows -- but it's not broken in Firefox, Opera or Safari on Mac.

I'm not quite sure how we managed to create a windows-only bug, but it seems we did.

11/19/06 14:41:37 changed by crschmidt

AnchoredBubbles and setSize currently don't work correctly. patch incoming.

11/19/06 14:42:03 changed by crschmidt

  • attachment popup.patch added.

11/19/06 14:46:28 changed by crschmidt

  • keywords set to review.

So, in rearranging the Popup code, I mistakenly didn't test setting size before the map is set. Because setting the size calls redrawRicoCorners (which requires quadrant information) it requires the map before calling it.

If the popup hasn't yet been added ot the map, we can just depend on the draw() function to draw correctly when the popup is added.

Also fix not properly setting the contentDiv width, which caused broken visual affects on the popups.

11/19/06 20:02:13 changed by sderle

  • keywords changed from review to approved.

patch seems reasonable. please commit to trunk!

11/19/06 20:12:25 changed by crschmidt

  • status changed from new to closed.
  • resolution set to fixed.

Commited in r1935.