Compare commits

...

2 commits

Author SHA1 Message Date
Chandler Swift 69d567d13c
Add light pollution layers 2023-08-27 16:33:51 -05:00
Chandler Swift 8c011b481a
Add Sprint/AT&T coverage layers 2023-08-19 13:53:12 -05:00
3 changed files with 159 additions and 0 deletions

127
layers/cellular.js Normal file
View file

@ -0,0 +1,127 @@
import { XYZ } from 'ol/source.js';
import TileLayer from 'ol/layer/Tile';
// from https://stackoverflow.com/q/32454234
var quadkey = function (x, y, z) {
var quadKey = [];
for (var i = z; i > 0; i--) {
var digit = '0';
var mask = 1 << (i - 1);
if ((x & mask) != 0) {
digit++;
}
if ((y & mask) != 0) {
digit++;
digit++;
}
quadKey.push(digit);
}
return quadKey.join('');
};
const cellular_layers = {
name: "Cellular Providers",
layers: [
// {
// name: "Verizon",
// // enabled: true,
// layer: new VectorTileLayer({
// source: new VectorTileSource({
// format: new MVT(),
// // https://api.mapbox.com/v4/gismaps.3knn09ds,gismaps.2x81tn8t,mapbox.mapbox-streets-v8,gismaps.aq7mk519,mapbox.country-boundaries-v1,gismaps.cbihlc9h,gismaps.7is2087g,gismaps.8hjkv530/7/31/46.vector.pbf
// // url: 'https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/tile/{z}/{y}/{x}.pbf',
// url: 'https://api.mapbox.com/v4/gismaps.3knn09ds,gismaps.2x81tn8t,mapbox.mapbox-streets-v8,gismaps.aq7mk519,mapbox.country-boundaries-v1,gismaps.cbihlc9h,gismaps.7is2087g,gismaps.8hjkv530/{z}/{y}/{x}.pbf'
// }),
// }),
// },
{
name: "AT&T Domestic",
layer: new TileLayer({
opacity: 0.5,
source: new XYZ({
tileUrlFunction: function (tileCoord, pixelRatio, projection) {
var z = tileCoord[0];
var x = tileCoord[1];
var y = tileCoord[2];
return "https://geolink-igw.cloud.att.com/mapservice/quadkeytile?layer=attDomestic&quadkey=" + quadkey(x, y, z);
},
}),
}),
},
{
name: "AT&T Prepaid",
layer: new TileLayer({
opacity: 0.5,
source: new XYZ({
tileUrlFunction: function (tileCoord, pixelRatio, projection) {
var z = tileCoord[0];
var x = tileCoord[1];
var y = tileCoord[2];
return "https://geolink-igw.cloud.att.com/mapservice/quadkeytile?layer=attPrepaid&quadkey=" + quadkey(x, y, z);
},
}),
}),
},
{
name: "AT&T International",
layer: new TileLayer({
opacity: 0.5,
source: new XYZ({
tileUrlFunction: function (tileCoord, pixelRatio, projection) {
var z = tileCoord[0];
var x = tileCoord[1];
var y = tileCoord[2];
return "https://geolink-igw.cloud.att.com/mapservice/quadkeytile?layer=attIntl&quadkey=" + quadkey(x, y, z);
},
}),
}),
},
{
name: "Sprint 5G? (may also be T-Mo now); see <a href='https://coverage.sprint.com/IMPACT.jsp'>Sprint</a> for legends",
layer: new TileLayer({
opacity: 0.5,
source: new XYZ({
// url: 'https://coverage.sprint.com/MapTile/5GDataMap/Tiles/data_xp_5G/{z}/{x}:{y}/tile.png'
tileUrlFunction: function (tileCoord, pixelRatio, projection) {
var z = tileCoord[0]+1;
var x = tileCoord[1]+1;
var y = tileCoord[2]+1;
return `https://coverage.sprint.com/MapTile/5GDataMap/Tiles/data_xp_5G/${z}/${x}:${y}/tile.png`;
},
}),
}),
},
{
name: "Sprint LTE? (may also be T-Mo now)",
layer: new TileLayer({
opacity: 0.5,
source: new XYZ({
// url: 'https://coverage.sprint.com/MapTile/5GDataMap/Tiles/data_xp_lte/{z}/{x}:{y}/tile.png'
tileUrlFunction: function (tileCoord, pixelRatio, projection) {
var z = tileCoord[0]+1;
var x = tileCoord[1]+1;
var y = tileCoord[2]+1;
return `https://coverage.sprint.com/MapTile/5GDataMap/Tiles/data_xp_lte/${z}/${x}:${y}/tile.png`;
},
}),
}),
},
{
name: "Sprint non-LTE? (may also be T-Mo now)",
layer: new TileLayer({
opacity: 0.5,
source: new XYZ({
// url: 'https://coverage.sprint.com/MapTile/5GDataMap/Tiles/data_xp_5G/{z}/{x}:{y}/tile.png'
tileUrlFunction: function (tileCoord, pixelRatio, projection) {
var z = tileCoord[0]+1;
var x = tileCoord[1]+1;
var y = tileCoord[2]+1;
return `https://coverage.sprint.com/MapTile/5GDataMap/Tiles/data_xp_3G/${z}/${x}:${y}/tile.png`;
},
}),
}),
},
],
};
export default cellular_layers;

View file

@ -10,6 +10,8 @@ import chains from './chains/index.js';
import census_bureau from './census-bureau/index.js'; import census_bureau from './census-bureau/index.js';
import states from './states/index.js'; import states from './states/index.js';
import national_land from './national-land/index.js'; import national_land from './national-land/index.js';
import cellular from './cellular.js';
import light_pollution from './light_pollution.js';
const layerCategories = [ const layerCategories = [
{ // Base maps { // Base maps
@ -77,6 +79,8 @@ const layerCategories = [
census_bureau, census_bureau,
states, states,
national_land, national_land,
cellular,
light_pollution,
]; ];
export default layerCategories; export default layerCategories;

28
layers/light_pollution.js Normal file
View file

@ -0,0 +1,28 @@
import { XYZ } from 'ol/source.js';
import TileLayer from 'ol/layer/Tile';
let layers = [];
["2006", "2016", "2020"].forEach(year => {
layers.push({
name: `<a href='https://djlorenz.github.io/astronomy/lp${year}/'>djlorenz ${year}</a>`,
layer:
new TileLayer({
source: new XYZ({
attributions: `David Lorenz's <a href=http://djlorenz.github.io/astronomy/lp${year}/>Light Pollution Atlas ${year}</a>`,
maxZoom: 6,
tilePixelRatio:4,
tileSize: (1024, 1024),
transition: 0,
url: `https://djlorenz.github.io/astronomy/lp${year}/overlay/tiles/tile_{z}_{x}_{y}.png`,
}),
visible:true,
opacity: 0.5,
}),
});
});
export default {
name: "Light Pollution",
layers: layers,
};