OpenLayers OpenLayers

Ticket #422 (closed task: fixed)

Opened 2 years ago

Last modified 2 years ago

Problems with the inner HTML in a popup

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

Description

The inner HTML in a popup doesn't fill the popup width. Maybe it is related to ticket #415.

A sample of code:

function mousedown2420(evt) {
if (popup == null) {
popup = new OpenLayers.Popup(12,new OpenLayers.LonLat(-6.46290125648768, 36.99115125809158),new OpenLayers.Size(150, 100),'<b>Mancha de las Baquetas</b>');
popup.setBackgroundColor('Yellow');
popup.setOpacity(0.75);
popup.setContentHTML('<b>Mancha de las Baquetas</b><br />Boixo: Por la carretera a la altura de la Bagueta. EN MAPA ICONA SE VE, AL N DE LA CARRETERA, ENTRE SAN AGUSTÍN Y CURVA DE SANTA OLALLA: LAS BAQUETAS');
popup.setSize(new OpenLayers.Size(250, 150)); //<--- I'm sure this is the problem again.
markers.map.addPopup(popup);
} else {
markers.map.removePopup(popup);
popup.destroy();
popup = null;
}
Event.stop(evt);
}

Attachments

popupfailed.PNG (70.4 kB) - added by openlayers on 11/20/06 12:21:02.
A screenshot showing the problem.
popup.patch (463 bytes) - added by openlayers on 11/20/06 12:39:31.
A patch that solves the problem

Change History

11/20/06 12:21:02 changed by openlayers

  • attachment popupfailed.PNG added.

A screenshot showing the problem.

11/20/06 12:39:31 changed by openlayers

  • attachment popup.patch added.

A patch that solves the problem

11/20/06 12:40:51 changed by openlayers

The problem was no updating the innerDiv (which contains the text) on the Popup::setSize method.

Today is a great day, it's my first source code patch to an open source project :)

11/20/06 12:52:36 changed by crschmidt

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

Fixed in r1940. Thanks!

11/21/06 04:29:53 changed by euzuro

  • status changed from closed to reopened.
  • resolution deleted.

this patch breaks a couple of tests in test_Popup.html. got to remember to run tests before committing to trunk (preferably in FF && IE, but at least in one!)

12/06/06 16:24:35 changed by crschmidt

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

I fixed the tests on this -- they were broken before.