mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Use imagery ids instead of names, update blacklist, npm run imagery
This commit is contained in:
@@ -15,7 +15,10 @@
|
||||
- [ ] git checkout master
|
||||
- [ ] npm run translations
|
||||
- [ ] git add . && git commit -m 'npm run translations'
|
||||
- [ ] rm -rf node_modules/editor-layer-index/
|
||||
- [ ] npm install
|
||||
- [ ] npm run imagery
|
||||
- [ ] npm run all
|
||||
- [ ] git add . && git commit -m 'npm run imagery'
|
||||
- [ ] Update `CHANGELOG.md`
|
||||
- [ ] Update version number in `modules/core/context.js`, `package.json`
|
||||
|
||||
7047
data/imagery.json
7047
data/imagery.json
File diff suppressed because it is too large
Load Diff
@@ -7,36 +7,29 @@ var cutoffDate = new Date();
|
||||
cutoffDate.setFullYear(cutoffDate.getFullYear() - 20);
|
||||
|
||||
var blacklist = {
|
||||
"2u": true,
|
||||
"Hike & Bike": true,
|
||||
"OpenStreetMap (German Language)": true,
|
||||
"OpenStreetMap (German Style)": true,
|
||||
"OpenStreetMap (Sorbian Language)": true,
|
||||
"OpenStreetMap (Standard Black & White)": true,
|
||||
"Skobbler": true,
|
||||
'hike_n_bike': true, // 'Hike & Bike'
|
||||
'osm-mapnik-german_style': true, // 'OpenStreetMap (German Style)'
|
||||
'osm-mapnik-black_and_white': true, // 'OpenStreetMap (Standard Black & White)'
|
||||
'skobbler': true, // 'Skobbler'
|
||||
'openpt_map': true, // 'OpenPT Map (overlay)'
|
||||
'tf-cycle': true, // 'Thunderforest OpenCycleMap'
|
||||
'qa_no_address': true, // 'QA No Address'
|
||||
|
||||
"Public Transport (\u00d6PNV)": true, // https://github.com/osmlab/editor-imagery-index/issues/15
|
||||
'OSM-US-TIGER-Roads_Overlay-2012': true,
|
||||
|
||||
"TIGER 2012 Roads Overlay": true, // https://github.com/openstreetmap/iD/pull/2010,
|
||||
'Waymarked_Trails-Cycling': true,
|
||||
'Waymarked_Trails-Hiking': true,
|
||||
'Waymarked_Trails-MTB': true,
|
||||
'Waymarked_Trails-Skating': true,
|
||||
'Waymarked_Trails-Winter_Sports': true,
|
||||
|
||||
"Thunderforest OpenCycleMap": true,
|
||||
|
||||
"Waymarked Trails: Cycling": true,
|
||||
"Waymarked Trails: Hiking": true,
|
||||
"Waymarked Trails: MTB": true,
|
||||
"Waymarked Trails: Skating": true,
|
||||
"Waymarked Trails: Winter Sports": true,
|
||||
|
||||
"OSM Inspector: Geometry": true,
|
||||
"OSM Inspector: Highways": true,
|
||||
"OSM Inspector: Multipolygon": true,
|
||||
"OSM Inspector: Places": true,
|
||||
"OSM Inspector: Tagging": true,
|
||||
"OSM Inspector: Addresses (EU)": true,
|
||||
"OSM Inspector: Boundaries (EU)": true,
|
||||
"OSM Inspector: Routing (EU)": true,
|
||||
|
||||
"QA No Address": true
|
||||
'OSM_Inspector-Addresses': true,
|
||||
'OSM_Inspector-Geometry': true,
|
||||
'OSM_Inspector-Highways': true,
|
||||
'OSM_Inspector-Multipolygon': true,
|
||||
'OSM_Inspector-Places': true,
|
||||
'OSM_Inspector-Routing': true,
|
||||
'OSM_Inspector-Tagging': true
|
||||
};
|
||||
|
||||
var whitelist = [
|
||||
@@ -44,14 +37,14 @@ var whitelist = [
|
||||
];
|
||||
|
||||
var descriptions = {
|
||||
'Mapbox Satellite': 'Satellite and aerial imagery.',
|
||||
'Bing aerial imagery': 'Satellite and aerial imagery.',
|
||||
'OpenStreetMap (Standard)': 'The default OpenStreetMap layer.'
|
||||
'Bing': 'Satellite and aerial imagery.',
|
||||
'Mapbox': 'Satellite and aerial imagery.',
|
||||
'MAPNIK': 'The default OpenStreetMap layer.'
|
||||
};
|
||||
|
||||
sources.concat(whitelist).forEach(function(source) {
|
||||
if (source.type !== 'tms' && source.type !== 'bing') return;
|
||||
if (source.name in blacklist) return;
|
||||
if (source.id in blacklist) return;
|
||||
|
||||
if (source.end_date) {
|
||||
var endDate = new Date(source.end_date),
|
||||
@@ -60,15 +53,15 @@ sources.concat(whitelist).forEach(function(source) {
|
||||
}
|
||||
|
||||
var im = {
|
||||
id: source.id,
|
||||
name: source.name,
|
||||
type: source.type
|
||||
type: source.type,
|
||||
template: source.url
|
||||
};
|
||||
|
||||
var description = source.description || descriptions[im.name];
|
||||
var description = source.description || descriptions[im.id];
|
||||
if (description) im.description = description;
|
||||
|
||||
im.template = source.url;
|
||||
|
||||
var extent = source.extent || {};
|
||||
if (extent.min_zoom || extent.max_zoom) {
|
||||
im.scaleExtent = [
|
||||
@@ -89,7 +82,7 @@ sources.concat(whitelist).forEach(function(source) {
|
||||
]];
|
||||
}
|
||||
|
||||
if (source.name === 'Locator Overlay') {
|
||||
if (source.id === 'mapbox_locator_overlay') {
|
||||
im.overzoom = false;
|
||||
}
|
||||
|
||||
@@ -104,7 +97,7 @@ sources.concat(whitelist).forEach(function(source) {
|
||||
im.terms_html = attribution.html;
|
||||
}
|
||||
|
||||
['id', 'default', 'overlay', 'best'].forEach(function(a) {
|
||||
['default', 'overlay', 'best'].forEach(function(a) {
|
||||
if (source[a]) {
|
||||
im[a] = source[a];
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ export function rendererBackground(context) {
|
||||
.data([0]);
|
||||
|
||||
base.enter()
|
||||
.insert('div', '.layer-data')
|
||||
.insert('div', '.layer-data')
|
||||
.attr('class', 'layer layer-background')
|
||||
.merge(base)
|
||||
.merge(base)
|
||||
.call(baseLayer);
|
||||
|
||||
var overlays = selection.selectAll('.layer-overlay')
|
||||
@@ -39,16 +39,19 @@ export function rendererBackground(context) {
|
||||
.remove();
|
||||
|
||||
overlays.enter()
|
||||
.insert('div', '.layer-data')
|
||||
.insert('div', '.layer-data')
|
||||
.attr('class', 'layer layer-overlay')
|
||||
.merge(overlays)
|
||||
.merge(overlays)
|
||||
.each(function(layer) { d3.select(this).call(layer); });
|
||||
}
|
||||
|
||||
|
||||
background.updateImagery = function() {
|
||||
var b = background.baseLayerSource(),
|
||||
o = overlayLayers.map(function (d) { return d.source().id; }).join(','),
|
||||
o = overlayLayers
|
||||
.filter(function (d) { return !d.source().isLocatorOverlay(); })
|
||||
.map(function (d) { return d.source().id; })
|
||||
.join(','),
|
||||
meters = geoOffsetToMeters(b.offset()),
|
||||
epsilon = 0.01,
|
||||
x = +meters[0].toFixed(2),
|
||||
@@ -82,12 +85,9 @@ export function rendererBackground(context) {
|
||||
|
||||
var imageryUsed = [b.imageryUsed()];
|
||||
|
||||
overlayLayers.forEach(function (d) {
|
||||
var source = d.source();
|
||||
if (!source.isLocatorOverlay()) {
|
||||
imageryUsed.push(source.imageryUsed());
|
||||
}
|
||||
});
|
||||
overlayLayers
|
||||
.filter(function (d) { return !d.source().isLocatorOverlay(); })
|
||||
.forEach(function (d) { imageryUsed.push(d.source().imageryUsed()); });
|
||||
|
||||
var gpx = context.layers().layer('gpx');
|
||||
if (gpx && gpx.enabled() && gpx.hasGpx()) {
|
||||
|
||||
@@ -47,7 +47,7 @@ export function rendererBackgroundSource(data) {
|
||||
|
||||
|
||||
source.imageryUsed = function() {
|
||||
return source.id || name;
|
||||
return name || source.id;
|
||||
};
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ export function rendererBackgroundSource(data) {
|
||||
|
||||
|
||||
source.isLocatorOverlay = function() {
|
||||
return name === 'Locator Overlay';
|
||||
return source.id === 'mapbox_locator_overlay';
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user