2

I want to display the leaflet pop up on the right or left side of the mouse pointer. By default it is displayed on the top of the mouse pointer.

how can I do that?

The demo is available here: http://jsfiddle.net/Wn5Kh

<!DOCTYPE html>
<html>
    <head>
        <title>CircleMarker tooltip</title>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="http://leafletjs.com/dist/leaflet.css" />
        <!--[if lte IE 8]>
            <link rel="stylesheet" href="http://leafletjs.com/dist/leaflet.ie.css"
            />
        <![endif]-->
    </head>

    <body>
        <div id="map" style="width: 600px; height: 400px"></div>
        <script src="http://leafletjs.com/dist/leaflet.js"></script>
    </body>
</html>
Arseni Mourzenko
  • 50,338
  • 35
  • 112
  • 199
jones
  • 1,423
  • 3
  • 35
  • 76

1 Answers1

1

In leaflet.css you can change:

.leaflet-popup {
position: absolute;
text-align: center;
}

Try to play around with the position and you will see that you can change where the popup will be opened.

Marko Letic
  • 2,460
  • 2
  • 28
  • 34