Пример #1
0
	return function ( dispatch ){

		dispatch( dismissSnackbar() )
		dispatch( { type: types.SET_LAYER_VISIBILITY, layer: 'statuses', to: false } )
		dispatch( { type: types.SET_LAYER_VISIBILITY, layer: 'form', to: true } )

	}
Пример #2
0
	return function ( dispatch, getState ){

		let state = getState()
		let map = state.mapbox.map

		if( state.mapbox.zoom < 14 ) {

			dispatch( setSnackbarMessage( 'zoom_closer', 0, { label: 'continue_upload', action: setLocation() }, { label: 'cancel_upload', action: resetMain() }  ) )

		}else{

			let image = state.form.image
			let center = map.getCenter()

			image.lat = center.lat
			image.long = center.lng

			dispatch( trackZoom( 'off' ) )
			dispatch( addDropMarker( image ) )
			dispatch( { type: types.SET_IMAGE_TO_UPLOAD, to: {} } )
			dispatch( { type: types.SET_IMAGE_TO_UPLOAD, to: image } )
			dispatch( { type: types.SET_LAYER_VISIBILITY, layer: 'marker', to: false } )
			dispatch( { type: types.SET_LAYER_VISIBILITY, layer: 'form', to: true } )
			dispatch( dismissSnackbar() )

		}

	}
Пример #3
0
		dismissSnackbar: ( func, e ) => {

			e.preventDefault()
			dispatch( dismissSnackbar() )
			if( func ){

				dispatch( func )

			}

		}