I found a problem that only shows up in IE and Firefox.
I can no longer mouseover a marker to get it to popup, after I call Map1.SetDrawMode() with any mode.
To duplicate the problem, add the following code in Page_Load() of Samples/MapShapes/DrawEditShapes.aspx.cs
InMemoryMarkerOverlay markerOverlay = new InMemoryMarkerOverlay(“Markers”);
markerOverlay.FeatureSource.Open();
markerOverlay.Columns.Add(new FeatureSourceColumn(“LABEL”));
markerOverlay.FeatureSource.Close();
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.AutoSize = true;
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.ContentHtml = “[#LABEL#]”;
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.HasCloseButton = true;
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.Width = 100;
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.Height = 30;
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.BackgroundColor = GeoColor.StandardColors.LightBlue;
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.BorderColor = GeoColor.StandardColors.LightBlue;
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.BorderWidth = 1;
markerOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Vertex vertex = new Vertex(-116.9, 34.2);
markerOverlay.Features.Clear();
markerOverlay.Features.Add(“School”, new Feature(vertex, “SCHOOL”, new string[] { “LABEL:” + “POPUP_CONTENT” }));
Map1.CustomOverlays.Add(markerOverlay);
Run the project, mouseover the marker, should work fine.
Then click on the Normal tracking mode button, then try to mouseover the marker.
In IE6, you can sometimes still get the popup working, but the mouseover area has shrunk down and is in the bottom left corner of the marker.
UPDATE: In IE6, you can mouseover in the bounding box of the marker, just not over the marker itself
In FF3, you can’t get the popup to work at all.
In both Chrome and Safari, popup works fine
Thanks,
Rob
InMemoryMarkerOverlay hover stops working after Map1.SetDrawMode()
Hi Rob,
We did some researchs on this issue and find this issue is caused by the browser. In IE6 and Firefox 3, the transparent div on the top prevent the event raising which hooks on the DOM tree node below. Please see the attached small demo. We tried to change the z-index of the overlays order, but unfortunately, OpenLayers creates a blank div on top of the map for drawing no matter we have created or not. I think we can only ensure that when you changed the draw mode to "Normal", the hover popup works fine; but no more further.
Please let me know if you want this feature integrated.
Thanks,
Howard
1625-demo.zip (257 Bytes)
Yes that would be great to have them function at least in Normal mode. Looks like Openlayers is aiming to work best on Webkit based browsers. Is there a temp script fix I could use in the meantime before the feature gets integrated? I tracked this down as the root of a lot of my users complaints, and would love to be able to fix it this week
Rob,
No problem, here is a workaround; and it will be integrated in the next release. Please attach the following code in the header tag.var tgMap = null;
var ResetLayerZIndex = function() {
//layers:0-100
//vectors:100-200
//markers:200-300
var layers = tgMap.layers;
for (var i = 0; i < layers.length; i++) {
var layer = layers[i];
if (layer.CLASS_NAME == 'OpenLayers.Layer.Vector') {
layer.setZIndex(100 + i);
} else if (layer.CLASS_NAME == 'OpenLayers.Layer.Markers' || layer.CLASS_NAME == 'OpenLayers.Layer.Markers.DragMarkers') {
layer.setZIndex(200 + i);
} else {
layer.setZIndex(i);
}
}
};
var OnMapCreated = function(map) {
tgMap = map;
};
When you call "Map1.SetDrawMode('Normal')", please call ResetLayerZIndex() after setting the draw mode. Also, you can replace the function to the following function.var SetCurrentMode = function(mode) {
Map1.SetDrawMode(mode);
ResetLayerZIndex();
}
Hope it satisfies your requirement.
Thanks,
Howard
Thanks Howard, works perfect!
Rob,
Great; please feel free to let us know if you have more questions.
Thanks,
Howard