
We don’t strictly need to use this function to get the coordinates, because getRelationToCanvasPoint returns these as well, but this is sort of a double check. When we know the total distance to the point on the track we can get the coordinates of this point by the getPathPoint method. We multiply this value by line segment length (obtained by getPathLengthToElement method) and add that value to the total path length to the segment (also obtained by getPathLengthToElement). This information contains the distance property which has values from 0 (line segment start) to 1 (line segment end). To get a precise location and distance of the cursor on the track we use the getRelationToCanvasPoint method, which returns information where the cursor is located on the line segment.

Note that the style layer of the feature needs to have the property ‘advanced-hit’ = true for this to work. Upload your GPX data (widely used in software like OziExplorer, Google Earth and GPS devices) and convert them by one click to AutoCAD (DXF) format (widely used in software like AutoCAD, CorelDraw, 3d Studio Max and Maya).

The function onFeatureHover is called with an event parameter that contains - among others - a property named ‘element’ which is the index of the line segment we are hovering over. What is next? We have to figure out over which part of the track is the cursor hovering. Now we have the callback function onFeatureHover which is called when the cursor hovers over the track. When the cursor leaves the map we pass ‘false’ to stop generating hover events. Recently Popular Artikutza, entre millones de rboles Arco de Piedrafita Atago mountain hiking Bototillo 2021 Task 1 Pampoenfontein to Calvinia Bulls GPS. We need to generate hover events even when the cursor is not moving, which is what the parameter does when its value is ‘true’. You are probably wondering about the third parameter in the ‘hover’ method.

on ( 'mousemove', onMouseMove ) mapElement.
