TerriaJS / neii-viewer

Data viewer for National Environmental Information Infrastructure
http://neii.gov.au/viewer/
Apache License 2.0
8 stars 4 forks source link

Enable Google URL shortener (get API key) #27

Closed azzerger closed 7 years ago

azzerger commented 8 years ago

Steve, in the current implementation is it possible to pass a more complex URL to the Viewer to for example zoom to a particular area, start the view with some layers on and some layers off etc.

The use case is that we wish to take people to the NEMSR once its inside the Viewer but rather than point to neii.gov.au/viewer we would point to something (pseudo code only) neii.gov.au/viewer/allnemsrOn+zoomtoAustralia+expandNEMSRLayers

Please don't go developing something - just wondering whether there is native support for passing parameters through a URL. Cheers Andre

stevage commented 8 years ago

That's exactly what the "Share URL" feature does, right? :) The only thing is it's a pretty messy URL if you're not using the shortener.

azzerger commented 8 years ago

Steve, that is perfect (almost) – I had not realised the Share feature picked up all the current view parameters.

However I see the problem (e.g. URL I need below) – I was hoping to use these in a Word document or email but the Hyperlink tool is not liking it. Guess that's why we need a shortener. We can have a look at a shortener at our end – the Bureau does have a URL shortening service not necessarily designed for this purpose but it may do the job.

Andre

http://neiiviewer.nicta.com.au/#start=%7B%22version%22%3A%220.0.05%22%2C%22initSources%22%3A%5B%22init%2Fneii-oceans-prod.json%22%2C%22init%2Fneii-water.json%22%2C%22init%2Fneii-air.json%22%2C%22init%2Fneii-biota.json%22%2C%22init%2Fneii-land.json%22%2C%22init%2Fneii-other.json%22%2C%22init%2Fneii-contextual.json%22%2C%7B%22sharedCatalogMembers%22%3A%7B%22Root%20Group%2FNEII%20Data%20Services%20%E2%80%93%20Conformant%22%3A%7B%22isOpen%22%3Atrue%2C%22type%22%3A%22group%22%2C%22parents%22%3A%5B%5D%7D%2C%22Root%20Group%2FNEII%20Data%20Services%20%E2%80%93%20Conformant%2FWater%20(1)%22%3A%7B%22isOpen%22%3Atrue%2C%22type%22%3A%22group%22%2C%22parents%22%3A%5B%22Root%20Group%2FNEII%20Data%20Services%20%E2%80%93%20Conformant%22%5D%7D%2C%22Root%20Group%2FNEII%20Data%20Services%20%E2%80%93%20Conformant%2FWater%20(1)%2FGeofabric%22%3A%7B%22isOpen%22%3Atrue%2C%22type%22%3A%22group%22%2C%22parents%22%3A%5B%22Root%20Group%2FNEII%20Data%20Services%20%E2%80%93%20Conformant%22%2C%22Root%20Group%2FNEII%20Data%20Services%20%E2%80%93%20Conformant%2FWater%20(1)%22%5D%7D%2C%22Root%20Group%2FNEII%20Data%20Services%20%E2%80%93%20Conformant%2FWater%20(1)%2FGeofabric%2FSurface%20Hydrology%20-%20Catchments%2FLevel%201%20Drainage%20Division%22%3A%7B%22nowViewingIndex%22%3A0%2C%22isEnabled%22%3Atrue%2C%22isShown%22%3Atrue%2C%22isLegendVisible%22%3Atrue%2C%22opacity%22%3A0.6%2C%22keepOnTop%22%3Afalse%2C%22type%22%3A%22wms%22%2C%22parents%22%3A%5B%22Root%20Group%2FNEII%20Data%20Services%20%E2%80%93%20Conformant%22%2C%22Root%20Group%2FNEII%20Data%20Services%20%E2%80%93%20Conformant%2FWater%20(1)%22%2C%22Root%20Group%2FNEII%20Data%20Services%20%E2%80%93%20Conformant%2FWater%20(1)%2FGeofabric%22%2C%22Root%20Group%2FNEII%20Data%20Services%20%E2%80%93%20Conformant%2FWater%20(1)%2FGeofabric%2FSurface%20Hydrology%20-%20Catchments%22%5D%7D%2C%22Root%20Group%2FContextual%20layers%22%3A%7B%22isOpen%22%3Atrue%2C%22type%22%3A%22group%22%2C%22parents%22%3A%5B%5D%7D%7D%7D%2C%7B%22initialCamera%22%3A%7B%22west%22%3A106.21627980496231%2C%22south%22%3A-40.93131503193271%2C%22east%22%3A153.78372020063006%2C%22north%22%3A-6.164544007844898%2C%22position%22%3A%7B%22x%22%3A-5888722.497679982%2C%22y%22%3A7017906.192400467%2C%22z%22%3A-4258904.947705373%7D%2C%22direction%22%3A%7B%22x%22%3A0.5821817189634884%2C%22y%22%3A-0.6938171551174151%2C%22z%22%3A0.4238893739756977%7D%2C%22up%22%3A%7B%22x%22%3A-0.27247083746941275%2C%22y%22%3A0.3247180994313271%2C%22z%22%3A0.9057139717542265%7D%7D%2C%22homeCamera%22%3A%7B%22west%22%3A105.00000000000001%2C%22south%22%3A-45%2C%22east%22%3A155%2C%22north%22%3A-5%7D%2C%22baseMapName%22%3A%22Bing%20Maps%20Aerial%22%2C%22viewerMode%22%3A%223d%22%7D%5D%7D&activeTabId=Data%20Services

