 				if javascript.readyState == "loaded" || javascript.readyState == "complete"
 					log "OpenStreetMap files loaded"
 					javascript.onreadystatechange = 'null'
-					redraw.modify (v) -> v+1
+					redraw.incr()
 		else  # Other browsers
 			javascript.onload = ->
 				log "OpenStreetMap files loaded"
-				redraw.modify (v) -> v+1
+				redraw.incr()
 		javascript.setAttribute 'src', 'https://api.tiles.mapbox.com/mapbox.js/v2.1.6/mapbox.js'
 		document.getElementsByTagName('head')[0].appendChild javascript
 	else 

	if !Geoloc.isSubscribed()
		Geoloc.subscribe()
		# gamestate check
	limitToBounds()
	Obs.observe ->
		mainElement = document.getElementsByTagName("main")[0]
		mainElement.setAttribute 'id', 'main'

		hey = redraw.get();
		gameState = Db.shared.get('gameState')
		if gameState is 0 # Setting up game by user that added plugin
			setupContent()

			log 'test prediction add marker'
			Db.shared.set 'game', 'beacons', event.latlng.lat.toString()+'_'+event.latlng.lng.toString(), {location: event.latlng}

indicationArrowListener = (event) ->
	indicationArrowRedraw.incr()

convertLatLng = (location) ->
	return L.latLng(location.lat, location.lng)
	
