Draggable Module

Makes Markers, Sprites and Images draggable.

Example: Draggable Objects

Usage

Load the file /modules/miniature.earth.draggable.js or copy the code to your script and customize it to your needs.

Methods

Earth.Draggable.enable( object )

object
(Marker/Sprite/Image) This object becomes draggable.
var my_draggable_marker = myearth.addMarker( {
	location : { lat: -25, lng: 14 },
	hotspot : true
} );

Earth.Draggable.enable( my_draggable_marker );
The objects must be created with hotspot: true

Events

dragstart, dragmove, dragend

 
my_draggable_marker.addEventListener( 'dragend', function(){
	console.log( 'Object dropped at: ' + JSON.stringify(this.location) );
} );