From: Steve Bennett [mailto:notifications@github.com] Sent: Friday, 10 June 2016 3:37 PM To: TerriaJS/neii-viewer Cc: Andre Zerger; Author Subject: Re: [TerriaJS/neii-viewer] Customise TerriaJS url to pass parameters? (#27)

That's exactly what the "Share URL" feature does, right? :) The only thing is it's a pretty messy URL if you're not using the shortener.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/TerriaJS/neii-viewer/issues/27#issuecomment-225097526, or mute the threadhttps://github.com/notifications/unsubscribe/ARSyzT6_PA8c2NFr4yq9eMT-zbsH-yGKks5qKPgIgaJpZM4IymwQ.

stevage commented 8 years ago

There's a shortener feature built into Terria. We just need to get a Google API key to enable it. Leave it with me.

azzerger commented 8 years ago

OK – see how you go – apparently we can also implement a shortening service on neii.gov.au but have never attempted this.

From: Steve Bennett [mailto:notifications@github.com] Sent: Friday, 10 June 2016 4:19 PM To: TerriaJS/neii-viewer Cc: Andre Zerger; Author Subject: Re: [TerriaJS/neii-viewer] Customise TerriaJS url to pass parameters? (#27)

There's a shortener feature built into Terria. We just need to get a Google API key to enable it. Leave it with me.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/TerriaJS/neii-viewer/issues/27#issuecomment-225102566, or mute the threadhttps://github.com/notifications/unsubscribe/ARSyzXUIR5U-vsvR2vNUHYzZykThADqQks5qKQHLgaJpZM4IymwQ.

stevage commented 8 years ago

It turns out the Google URL shortener doesn't really cope with huge URLs like these, so I'm actually implementing a whole new one. https://github.com/TerriaJS/terriajs/issues/1342

azzerger commented 8 years ago

Steve

OK – up to you – I have been recently made aware of tinyurl.com and it does the job (e.g. http://tinyurl.com/heomq9j for solar data) however a more elegant URL would be nice. We have a shortening service in the Bureau which takes everything to bom.is/ but not that useful for non-Bureau data resources in the NEII.

What domain were you thinking?

Andre

From: Steve Bennett [mailto:notifications@github.com] Sent: Wednesday, 29 June 2016 1:03 PM To: TerriaJS/neii-viewer Cc: Andre Zerger; Author Subject: Re: [TerriaJS/neii-viewer] Enable Google URL shortener (get API key) (#27)

It turns out the Google URL shortener doesn't really cope with huge URLs like these, so I'm actually implementing a whole new one. TerriaJS/terriajs#1342https://github.com/TerriaJS/terriajs/issues/1342

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/TerriaJS/neii-viewer/issues/27#issuecomment-229244293, or mute the threadhttps://github.com/notifications/unsubscribe/ARSyzcJJWCM5REJDRnsRoymUIuxxdViDks5qQeBcgaJpZM4IymwQ.

stevage commented 8 years ago

The end URL will look like http://neii.gov.au/viewer#share=g-3475874298568947365896 . The data itself will be stored on Gist (Github), but that's totally invisible to the end user.

azzerger commented 8 years ago

Steve, that would work well. Andre

From: Steve Bennett [mailto:notifications@github.com] Sent: Wednesday, 29 June 2016 1:09 PM To: TerriaJS/neii-viewer Cc: Andre Zerger; Author Subject: Re: [TerriaJS/neii-viewer] Enable Google URL shortener (get API key) (#27)

The end URL will look like http://neii.gov.au/viewer#share=3475874298568947365896 . The data itself will be stored on Gist (Github), but that's totally invisible to the end user.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/TerriaJS/neii-viewer/issues/27#issuecomment-229244982, or mute the threadhttps://github.com/notifications/unsubscribe/ARSyzQjYbzTrV8xCoSdCb2z_qjAxq9P_ks5qQeHSgaJpZM4IymwQ.

ChantelleDoan commented 7 years ago

@kring , it would be great if you could advise the statuis of this item and if this will be released as part of the New Viewer? Thanks.

ChantelleDoan commented 7 years ago

Thanks @RacingTadpole. Tested successfully. A new item has been raised to better understand how the share url and shorten url works at https://github.com/TerriaJS/neii-viewer/issues/69