maxipeli / google-maps-utility-library-v3

Automatically exported from code.google.com/p/google-maps-utility-library-v3
Apache License 2.0
0 stars 0 forks source link

MarkerWithLabel - drag event works like click event #304

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I set a marker on click on the map. I use MarkerWithLabel.

I use draggable marker.

If I drag a marker it works fine. But if I drag a label it works with click 
event on the map.

How can I use labels and can drag a markers without click event?

In my example - when I drag a marker JS creates new marker.

http://jsfiddle.net/yV6xv/4139/

google.maps.event.addListener(map, 'click', function(event) {         
     addMarker(event.latLng)
});

function addMarker(latLng) {
    var marker = new MarkerWithLabel({
          position: latLng,
          map: map,
          draggable: true,
          labelContent: "example",
          labelAnchor: new google.maps.Point(30, 0),
          labelClass: "labels", // the CSS class for the label
          labelStyle: {opacity: 0.75}
    });

    google.maps.event.addListener(marker, 'dragend', function(e) {
       alert(2);
    })
}

Version: ###

Browser / Operating System:
[e.g. FF3 / MacOSX]

Additional comments:
[Enter any additional comments about the bug here.]

*********************************************************
Tip: Star this issue (next to title) to receive notifications of status
changes against this issue, also used as a gauge for how many people are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by GulevN...@gmail.com on 27 Apr 2014 at 9:06