PageRenderTime 44ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/plugins/basemap-mapquest-open-aerial.user.js

https://github.com/mdunc/ingress-intel-total-conversion
JavaScript | 40 lines | 11 code | 10 blank | 19 comment | 0 complexity | d6bf851090a64aaecbf9214c602effdd MD5 | raw file
Possible License(s): 0BSD
  1. // ==UserScript==
  2. // @id iitc-plugin-basemap-mapquest-open-aerial@jonatkins
  3. // @name IITC plugin: MapQuest Open Satellite view (US Only)
  4. // @category Map Tiles
  5. // @version 0.1.0.@@DATETIMEVERSION@@
  6. // @namespace https://github.com/jonatkins/ingress-intel-total-conversion
  7. // @updateURL @@UPDATEURL@@
  8. // @downloadURL @@DOWNLOADURL@@
  9. // @description [@@BUILDNAME@@-@@BUILDDATE@@] Add the MapQuest Open Aerial satellite view tiles as a map layer. High detail in the US (lower 48) only.
  10. // @include https://www.ingress.com/intel*
  11. // @include http://www.ingress.com/intel*
  12. // @match https://www.ingress.com/intel*
  13. // @match http://www.ingress.com/intel*
  14. // @grant none
  15. // ==/UserScript==
  16. @@PLUGINSTART@@
  17. // PLUGIN START ////////////////////////////////////////////////////////
  18. // use own namespace for plugin
  19. window.plugin.mapTileMapQuestSat = function() {};
  20. window.plugin.mapTileMapQuestSat.addLayer = function() {
  21. var mqSubdomains = [ 'otile1','otile2', 'otile3', 'otile4' ];
  22. var mqTileUrlPrefix = window.location.protocol !== 'https:' ? 'http://{s}.mqcdn.com' : 'https://{s}-s.mqcdn.com';
  23. //MapQuest satellite coverage outside of the US is rather limited - so not really worth having as we have google as an op!
  24. var mqSatOpt = {attribution: 'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency', maxZoom: 18, subdomains: mqSubdomains};
  25. var mqSat = new L.TileLayer('http://{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg',mqSatOpt);
  26. layerChooser.addBaseLayer(mqSat, "MapQuest Open Satellite");
  27. };
  28. var setup = window.plugin.mapTileMapQuestSat.addLayer;
  29. // PLUGIN END //////////////////////////////////////////////////////////
  30. @@PLUGINEND@@