Custom mouseover on a layer

The mouseover is a popup window that is displayed after clicking on features on the map.

If no mouseover content is set in the layer configuration, no popup is displayed when clicking on a feature of that layer.

You can set your own mouseover content programatically in Javascript. For instance, you can add a mouseover on a layer that has no mousoever content in its configuration.

In the following example, the layer "Hydrography", id=3, has no mouseover defined.

We will set a custom mouseover content that:

  • Always displays a custom header

  • Displays the mouseover content for a clicked hydrography feature

  • Avoids displaying a mouseover for the "Event" layer (blue dots on the map)

  • Always displays a custom footer

Set the custom mouseover

Try it out in Codepen.io

Mis à jour