 
   constructor : (@model) ->
 
-    url           = document.URL
-    @baseUrl      = url.match(/^([^#]*)#?/)[1]
-    @initialState = @parseUrl url
+    @baseUrl      = document.location.pathname
+    @initialState = @parseUrl()
 
     @update = _.throttle(
       => location.replace(@buildUrl())

    _.extend(@, Backbone.Events)


  parseUrl : (url)->

    stateString = url.match(/^.*#([\d.-]*(?:,[\d.-]*)*)$/)?[1]
    state       =
      position : null
      mode : null

    @model.flycam3d.on
      changed : => @update()

    #@listenTo(app.vent, "changeViewMode", @update)


  buildUrl : ->
