 bestMap = ->
 	scope = markers: '='
 	
+	map = {}
+	
+	isNewMarkerNotSet = true
+	isAddPosible = false
+	longLatt = []
+
 	colorSettings =
 		min:
 			R: 94

	toObject = (arr) ->
		rv = {}
		for i in [0...arr.length]
	    	rv[i] = arr[i];
		rv;

	onEachFeature = (feature, layer) =>
			popupContent = '<p style="color:black">'
			console.log feature.properties.popupContent
			if feature.properties && feature.properties.popupContent
				popupContent += feature.properties.popupContent
			popupContent += '</p>'
			#console.log popupContent
			console.log layer
			layer.bindPopup(popupContent)
			##main-map(best-map, markers='main.markers', style="height: 600px;")

	initMap = (element, maxLikes, markers) ->

		console.log element.id, maxLikes, markers

		colorSettings.maxLikes = maxLikes

		map = L.map element.id
		.setView [ 49, 32], 8

		initialMapSettings =
			maxZoom: 18

						'Imagery © <a href="http://mapbox.com">Mapbox</a>'
			id: 'thymajesty.kbp9jbaa'

		L.tileLayer 'https://{s}.tiles.mapbox.com/v3/thymajesty.kbp9jbaa/{z}/{x}/{y}.png', configureMap
		.addTo(map)
		markers = for i in [0...2]
					{likes_count: i*100, long_latt: [49, 32], description:'description: Lorem ipsum Sed tempor Ut minim fugiat ea sed quis ad eiusmod sed proident non Duis'}
		
		markers.isAddPosible = true

		isAddPosible = markers.isAddPosible
		configureMap
		initMap attrs, maxLikes, markers
		console.log 'directive bestMap'
		
