-
Notifications
You must be signed in to change notification settings - Fork 10
Home
Welcome to the terriajs-dive wiki!
-
Use #clean on Terria for removing default catalog, like this: https://gamone.whoi.edu/terriamap/#clean&https://raw.githubusercontent.com/rsignell-usgs/ehzrap/master/testing/bird_migration.json
-
To avoid the default behavior of automatically animating time-dependent layers, edit
<TerriaMap>/wwwroot/config.jsonand add this line within theparametersgroup:autoPlay: false, -
To avoid the initial splash screen disclaimer, edit
<TerriaMap>/wwwroot/config.jsonand comment out or remove theglobalDisclaimersection. -
I like to have all the catalog JSON files publically accessible on github to serve as examples, and also to allow configuration and contributions from others without making any changes on the server. The URL to the raw json can be then just appended to the TerriaJS endpoint following a
#sign. So for the bird_migration json here: https://github.com/USGS-CMG/terriajs-dive/blob/master/examples/bird_migration.json, we click the "raw" button and append that URL to the TerriaJS endpoint like this: https://gamone.whoi.edu/terriamap/#https://raw.githubusercontent.com/USGS-CMG/terriajs-dive/master/examples/bird_migration.json -
A handy trick for defeating the (rather aggressive) caching is to include the proxy in the URL. So instead of this: https://gamone.whoi.edu/terriamap/#https://raw.githubusercontent.com/USGS-CMG/terriajs-dive/master/examples/sciwms_vs_ncwms2.json, use this: https://gamone.whoi.edu/terriamap/#proxy/_60s/https://raw.githubusercontent.com/USGS-CMG/terriajs-dive/master/examples/sciwms_vs_ncwms2.json What this is doing is explicitly setting the cache time to live (TTL). So in this case the response will be cached for 60 seconds. Walid units can be found here: https://github.com/TerriaJS/terriajs-server/blob/master/lib/controllers/proxy.js#L13. The cache duration will be honored by both the varnish caching web server (if you're using it) and by the end user's web browser.
-
"clean" and "proxy" can be combined like this: http://gamone.whoi.edu/terriamap/#clean&proxy/_60s/https://raw.githubusercontent.com/USGS-CMG/terriajs-dive/master/examples/csw.json
-
if a server that you want to access data from is not CORS compliant, you can add the domain to the whitelist in the
<TerriaMap>/devserverconfig.jsonfile, like this:
{
"port": 3001,
"allowProxyFor" : [
"nicta.com.au",
"gov.au",
"csiro.au",
"arcgis.com",
"argo.jcommops.org",
"www.abc.net.au",
"geoserver.aurin.org.au",
"mapsengine.google.com",
"s3-ap-southeast-2.amazonaws.com",
"adelaidecitycouncil.com",
"www.dptiapps.com.au",
"geoserver-123.aodn.org.au",
"geoserver.imos.org.au",
"nci.org.au",
"static.nationalmap.nicta.com.au",
"githubusercontent.com",
"gov",
"org",
"edu",
"us",
"ingv.it",
"gov.uk",
"gov.nz"
]
}
- I want my share URL to point to a gist that contains the JSON, so that I don't have to worry about stuffing all the config in a very long URL. You can configure this by adding some lines to the end of
<TerriaMap>/devserverconfig.jsonfile, like this (for theaccessTokenI used a github personal access token with scope to create gist):
"gov.uk",
"gov.nz"
],
shareUrlPrefixes: {
"g": {
service: "gist",
accessToken: "b6d26a2358xxxxxxxxxxxx0dd028064ad6f2a622"
}
},
newShareUrlPrefix: "g"
}
-
the USGS staging deployment is at: https://maps-staging.snafu.cr.usgs.gov/TerriaMap/CDI-Dive/ (only accessible from USGS network, source at https://my.usgs.gov/bitbucket/projects/CDI/repos/terriajs-dive/browse?at=refs%2Fheads%2Fstaging
-
Terria-JS milestones at https://github.com/TerriaJS/terriajs/milestones. Here are the USGS CDI versions 1 Milestone issues that were closed as part of this project