src/application.js
/**
 * Checks page route and acts accordingly
 */
Checks page route and acts accordingly
Checks page route and acts accordingly
function router () {
  var q = window.location.search.substr(1)
  var pair = q.split('=')
  var page = pair[0]
  var values = pair[1]
  switch (page) {
    case 'about':
      aboutOpenInstantaneously()
      break
    case 'latlng':
      if (!values) {
        reset()
        break
      }
      var lat = parseFloat(values.split(',')[0])
      var lng = parseFloat(values.split(',')[1])
      if (!lat || !lng) {
        reset()
      } else {
        goToLatLng(lat, lng)
      }
      break
    case 'address':
      if (!values) {
        reset()
      } else {
        goToAddress(decodeURIComponent(values))
      }
      break
    default:
      reset()
      break
  }
}
function router ( ) { var q = window . location . search . substr ( 1 ) var pair = q . split ( '=' ) var page = pair [ 0 ] var values = pair [ 1 ] switch ( page ) { case 'about' : aboutOpenInstantaneously ( ) break case 'latlng' : if ( ! values ) { reset ( ) break } var lat = parseFloat ( values . split ( ',' ) [ 0 ] ) var lng = parseFloat ( values . split ( ',' ) [ 1 ] ) if ( ! lat || ! lng ) { reset ( ) } else { goToLatLng ( lat , lng ) } break case 'address' : if ( ! values ) { reset ( ) } else { goToAddress ( decodeURIComponent ( values ) ) } break default : reset ( ) break } }
Checks page route and acts accordingly
Checks page route and acts accordingly