Hi all!!!
I have 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 don't work. The pop-up of my marker don't appear. There is any
trouble with that?
Thanks!!!
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users