Rashad Majali  committed 738ee34 Draft

Make marker draggable.

  • Participants
  • Parent commits 5a64c50

Comments (0)

Files changed (2)


File leaflet-search.js

 		animateLocation: true,		//animate a circle over location found
 		circleLocation: true,		//draw a circle in location found
 		markerLocation: false,		//draw a marker in location found
+		markerDraggable: false,		// If marker should be draggable or not.
 		zoom: null,					//zoom after pan to location found, default: map.getZoom()
 		text: 'Search...',			//placeholder value	
 		textCancel: 'Cancel',		//title in cancel button
 		textErr: 'Location not found',	//error message
-		position: 'topleft',
+		position: 'topleft'
 		//TODO add option collapsed, like control.layers
 //FIXME option condition problem {autoCollapse: true, markerLocation: true} not show location
 		this._map = map;
 		this._container = L.DomUtil.create('div', 'leaflet-control-search');
 		this._input = this._createInput(this.options.text, 'search-input');
-		this._tooltip = this._createTooltip('search-tooltip');
+		this._tooltip = this._createTooltip('search-tooltip');		
 		this._cancel = this._createCancel(this.options.textCancel, 'search-cancel');
 		this._button = this._createButton(this.options.text, 'search-button');
 		this._alert = this._createAlert('search-alert');
 		if(this.options.circleLocation || this.options.markerLocation)
-			this._markerLoc = new SearchMarker([0,0], {marker: this.options.markerLocation});//see below
+			this._markerLoc = new SearchMarker([0,0], {
+				marker: this.options.markerLocation,
+				draggable: this.options.markerDraggable
+			});//see below
 		this.setLayer( this._layer ); = L.DomUtil.getStyle(this._map._container,'width');
 	includes: L.Mixin.Events,
 	options: {
+		draggable:false,
 		radius: 10,
 		weight: 3,
 		color: '#e03',