How to make Custom Overlays draggable using google-maps v3

the marker can drag, so custom add-ins can drag,

how to make Custom Overlays draggable,

thank

+1
source share
2 answers

I recently put together a solution on a similar thread, which is also very relevant to this issue:

Here's another thread. Shows how to create a custom overlay in V3 with a draggable object.

Here is a working example:    http://www.johnmick.net/drag-div-v3/

Here are some of the sources:    http://www.johnmick.net/drag-div-v3/js/main.js

Custom Overlay , jQuery UI, div , :

    CustomOverlay.prototype.onAdd = function()
    {
        var div = document.createElement("DIV");
        div.style.border = "none";
        div.style.borderWidth = "0px";
        div.style.position = "absolute";
        div.style.visibility = "visible";
        jQuery(div).draggable();   //Make the overlay itself draggable
        this.div = div;
        this.addPolygon(new google.maps.LatLng(46,0));
        this.getPanes().overlayLayer.appendChild(div);
    };
+3

"OverlayView", , "overlayMouseTarget" , , jQuery UI draggable() .

+1

Source: https://habr.com/ru/post/1529650/


All Articles