Hi all!!!
I had this function, in order to, add markers to my map.
function addMarker(ll, popupClass, popupContentHTML, closeBox, overflow) {
var feature = new OpenLayers.Feature(markers, ll);
feature.closeBox = closeBox;
feature.popupClass = popupClass;
feature.data.popupContentHTML = popupContentHTML;
feature.data.overflow = (overflow) ? "auto" : "hidden";
var marker = feature.createMarker();
var size = new OpenLayers.Size(25,25);
var offset = new OpenLayers.Pixel(-12, -24);
var icon = new
OpenLayers.Icon('http://www.openlayers.org/dev/img/marker-blue.png', size,
offset);
marker.icon = icon;
var markerClick = function (evt) {
if (this.popup == null) {
this.popup = this.createPopup(this.closeBox);
map.addPopup(this.popup);
this.popup.show();
} else {
this.popup.toggle();
}
currentPopup = this.popup;
OpenLayers.Event.stop(evt);
};
marker.events.register("mousedown", feature, markerClick);
markers.addMarker(marker);
}
I have a problem with the icon of the marker. If I put an icon the event
mousedown dont work. The pop-up of my marker don't appear. There is any
trouble with that?
Thanks!!!
Carlos Domínguez
Área de Proyectos
Tfno: +34 948312156
www.geoactio.com <http://www.geoactio.com/>
Polígono Industrial Mocholi
Edificio CEIN, Nave A2
31110 Noáin (Navarra) SPAIN
La información que contiene este correo electrónico es confidencial. Si Vd.
ha recibido esta comunicación por error, por favor notifíquelo
inmediatamente al remitente y bórrelo. Antes de imprimir este mensaje,
asegúrese de que es necesario. El medio ambiente está en nuestra mano.
The information contained in this electronic mail is confidential. If you
have received this mail by error, please immediately notify the sender and
delete it. Please, consider the environment and do not print this email
unless it is absolutely necessary.
<<image003.jpg>>
<<image004.jpg>>
_______________________________________________ Dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-dev
