Skip to content

Commit

Permalink
Make sure Bing Maps key is provided everywhere it's needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed May 17, 2016
1 parent b0b3841 commit 30cd4a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ registerCustomComponentTypes(terria);

terria.welcome = '<h3>Terria<sup>TM</sup> is a spatial data platform that provides spatial predictive analytics</h3><div class="body-copy"><p>This interactive map uses TerriaJS<sup>TM</sup>, an open source software library developed by Data61 for building rich, web-based geospatial data explorers. It uses Cesium<sup>TM</sup> open source 3D globe viewing software. TerriaJS<sup>TM</sup> is used for the official Australian Government NationalMap and many other sites rich in the use of spatial data.</p><p>This map also uses Terria<sup>TM</sup> Inference Engine, a cloud-based platform for making probabilistic predictions using data in a web-based mapping environment. Terria<sup>TM</sup> Inference Engine uses state of the art machine learning algorithms developed by Data61 and designed specifically for large-scale spatial inference.</p></div>';

const viewState = new ViewState({
terria: terria,
locationSearchProviders: [
new BingMapsSearchProviderViewModel({terria}),
new GazetteerSearchProviderViewModel({terria})
]
});

// If we're running in dev mode, disable the built style sheet as we'll be using the webpack style loader.
// Note that if the first stylesheet stops being nationalmap.css then this will have to change.
if (process.env.NODE_ENV !== "production" && module.hot) {
Expand All @@ -90,6 +82,17 @@ terria.start({
try {
configuration.bingMapsKey = terria.configParameters.bingMapsKey ? terria.configParameters.bingMapsKey : configuration.bingMapsKey;

const viewState = new ViewState({
terria: terria,
locationSearchProviders: [
new BingMapsSearchProviderViewModel({
terria: terria,
key: configuration.bingMapsKey
}),
new GazetteerSearchProviderViewModel({terria})
]
});

// Automatically update Terria (load new catalogs, etc.) when the hash part of the URL changes.
updateApplicationOnHashChange(terria, window);
updateApplicationOnMessageFromParentWindow(terria, window);
Expand Down
2 changes: 1 addition & 1 deletion wwwroot/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nm"
],
"parameters": {
"bingMapsKey": null,
"bingMapsKey": "AkaOmRFtjAb71cXgLwAGtLbj2RpkPKtVqAIroFQsocfurCBILxIeAWPkil7hhRy_",
"googleUrlShortenerKey": null,
"googleAnalyticsKey": null,
"googleAnalyticsOptions": null,
Expand Down

0 comments on commit 30cd4a7

Please sign in to comment.