 					marker.addTo(map)
 					window.flagCurrentLocation = marker
 			else
-				log 'location could not be found'
-###
+				log 'Location could not be found'
+			Obs.onClean ->
+				if mapReady() and flagCurrentLocation?
+					map.removeLayer flagCurrentLocation
+					window.flagCurrentLocation = null
+

# Check if the map can be used	
mapReady = ->
	return L? and map?
#Commented out because causes a lot of spam needs to be fixed!
###		
renderLocation = -> 
	if Geoloc.isSubscribed()
		Obs.observe -> # Creates new observe scope, because state changes a lot this spams the console a bit
			state = Geoloc.track()
			location = state.get('latlong');
			if location?
				location = location.split(',')
				if mapReady()
					marker = L.marker(L.latLng(location[0], location[1]))

			toRemove = document.getElementById('OpenStreetMap');
			toRemove.parentNode.removeChild(toRemove);
	setupMap()
	renderLocation();
	
loadOpenStreetMap = ->
	log "loadOpenStreetMap()"
