Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New tiles nokia #1282

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions plugins/basemap-nokia-ovi.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,37 @@ window.plugin.mapNokiaOvi = function() {};

window.plugin.mapNokiaOvi.setup = function() {
//the list of styles you'd like to see
var oviStyles = {
'normal.day': { name: "Normal", type: 'png8' },
'normal.day.grey': { name: "Normal (grey)", type: 'png8' },
'normal.day.transit': { name: "Normal (transit)", type: 'png8' },
'satellite.day': { name: "Satellite", type: 'jpg' },
'terrain.day': { name: "Terrain", type: 'png8' }, //would jpg be better?
'normal.night.grey': { name: "Normal Night (grey)", type: 'png8' },
let oviStyles = {
'normal.day': { name: "Normal", request: 'base', type: 'png8' }, //Normal Street Map
'normal.day.grey': { name: "Normal (grey)", request: 'base', type: 'png8' }, //Color-reduced Street Map
'normal.day.transit': { name: "Normal (transit)", request: 'base', type: 'png8' }, //Color-reduced Transit Map
'satellite.day': { name: "Satellite", request: 'aerial', type: 'png8' }, //Satellite Map
'terrain.day': { name: "Terrain", request: 'aerial', type: 'png8' }, //Terrain Map
'normal.night.grey': { name: "Normal Night (grey)", request: 'base', type: 'png8' },
'hybrid.day': { name: "Hybrid", request: 'aerial', type: 'png8' } //Hybrid Map
};


var oviOpt = {attribution: 'Imagery © Nokia OVI', maxNativeZoom: 20, maxZoom: 21};


let oviOpt = {attribution: 'Imagery © Here OVI', subdomains: '1234', maxNativeZoom: 20, maxZoom: 21};

$.each(oviStyles, function(style,data) {
//To get an app_id and an app_code register at https://developer.here.com/ and create your project.
//Afterwards create your JavaScript/REST APP_ID and APP_CODE
//demo IDs are available here: https://developer.here.com/api-explorer/rest/map-tile/map-tile-normal
let id = 'devportal-demo-20180625';
let code = '9v2BkviRwi9Ot26kp2IysQ';

oviOpt['style'] = style;
oviOpt['request'] = data.request;
oviOpt['type'] = data.type;
var oviMap = new L.TileLayer('http://{s}.maptile.maps.svc.ovi.com/maptiler/maptile/newest/{style}/{z}/{x}/{y}/256/{type}', oviOpt);
layerChooser.addBaseLayer(oviMap, 'Nokia OVI '+data.name);
oviOpt['id'] = id;
oviOpt['code'] = code;
let oviMap = new L.TileLayer('https://{s}.{request}.maps.api.here.com/maptile/2.1/maptile/newest/{style}/{z}/{x}/{y}/256/{type}?app_id={id}&app_code={code}', oviOpt);
layerChooser.addBaseLayer(oviMap, 'Here OVI '+data.name);
});

};

var setup = window.plugin.mapNokiaOvi.setup;
let setup = window.plugin.mapNokiaOvi.setup;

// PLUGIN END //////////////////////////////////////////////////////////

Expand Down