gammapy/gamma-sky

Add router

Closed this issue · 1 comments

cdeil commented

It would be nice to be able to "share" a given view / state of gamma-sky.new with others.
The easiest way would be if we have a router and the state of the app (or part of it, like the map position and zoom level) could be encoded in the URL.

Examples:
http://gammapy.github.io/web-experiments/?cat=2FHL&source=2
http://aladin.u-strasbg.fr/AladinLite/?target=&fov=3.00&survey=P%2FFermi%2Fcolor
https://www.google.com/maps/place/Max+Planck+Institute+for+Nuclear+Physics/@49.38803,8.7073313,17z/data=!3m1!4b1!4m5!3m4!1s0x4797c05ed0bff2df:0x278a1dd9700fcbf7!8m2!3d49.38803!4d8.70952

I think this is something that's a lot of work to implement and maybe it would be best to go to Angular 2 first?
https://angular.io/docs/ts/latest/guide/router.html
https://angular.io/docs/ts/latest/tutorial/toh-pt5.html
http://blog.thoughtram.io/angular/2016/06/14/routing-in-angular-2-revisited.html
The alternative would be that for now we add some other small router like
https://github.com/flatiron/director
(I haven't used either and don't know much about how they work ... we can work on this together next week.)

Done.