forked from iitc-project/ingress-intel-total-conversion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[plugins] another Openstreetmap layer provider
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// ==UserScript== | ||
// @id iitc-plugin-basemap-osm_tjanster@mcben | ||
// @name IITC plugin: OpenStreetMap.se (Tjänster) map tiles | ||
// @category Map Tiles | ||
// @version 0.1.1.@@DATETIMEVERSION@@ | ||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion | ||
// @updateURL @@UPDATEURL@@ | ||
// @downloadURL @@DOWNLOADURL@@ | ||
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Add OpenStreetMap.se map tiles as an optional layer. | ||
// @include https://*.ingress.com/intel* | ||
// @include http://*.ingress.com/intel* | ||
// @match https://*.ingress.com/intel* | ||
// @match http://*.ingress.com/intel* | ||
// @include https://*.ingress.com/mission/* | ||
// @include http://*.ingress.com/mission/* | ||
// @match https://*.ingress.com/mission/* | ||
// @match http://*.ingress.com/mission/* | ||
// @grant none | ||
// ==/UserScript== | ||
|
||
@@PLUGINSTART@@ | ||
|
||
// PLUGIN START //////////////////////////////////////////////////////// | ||
|
||
|
||
// use own namespace for plugin | ||
window.plugin.mapTileOpenStreetMapTjanster = { | ||
addLayer: function() { | ||
|
||
var osmOpt = { | ||
attribution: '© <a href="http://openstreetmap.se">Tjänstr</a> contributors', | ||
maxZoom: 18, | ||
subdomains: 'abc' | ||
}; | ||
|
||
var layers = { | ||
'http://{s}.tile.openstreetmap.se/hydda/full/{z}/{x}/{y}.png': 'Tjänstr full', | ||
'http://{s}.tile.openstreetmap.se/osm/{z}/{x}/{y}.png': 'Tjänstr OSM' | ||
}; | ||
|
||
for(var url in layers) { | ||
var layer = new L.TileLayer(url, osmOpt); | ||
layerChooser.addBaseLayer(layer, layers[url]); | ||
} | ||
}, | ||
}; | ||
|
||
var setup = window.plugin.mapTileOpenStreetMapTjanster.addLayer; | ||
|
||
// PLUGIN END ////////////////////////////////////////////////////////// | ||
|
||
@@PLUGINEND@@ |