Is there a way to Fix a Google Maps Marker to the Center of its Map always?

前端 未结 7 1312
野趣味
野趣味 2020-12-01 00:21

To be more precise, what I try to accomplish is that while I Drag a Google Map there\'s a Google Maps Marker that stays fixed

相关标签:
7条回答
  • 2020-12-01 00:58

    You can use google map drag event:

    google.maps.event.addListener(map, 'dragend', function() {
        marker.setPosition(map.getCenter()); 
    } );
    
    0 讨论(0)
提交回复
热议问题