Update to API key
This commit is contained in:
@@ -3,56 +3,49 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
|||||||
import View from '../src/ol/View.js';
|
import View from '../src/ol/View.js';
|
||||||
import XYZ from '../src/ol/source/XYZ.js';
|
import XYZ from '../src/ol/source/XYZ.js';
|
||||||
|
|
||||||
const appId = 'kDm0Jq1K4Ak7Bwtn8uvk';
|
const apiKey = 'x13yMxvFSo8FIKFDDTnQaJ57Gakt11ZaIyqIctoSD3Y';
|
||||||
const appCode = 'xnmvc4dKZrDfGlvQHXSvwQ';
|
|
||||||
const hereLayers = [
|
const hereLayers = [
|
||||||
{
|
{
|
||||||
base: 'base',
|
base: 'base',
|
||||||
type: 'maptile',
|
type: 'maptile',
|
||||||
scheme: 'normal.day',
|
scheme: 'normal.day',
|
||||||
app_id: appId,
|
apiKey: apiKey,
|
||||||
app_code: appCode,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
base: 'base',
|
base: 'base',
|
||||||
type: 'maptile',
|
type: 'maptile',
|
||||||
scheme: 'normal.day.transit',
|
scheme: 'normal.day.transit',
|
||||||
app_id: appId,
|
apiKey: apiKey,
|
||||||
app_code: appCode,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
base: 'base',
|
base: 'base',
|
||||||
type: 'maptile',
|
type: 'maptile',
|
||||||
scheme: 'pedestrian.day',
|
scheme: 'pedestrian.day',
|
||||||
app_id: appId,
|
apiKey: apiKey,
|
||||||
app_code: appCode,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
base: 'aerial',
|
base: 'aerial',
|
||||||
type: 'maptile',
|
type: 'maptile',
|
||||||
scheme: 'terrain.day',
|
scheme: 'terrain.day',
|
||||||
app_id: appId,
|
apiKey: apiKey,
|
||||||
app_code: appCode,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
base: 'aerial',
|
base: 'aerial',
|
||||||
type: 'maptile',
|
type: 'maptile',
|
||||||
scheme: 'satellite.day',
|
scheme: 'satellite.day',
|
||||||
app_id: appId,
|
apiKey: apiKey,
|
||||||
app_code: appCode,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
base: 'aerial',
|
base: 'aerial',
|
||||||
type: 'maptile',
|
type: 'maptile',
|
||||||
scheme: 'hybrid.day',
|
scheme: 'hybrid.day',
|
||||||
app_id: appId,
|
apiKey: apiKey,
|
||||||
app_code: appCode,
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const urlTpl =
|
const urlTpl =
|
||||||
'https://{1-4}.{base}.maps.cit.api.here.com' +
|
'https://{1-4}.{base}.maps.ls.hereapi.com' +
|
||||||
'/{type}/2.1/maptile/newest/{scheme}/{z}/{x}/{y}/256/png' +
|
'/{type}/2.1/maptile/newest/{scheme}/{z}/{x}/{y}/256/png' +
|
||||||
'?app_id={app_id}&app_code={app_code}';
|
'?apiKey={apiKey}';
|
||||||
const layers = [];
|
const layers = [];
|
||||||
let i, ii;
|
let i, ii;
|
||||||
for (i = 0, ii = hereLayers.length; i < ii; ++i) {
|
for (i = 0, ii = hereLayers.length; i < ii; ++i) {
|
||||||
@@ -67,7 +60,7 @@ for (i = 0, ii = hereLayers.length; i < ii; ++i) {
|
|||||||
'Map Tiles © ' +
|
'Map Tiles © ' +
|
||||||
new Date().getFullYear() +
|
new Date().getFullYear() +
|
||||||
' ' +
|
' ' +
|
||||||
'<a href="http://developer.here.com">HERE</a>',
|
'<a href="http://developer.here.com" target="_blank">HERE</a>',
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -87,8 +80,7 @@ function createUrl(tpl, layerDesc) {
|
|||||||
.replace('{base}', layerDesc.base)
|
.replace('{base}', layerDesc.base)
|
||||||
.replace('{type}', layerDesc.type)
|
.replace('{type}', layerDesc.type)
|
||||||
.replace('{scheme}', layerDesc.scheme)
|
.replace('{scheme}', layerDesc.scheme)
|
||||||
.replace('{app_id}', layerDesc.app_id)
|
.replace('{apiKey}', layerDesc.apiKey);
|
||||||
.replace('{app_code}', layerDesc.app_code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const select = document.getElementById('layer-select');
|
const select = document.getElementById('layer-select');
|
||||||
|
|||||||
Reference in New Issue
Block a user