Get Position of Mouse Cursor on Mouseover of Google Maps V3 API Marker

后端 未结 6 653
名媛妹妹
名媛妹妹 2020-12-01 16:39

I am trying to make a div visible at the position of the cursor when the cursor mouseover a marker using jQuery. Its kind of like a tooltip. However I cannot se

6条回答
  •  [愿得一人]
    2020-12-01 17:11

    Add the following code into the listener function:

    // to display a tooltip:
    marker.setTitle("Hi");
    
    // to get the geographical position:
    var pos = marker.getPosition();
    var lat = pos.lat();
    var lng = pos.lng();
    // ...
    

提交回复
热议问题