added MapQuest OSM tiles - these native tiles work much more smoothly than the Google tile layers, so are best for a default
This commit is contained in:
parent
d9ead0597f
commit
5f4e0192a0
43
code/boot.js
43
code/boot.js
@ -102,16 +102,35 @@ window.setupStyles = function() {
|
||||
window.setupMap = function() {
|
||||
$('#map').text('');
|
||||
|
||||
var osmOpt = {attribution: 'Map data © OpenStreetMap contributors', maxZoom: 18, detectRetina: true};
|
||||
var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmOpt);
|
||||
//OpenStreetMap attribution - required by several of the layers
|
||||
osmAttribution = 'Map data © OpenStreetMap contributors';
|
||||
|
||||
var cmOpt = {attribution: 'Map data © OpenStreetMap contributors, Imagery © CloudMade', maxZoom: 18, detectRetina: true};
|
||||
//OpenStreetMap tiles - we shouldn't use these by default, or even an option - https://wiki.openstreetmap.org/wiki/Tile_usage_policy
|
||||
// "Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission from the System Administrators"
|
||||
//var osmOpt = {attribution: osmAttribution, maxZoom: 18, detectRetina: true};
|
||||
//var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmOpt);
|
||||
|
||||
//CloudMade layers - only 500,000 tiles/month in their free plan. nowhere near enough for IITC
|
||||
var cmOpt = {attribution: osmAttribution+', Imagery © CloudMade', maxZoom: 18, detectRetina: true};
|
||||
//var cmMin = new L.TileLayer('http://{s}.tile.cloudmade.com/{your api key here}/22677/256/{z}/{x}/{y}.png', cmOpt);
|
||||
//var cmMid = new L.TileLayer('http://{s}.tile.cloudmade.com/{your api key here}/999/256/{z}/{x}/{y}.png', cmOpt);
|
||||
|
||||
// cant make osm default per their tile usage policy (would cause too much traffic)
|
||||
var views = [/*cmMid, cmMin, osm,*/new L.Google('INGRESS'), new L.Google('ROADMAP'),
|
||||
new L.Google('SATELLITE'), new L.Google('HYBRID')];
|
||||
//MapQuest offer tiles - http://developer.mapquest.com/web/products/open/map
|
||||
//their usage policy has no limits (except required notification above 4000 tiles/sec - we're perhaps at 50 tiles/sec based on CloudMade stats)
|
||||
var mqSubdomains = [ 'otile1','otile2', 'otile3', 'otile4' ];
|
||||
var mqMapOpt = {attribution: osmAttribution+', Tiles Courtesy of MapQuest', mazZoom: 18, detectRetena: true, subdomains: mqSubdomains};
|
||||
var mqMap = new L.TileLayer('http://{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',mqMapOpt);
|
||||
//MapQuest satellite coverage outside of the US is rather limited - so not really worth having as we have google as an option
|
||||
//var mqSatOpt = {attribution: 'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency', mazZoom: 18, detectRetena: true, subdomains: mqSubdomains};
|
||||
//var mqSat = new L.TileLayer('http://{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg',mqSatOpt);
|
||||
|
||||
var views = [
|
||||
/*0*/ mqMap,
|
||||
/*1*/ new L.Google('INGRESS'),
|
||||
/*2*/ new L.Google('ROADMAP'),
|
||||
/*3*/ new L.Google('SATELLITE'),
|
||||
/*4*/ new L.Google('HYBRID')
|
||||
];
|
||||
|
||||
|
||||
window.map = new L.Map('map', $.extend(getPosition(),
|
||||
@ -137,13 +156,11 @@ window.setupMap = function() {
|
||||
addLayers['Links'] = linksLayer;
|
||||
|
||||
window.layerChooser = new L.Control.Layers({
|
||||
//'OSM Midnight': views[0],
|
||||
//'OSM Minimal': views[1],
|
||||
//'OSM Mapnik': views[2],
|
||||
'Default Ingress Map': views[0],
|
||||
'Google Roads': views[1],
|
||||
'Google Satellite': views[2],
|
||||
'Google Hybrid': views[3]
|
||||
'MapQuest OSM': views[0],
|
||||
'Default Ingress Map': views[1],
|
||||
'Google Roads': views[2],
|
||||
'Google Satellite': views[3],
|
||||
'Google Hybrid': views[4]
|
||||
}, addLayers);
|
||||
|
||||
map.addControl(window.layerChooser);
|
||||
|
@ -1,13 +1,13 @@
|
||||
// UTILS + MISC ///////////////////////////////////////////////////////
|
||||
|
||||
window.aboutIITC = function(){
|
||||
var v = '@@DATETIMEVERSION@@'
|
||||
var v = '@@BUILDNAME@@-@@BUILDDATE@@'
|
||||
var a = ''
|
||||
+ ' <div><b>About IITC</b></div> '
|
||||
+ ' <div>Ingress Intel Total Conversion</div> '
|
||||
+ ' <hr>'
|
||||
+ ' <div>'
|
||||
+ ' <a href="http://iitc.jonatkins.com/">IITC Homepage</a><br />'
|
||||
+ ' <a href="http://iitc.jonatkins.com/" target="_blank">IITC Homepage</a><br />'
|
||||
+ ' On the script’s homepage you can:'
|
||||
+ ' <ul>'
|
||||
+ ' <li>Find Updates</li>'
|
||||
@ -16,6 +16,9 @@ window.aboutIITC = function(){
|
||||
+ ' <li>Contribute!</li>'
|
||||
+ ' </ul>'
|
||||
+ ' </div>'
|
||||
+ ' <div>'
|
||||
+ ' MapQuest OSM tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">'
|
||||
+ ' </div>'
|
||||
+ ' <hr>'
|
||||
+ ' <div>Version: ' + v + '</div>';
|
||||
alert(a);
|
||||
|
2
main.js
2
main.js
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @id ingress-intel-total-conversion@jonatkins
|
||||
// @name IITC: Ingress intel map total conversion
|
||||
// @version 0.10.3.@@DATETIMEVERSION@@
|
||||
// @version 0.10.5.@@DATETIMEVERSION@@
|
||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||
// @updateURL @@UPDATEURL@@
|
||||
// @downloadURL @@DOWNLOADURL@@
|
||||
|
Loading…
x
Reference in New Issue
Block a user