"Mouseover" event not detecting feature
See original GitHub issueHi,
I’m not sure if I’m doing this wrong, but it looks like the GetMapInfo() isn’t detecting features on the mouse-over callback. So as a test, using the WPF example, specifically the MapInfo sample. I modified the MouseMove method to this:
private void MapControlOnMouseMove(object sender, MouseEventArgs e)
{
var screenPosition = e.GetPosition(MapControl);
var worldPosition = MapControl.Viewport.ScreenToWorld(screenPosition.X, screenPosition.Y);
var mapInfo = MapControl.GetMapInfo(worldPosition);
var isFeature = mapInfo.Feature != null;
MouseCoordinates.Text = $"{worldPosition.X:F0}, {worldPosition.Y:F0}, isFeature={isFeature}";
}
I’m trying to have it so if you mouse over a certain feature, it will add a feature to another layer showing a popup with some text. IsMapInfoLayer is set to true.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Mouseover Event not working well with overlaid objects
I am trying to create mouseover tooltip effects on the graph created by d3. The circle is on top of the line. The...
Read more >mouseover event is not firing on element on which written
1 Answer. I found the solution. I used mouseenter event instead of mouseover and it worked.
Read more >Mouse-over events not working when window is in focus
The problem has been resolved. It turns out the Dijit Popup was interfering with mouseover event, but only when the window was focused...
Read more >Element: mouseover event - Web APIs | MDN
The mouseover event is fired at an Element when a pointing device (such as a mouse or trackpad) is used to move the...
Read more >mouseover event | jQuery API Documentation
A function to execute each time the event is triggered. This page describes the mouseover event. For the deprecated .mouseover() method, see .mouseover()...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

That is because the WPF Point needs to be converted to a Mapsui Point.
Be careful, this may impact performance.
Summary:
ILayer.IsMapInfoLayer = true;.