mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Revert #7428
This commit is contained in:
@@ -15,7 +15,8 @@ To report an issue with missing or cloudy imagery:
|
||||
* _For Bing Satellite layer:_ Open the location in [Bing Maps](https://www.bing.com/maps), click the "Feedback" button and choose "Report a map problem" option.
|
||||
* _For Esri World Imagery:_ You can open a new issue using the [Imagery Map Feedback tool](https://www.arcgis.com/home/item.html?id=ebdfa4146680410bb952c7d532ea5407).
|
||||
|
||||
iD's list of available background imagery sources come from the [@ideditor/imagery-index](https://github.com/ideditor/imagery-index) project. If you know of a more recent imagery source that is licensed for this use,
|
||||
iD's list of available background imagery sources come from the [editor-layer-index](https://github.com/osmlab/editor-layer-index)
|
||||
project. If you know of a more recent imagery source that is licensed for this use,
|
||||
please open a request there with the link and license details.
|
||||
|
||||
|
||||
|
||||
+2
-3
@@ -24,7 +24,7 @@ Details on that are [here](https://github.com/openstreetmap/iD/blob/master/modul
|
||||
|
||||
### Background imagery and other third party services
|
||||
|
||||
If you use background or streetside imagery to aid your edits, your browser must fetch information and images from a third-party imagery host. That use is governed by the respective privacy policies of each imagery host. The [Imagery Index](https://github.com/ideditor/imagery-index) and [iD Editor GitHub code](https://github.com/openstreetmap/iD/blob/master/modules/ui/map_data.js) provide detailed information as to imagery layers available in iD. In addition, you may use third party services to assist your editing or check for errors. See [here](https://github.com/openstreetmap/iD/tree/master/modules/services) for details. If you do not wish to interact with these third parties, do not use these features.
|
||||
If you use background or streetside imagery to aid your edits, your browser must fetch information and images from a third-party imagery host. That use is governed by the respective privacy policies of each imagery host. The [Editor Layer Index](https://github.com/osmlab/editor-layer-index) and [iD Editor GitHub code](https://github.com/openstreetmap/iD/blob/master/modules/ui/map_data.js) provides detailed information as to imagery layer available in iD. In addition, you may use third party services to assist your editing or check for errors. See [here](https://github.com/openstreetmap/iD/tree/master/modules/services) for details. If you do not wish to interact with these third parties, do not use these features.
|
||||
|
||||
### Name Suggestion Index
|
||||
|
||||
@@ -37,5 +37,4 @@ If you believe that we hold information that would allow us to correct, amend, o
|
||||
|
||||
### Changelog
|
||||
|
||||
* _2020-Mar-02_ - Swap osmlab/editor-layer-index -> ideditor/imagery-index
|
||||
* _2019-Dec-17_ - Initial version.
|
||||
* _2019-Dec-17_ - Initial version.
|
||||
@@ -87,18 +87,16 @@ development, see [CONTRIBUTING.md](CONTRIBUTING.md).
|
||||
iD is available under the [ISC License](https://opensource.org/licenses/ISC).
|
||||
See the [LICENSE.md](LICENSE.md) file for more details.
|
||||
|
||||
iD also relies on portions of the following open source software.
|
||||
iD also bundles portions of the following open source software.
|
||||
|
||||
* [D3.js (BSD-3-Clause)](https://github.com/d3/d3)
|
||||
* [CLDR (Unicode Consortium Terms of Use)](https://github.com/unicode-cldr/cldr-json)
|
||||
* [editor-layer-index (CC-BY-SA 3.0)](https://github.com/osmlab/editor-layer-index)
|
||||
* [Font Awesome (CC-BY 4.0)](https://fontawesome.com/license)
|
||||
* [Maki (CC0 1.0)](https://github.com/mapbox/maki)
|
||||
* [Temaki (CC0 1.0)](https://github.com/ideditor/temaki)
|
||||
* [Mapillary JS (MIT)](https://github.com/mapillary/mapillary-js)
|
||||
* [Pannellum (MIT)](https://github.com/mpetroff/pannellum)
|
||||
* [name-suggestion-index (BSD-3-Clause)](https://github.com/osmlab/name-suggestion-index)
|
||||
* [osm-community-index (ISC)](https://github.com/osmlab/osm-community-index)
|
||||
* [imagery-index (ISC)](https://github.com/ideditor/imagery-index)
|
||||
|
||||
|
||||
## Thank you
|
||||
|
||||
+4
-1
@@ -16,8 +16,11 @@ on the iD project, and then create this file with contents like<br><pre>
|
||||
#### Update `2.x` branch
|
||||
```bash
|
||||
$ git checkout 2.x
|
||||
$ npm run install
|
||||
$ rm -rf node_modules/editor-layer-index/
|
||||
$ npm install
|
||||
$ npm run imagery
|
||||
$ npm run all
|
||||
$ git add . && git commit -m 'npm run imagery'
|
||||
$ npm run translations
|
||||
$ git add . && git commit -m 'npm run translations'
|
||||
```
|
||||
|
||||
+1
-1
@@ -733,7 +733,7 @@ en:
|
||||
custom_background:
|
||||
tooltip: Edit custom background
|
||||
header: Custom Background Settings
|
||||
instructions: "Enter a tile URL template below.\n\nSupported WMS tokens:\n `{proj}`: requested projection (`EPSG:3857` only)\n `{wkid}`: same as proj, but without the EPSG (`3857` only)\n `{width}`, `{height}`: requested image dimensions (`256` only)\n `{bbox}`: requested bounding box (e.g. `minX,minY,maxX,maxY`)\n\nSupported TMS tokens:\n `{zoom}` or `{z}, `{x}`, `{y}`: Z/X/Y tile coordinates\n `{-y}` or `{ty}`: flipped TMS-style Y coordinates\n `{switch:a,b,c}`: DNS server multiplexing\n `{u}`: quadtile (Bing) scheme\n\nExample:\n{example}"
|
||||
instructions: "Enter a tile URL template. Valid tokens are:\n {zoom} or {z}, {x}, {y} for Z/X/Y tile scheme\n {-y} or {ty} for flipped TMS-style Y coordinates\n {u} for quadtile scheme\n {switch:a,b,c} for DNS server multiplexing\n\nExample:\n{example}"
|
||||
template:
|
||||
placeholder: Enter a url template
|
||||
custom_data:
|
||||
|
||||
+78762
File diff suppressed because it is too large
Load Diff
Vendored
+207
-321
@@ -924,7 +924,7 @@
|
||||
"custom_background": {
|
||||
"tooltip": "Edit custom background",
|
||||
"header": "Custom Background Settings",
|
||||
"instructions": "Enter a tile URL template below.\n\nSupported WMS tokens:\n `{proj}`: requested projection (`EPSG:3857` only)\n `{wkid}`: same as proj, but without the EPSG (`3857` only)\n `{width}`, `{height}`: requested image dimensions (`256` only)\n `{bbox}`: requested bounding box (e.g. `minX,minY,maxX,maxY`)\n\nSupported TMS tokens:\n `{zoom}` or `{z}, `{x}`, `{y}`: Z/X/Y tile coordinates\n `{-y}` or `{ty}`: flipped TMS-style Y coordinates\n `{switch:a,b,c}`: DNS server multiplexing\n `{u}`: quadtile (Bing) scheme\n\nExample:\n{example}",
|
||||
"instructions": "Enter a tile URL template. Valid tokens are:\n {zoom} or {z}, {x}, {y} for Z/X/Y tile scheme\n {-y} or {ty} for flipped TMS-style Y coordinates\n {u} for quadtile scheme\n {switch:a,b,c} for DNS server multiplexing\n\nExample:\n{example}",
|
||||
"template": {
|
||||
"placeholder": "Enter a url template"
|
||||
}
|
||||
@@ -10094,153 +10094,115 @@
|
||||
},
|
||||
"imagery": {
|
||||
"AGIV": {
|
||||
"name": "AIV Flanders most recent aerial imagery",
|
||||
"attribution": {
|
||||
"text": "© agentschap Informatie Vlaanderen"
|
||||
}
|
||||
},
|
||||
"name": "AIV Flanders most recent aerial imagery"
|
||||
},
|
||||
"AGIV10cm": {
|
||||
"name": "AIV Flanders 2013-2015 aerial imagery 10cm",
|
||||
"attribution": {
|
||||
"text": "© agentschap Informatie Vlaanderen"
|
||||
}
|
||||
},
|
||||
"name": "AIV Flanders 2013-2015 aerial imagery 10cm"
|
||||
},
|
||||
"AGIVFlandersGRB": {
|
||||
"name": "AIV Flanders GRB",
|
||||
"attribution": {
|
||||
"text": "© agentschap Informatie Vlaanderen"
|
||||
}
|
||||
},
|
||||
"name": "AIV Flanders GRB"
|
||||
},
|
||||
"AIV_DHMV_II_HILL_25cm": {
|
||||
"name": "AIV Digitaal Hoogtemodel Vlaanderen II, multidirectionale hillshade 0,25 m",
|
||||
"attribution": {
|
||||
"text": "© agentschap Informatie Vlaanderen"
|
||||
}
|
||||
},
|
||||
"name": "AIV Digitaal Hoogtemodel Vlaanderen II, multidirectionale hillshade 0,25 m"
|
||||
},
|
||||
"AIV_DHMV_II_SVF_25cm": {
|
||||
"name": "AIV Digitaal Hoogtemodel Vlaanderen II, Skyview factor 0,25 m",
|
||||
"attribution": {
|
||||
"text": "© agentschap Informatie Vlaanderen"
|
||||
}
|
||||
},
|
||||
"name": "AIV Digitaal Hoogtemodel Vlaanderen II, Skyview factor 0,25 m"
|
||||
},
|
||||
"Bing": {
|
||||
"name": "Bing aerial imagery",
|
||||
"description": "Satellite and aerial imagery."
|
||||
"description": "Satellite and aerial imagery.",
|
||||
"name": "Bing aerial imagery"
|
||||
},
|
||||
"EOXAT2018CLOUDLESS": {
|
||||
"name": "eox.at 2018 cloudless",
|
||||
"description": "Post-processed Sentinel Satellite imagery.",
|
||||
"attribution": {
|
||||
"text": "Sentinel-2 cloudless - https://s2maps.eu by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2017 & 2018)"
|
||||
}
|
||||
},
|
||||
"description": "Post-processed Sentinel Satellite imagery.",
|
||||
"name": "eox.at 2018 cloudless"
|
||||
},
|
||||
"EsriWorldImagery": {
|
||||
"name": "Esri World Imagery",
|
||||
"description": "Esri world imagery.",
|
||||
"attribution": {
|
||||
"text": "Terms & Feedback"
|
||||
}
|
||||
},
|
||||
"description": "Esri world imagery.",
|
||||
"name": "Esri World Imagery"
|
||||
},
|
||||
"EsriWorldImageryClarity": {
|
||||
"name": "Esri World Imagery (Clarity) Beta",
|
||||
"description": "Esri archive imagery that may be clearer and more accurate than the default layer.",
|
||||
"attribution": {
|
||||
"text": "Terms & Feedback"
|
||||
}
|
||||
},
|
||||
"HDM_HOT": {
|
||||
"name": "OpenStreetMap (HOT Style)",
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors, tiles courtesy of Humanitarian OpenStreetMap Team"
|
||||
}
|
||||
},
|
||||
"description": "Esri archive imagery that may be clearer and more accurate than the default layer.",
|
||||
"name": "Esri World Imagery (Clarity) Beta"
|
||||
},
|
||||
"MAPNIK": {
|
||||
"name": "OpenStreetMap (Standard)",
|
||||
"description": "The default OpenStreetMap layer.",
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors, CC-BY-SA 2.0"
|
||||
}
|
||||
},
|
||||
"description": "The default OpenStreetMap layer.",
|
||||
"name": "OpenStreetMap (Standard)"
|
||||
},
|
||||
"Mapbox": {
|
||||
"name": "Mapbox Satellite",
|
||||
"attribution": {
|
||||
"text": "Terms & Feedback"
|
||||
},
|
||||
"description": "Satellite and aerial imagery.",
|
||||
"attribution": {
|
||||
"text": "Terms & Feedback"
|
||||
}
|
||||
},
|
||||
"Maxar-Premium": {
|
||||
"name": "Maxar Premium Imagery (Beta)",
|
||||
"description": "Maxar Premium is a mosaic composed of Maxar basemap with select regions filled with +Vivid or custom area of interest imagery, 50cm resolution or better, and refreshed more frequently with ongoing updates.",
|
||||
"attribution": {
|
||||
"text": "Terms & Feedback"
|
||||
}
|
||||
},
|
||||
"Maxar-Standard": {
|
||||
"name": "Maxar Standard Imagery (Beta)",
|
||||
"description": "Maxar Standard is a curated set of imagery covering 86% of the earth’s landmass, with 30-60cm resolution where available, backfilled by Landsat. Average age is 2.31 years, with some areas updated 2x per year.",
|
||||
"attribution": {
|
||||
"text": "Terms & Feedback"
|
||||
}
|
||||
"name": "Mapbox Satellite"
|
||||
},
|
||||
"OSM_Inspector-Addresses": {
|
||||
"name": "OSM Inspector: Addresses",
|
||||
"attribution": {
|
||||
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"name": "OSM Inspector: Addresses"
|
||||
},
|
||||
"OSM_Inspector-Geometry": {
|
||||
"name": "OSM Inspector: Geometry",
|
||||
"attribution": {
|
||||
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"name": "OSM Inspector: Geometry"
|
||||
},
|
||||
"OSM_Inspector-Highways": {
|
||||
"name": "OSM Inspector: Highways",
|
||||
"attribution": {
|
||||
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"name": "OSM Inspector: Highways"
|
||||
},
|
||||
"OSM_Inspector-Multipolygon": {
|
||||
"name": "OSM Inspector: Area",
|
||||
"attribution": {
|
||||
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"name": "OSM Inspector: Area"
|
||||
},
|
||||
"OSM_Inspector-Places": {
|
||||
"name": "OSM Inspector: Places",
|
||||
"attribution": {
|
||||
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"name": "OSM Inspector: Places"
|
||||
},
|
||||
"OSM_Inspector-Routing": {
|
||||
"name": "OSM Inspector: Routing",
|
||||
"attribution": {
|
||||
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"name": "OSM Inspector: Routing"
|
||||
},
|
||||
"OSM_Inspector-Tagging": {
|
||||
"name": "OSM Inspector: Tagging",
|
||||
"attribution": {
|
||||
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"OpenTopoMap": {
|
||||
"name": "OpenTopoMap",
|
||||
"attribution": {
|
||||
"text": "Kartendaten: © OpenStreetMap-Mitwirkende, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA)"
|
||||
}
|
||||
},
|
||||
"SPW2009": {
|
||||
"name": "SPW(allonie) 2009-2010 aerial imagery"
|
||||
},
|
||||
"SPW2012": {
|
||||
"name": "SPW(allonie) 2012-2013 aerial imagery"
|
||||
},
|
||||
"SPW2015": {
|
||||
"name": "SPW(allonie) 2015 aerial imagery"
|
||||
},
|
||||
"SPW2016": {
|
||||
"name": "SPW(allonie) 2016 aerial imagery"
|
||||
},
|
||||
"name": "OSM Inspector: Tagging"
|
||||
},
|
||||
"SPW_ORTHO_LAST": {
|
||||
"name": "SPW(allonie) most recent aerial imagery"
|
||||
@@ -10248,441 +10210,365 @@
|
||||
"SPW_PICC": {
|
||||
"name": "SPW(allonie) PICC numerical imagery"
|
||||
},
|
||||
"SPWrelief2014": {
|
||||
"name": "SPW(allonie) shaded relief"
|
||||
"US-TIGER-Roads-2014": {
|
||||
"description": "At zoom level 16+, public domain map data from the US Census. At lower zooms, only changes since 2006 minus changes already incorporated into OpenStreetMap",
|
||||
"name": "TIGER Roads 2014"
|
||||
},
|
||||
"TEClines": {
|
||||
"name": "TEC bus lines"
|
||||
"US-TIGER-Roads-2017": {
|
||||
"description": "Yellow = Public domain map data from the US Census. Red = Data not found in OpenStreetMap",
|
||||
"name": "TIGER Roads 2017"
|
||||
},
|
||||
"TECstops": {
|
||||
"name": "TEC bus stops"
|
||||
"US-TIGER-Roads-2018": {
|
||||
"description": "Yellow = Public domain map data from the US Census. Red = Data not found in OpenStreetMap",
|
||||
"name": "TIGER Roads 2018"
|
||||
},
|
||||
"URBIS2009": {
|
||||
"name": "URBIS 2009 aerial imagery",
|
||||
"attribution": {
|
||||
"text": "Realized by means of Brussels UrbIS®© - Distribution & Copyright CIRB"
|
||||
}
|
||||
"US-TIGER-Roads-2019": {
|
||||
"description": "Yellow = Public domain map data from the US Census. Red = Data not found in OpenStreetMap",
|
||||
"name": "TIGER Roads 2019"
|
||||
},
|
||||
"URBIS2012": {
|
||||
"name": "URBIS 2012 aerial imagery",
|
||||
"attribution": {
|
||||
"text": "Realized by means of Brussels UrbIS®© - Distribution & Copyright CIRB"
|
||||
}
|
||||
"USDA-NAIP": {
|
||||
"description": "The most recent year of DOQQs from the National Agriculture Imagery Program (NAIP) for each state in the contiguous United States.",
|
||||
"name": "National Agriculture Imagery Program"
|
||||
},
|
||||
"URBIS2014": {
|
||||
"name": "URBIS 2014 aerial imagery",
|
||||
"attribution": {
|
||||
"text": "Realized by means of Brussels UrbIS®© - Distribution & Copyright CIRB"
|
||||
}
|
||||
},
|
||||
"URBIS2015": {
|
||||
"name": "URBIS 2015 aerial imagery",
|
||||
"attribution": {
|
||||
"text": "Realized by means of Brussels UrbIS®© - Distribution & Copyright CIRB"
|
||||
}
|
||||
},
|
||||
"URBISfr2013": {
|
||||
"name": "URBISfr numerical imagery (2013)",
|
||||
"attribution": {
|
||||
"text": "Realized by means of Brussels UrbIS®© - Distribution & Copyright CIRB"
|
||||
}
|
||||
},
|
||||
"URBISnl2013": {
|
||||
"name": "URBISnl numerical imagery (2013)",
|
||||
"attribution": {
|
||||
"text": "Realized by means of Brussels UrbIS®© - Distribution & Copyright CIRB"
|
||||
}
|
||||
"US_Forest_Service_roads_overlay": {
|
||||
"description": "Highway: Green casing = unclassified. Brown casing = track. Surface: gravel = light brown fill, Asphalt = black, paved = gray, ground =white, concrete = blue, grass = green. Seasonal = white bars",
|
||||
"name": "U.S. Forest Roads Overlay"
|
||||
},
|
||||
"UrbISOrtho2016": {
|
||||
"name": "UrbIS-Ortho 2016",
|
||||
"attribution": {
|
||||
"text": "Realized by means of Brussels UrbIS®© - Distribution & Copyright CIRB"
|
||||
}
|
||||
},
|
||||
"name": "UrbIS-Ortho 2016"
|
||||
},
|
||||
"UrbISOrtho2017": {
|
||||
"name": "UrbIS-Ortho 2017",
|
||||
"attribution": {
|
||||
"text": "Realized by means of Brussels UrbIS®© - Distribution & Copyright CIRB"
|
||||
}
|
||||
},
|
||||
"name": "UrbIS-Ortho 2017"
|
||||
},
|
||||
"UrbISOrtho2018": {
|
||||
"name": "UrbIS-Ortho 2018",
|
||||
"attribution": {
|
||||
"text": "Realized by means of Brussels UrbIS®© - Distribution & Copyright CIRB"
|
||||
}
|
||||
},
|
||||
"name": "UrbIS-Ortho 2018"
|
||||
},
|
||||
"UrbISOrtho2019": {
|
||||
"name": "UrbIS-Ortho 2019",
|
||||
"attribution": {
|
||||
"text": "Realized by means of Brussels UrbIS®© - Distribution & Copyright CIRB"
|
||||
}
|
||||
},
|
||||
"name": "UrbIS-Ortho 2019"
|
||||
},
|
||||
"UrbisAdmFR": {
|
||||
"name": "UrbisAdm FR",
|
||||
"attribution": {
|
||||
"text": "Realized by means of Brussels UrbIS®© - Distribution & Copyright CIRB"
|
||||
}
|
||||
},
|
||||
"name": "UrbisAdm FR"
|
||||
},
|
||||
"UrbisAdmNL": {
|
||||
"name": "UrbisAdm NL",
|
||||
"attribution": {
|
||||
"text": "Realized by means of Brussels UrbIS®© - Distribution & Copyright CIRB"
|
||||
}
|
||||
},
|
||||
"name": "UrbisAdm NL"
|
||||
},
|
||||
"Waymarked_Trails-Cycling": {
|
||||
"name": "Waymarked Trails: Cycling",
|
||||
"attribution": {
|
||||
"text": "© waymarkedtrails.org, OpenStreetMap contributors, CC by-SA 3.0"
|
||||
}
|
||||
},
|
||||
"name": "Waymarked Trails: Cycling"
|
||||
},
|
||||
"Waymarked_Trails-Hiking": {
|
||||
"name": "Waymarked Trails: Hiking",
|
||||
"attribution": {
|
||||
"text": "© waymarkedtrails.org, OpenStreetMap contributors, CC by-SA 3.0"
|
||||
}
|
||||
},
|
||||
"Waymarked_Trails-Horse_Riding": {
|
||||
"name": "Waymarked Trails: Horse Riding",
|
||||
"attribution": {
|
||||
"text": "© waymarkedtrails.org, OpenStreetMap contributors, CC by-SA 3.0"
|
||||
}
|
||||
},
|
||||
"name": "Waymarked Trails: Hiking"
|
||||
},
|
||||
"Waymarked_Trails-MTB": {
|
||||
"name": "Waymarked Trails: MTB",
|
||||
"attribution": {
|
||||
"text": "© waymarkedtrails.org, OpenStreetMap contributors, CC by-SA 3.0"
|
||||
}
|
||||
},
|
||||
"name": "Waymarked Trails: MTB"
|
||||
},
|
||||
"Waymarked_Trails-Skating": {
|
||||
"name": "Waymarked Trails: Skating",
|
||||
"attribution": {
|
||||
"text": "© waymarkedtrails.org, OpenStreetMap contributors, CC by-SA 3.0"
|
||||
}
|
||||
},
|
||||
"name": "Waymarked Trails: Skating"
|
||||
},
|
||||
"Waymarked_Trails-Winter_Sports": {
|
||||
"name": "Waymarked Trails: Winter Sports",
|
||||
"attribution": {
|
||||
"text": "© waymarkedtrails.org, OpenStreetMap contributors, CC by-SA 3.0"
|
||||
}
|
||||
},
|
||||
"name": "Waymarked Trails: Winter Sports"
|
||||
},
|
||||
"basemap.at": {
|
||||
"name": "basemap.at",
|
||||
"description": "Basemap of Austria, based on government data.",
|
||||
"attribution": {
|
||||
"text": "basemap.at"
|
||||
}
|
||||
},
|
||||
"description": "Basemap of Austria, based on government data.",
|
||||
"name": "basemap.at"
|
||||
},
|
||||
"basemap.at-orthofoto": {
|
||||
"name": "basemap.at Orthofoto",
|
||||
"description": "Orthofoto layer provided by basemap.at. \"Successor\" of geoimage.at imagery.",
|
||||
"attribution": {
|
||||
"text": "basemap.at"
|
||||
}
|
||||
},
|
||||
"description": "Orthofoto layer provided by basemap.at. \"Successor\" of geoimage.at imagery.",
|
||||
"name": "basemap.at Orthofoto"
|
||||
},
|
||||
"basemap.at-overlay": {
|
||||
"name": "basemap.at Overlay",
|
||||
"description": "Annotation overlay provided by basemap.at.",
|
||||
"attribution": {
|
||||
"text": "basemap.at"
|
||||
}
|
||||
},
|
||||
"description": "Annotation overlay provided by basemap.at.",
|
||||
"name": "basemap.at Overlay"
|
||||
},
|
||||
"eufar-balaton": {
|
||||
"attribution": {
|
||||
"text": "EUFAR Balaton ortofotó 2010"
|
||||
},
|
||||
"description": "1940 geo-tagged photography from Balaton Limnological Institute.",
|
||||
"name": "EUFAR Balaton orthophotos"
|
||||
},
|
||||
"finds.jp_KBN_2500": {
|
||||
"name": "Japan GSI KIBAN 2500",
|
||||
"description": "GSI Kiban 2500 via finds.jp. Good for tracing, but a bit older.",
|
||||
"attribution": {
|
||||
"text": "GSI KIBAN 2500"
|
||||
}
|
||||
},
|
||||
"description": "GSI Kiban 2500 via finds.jp. Good for tracing, but a bit older.",
|
||||
"name": "Japan GSI KIBAN 2500"
|
||||
},
|
||||
"gothenburg-citymap": {
|
||||
"name": "Gothenburg City map",
|
||||
"description": "The city map is an overview map that describes Gothenburg. It contains general information about land, communications, hydrography, buildings, address numbers and street names, administrative division and other orientation text.",
|
||||
"attribution": {
|
||||
"text": "© Gothenburg municipality, CC0"
|
||||
}
|
||||
},
|
||||
"description": "The city map is an overview map that describes Gothenburg. It contains general information about land, communications, hydrography, buildings, address numbers and street names, administrative division and other orientation text.",
|
||||
"name": "Gothenburg City map"
|
||||
},
|
||||
"gothenburg-ortho": {
|
||||
"name": "Gothenburg Orthophoto",
|
||||
"description": "Orthophoto for Gothenburg municipality",
|
||||
"attribution": {
|
||||
"text": "© Gothenburg municipality, CC0"
|
||||
}
|
||||
},
|
||||
"description": "Orthophoto for Gothenburg municipality",
|
||||
"name": "Gothenburg Orthophoto"
|
||||
},
|
||||
"gsi.go.jp_airphoto": {
|
||||
"name": "Japan GSI airphoto Imagery",
|
||||
"description": "Japan GSI airphoto Imagery. Not fully orthorectified, but a bit newer and/or differently covered than GSI ortho Imagery.",
|
||||
"attribution": {
|
||||
"text": "GSI Japan"
|
||||
}
|
||||
},
|
||||
"description": "Japan GSI airphoto Imagery. Not fully orthorectified, but a bit newer and/or differently covered than GSI ortho Imagery.",
|
||||
"name": "Japan GSI airphoto Imagery"
|
||||
},
|
||||
"gsi.go.jp_seamlessphoto": {
|
||||
"name": "Japan GSI seamlessphoto Imagery",
|
||||
"description": "Japan GSI seamlessphoto Imagery. The collection of latest imageries of GSI ortho, airphoto, post disaster and others.",
|
||||
"attribution": {
|
||||
"text": "GSI Japan seamless photo"
|
||||
}
|
||||
},
|
||||
"description": "Japan GSI seamlessphoto Imagery. The collection of latest imageries of GSI ortho, airphoto, post disaster and others.",
|
||||
"name": "Japan GSI seamlessphoto Imagery"
|
||||
},
|
||||
"gsi.go.jp_std_map": {
|
||||
"name": "Japan GSI Standard Map",
|
||||
"description": "Japan GSI Standard Map. Widely covered.",
|
||||
"attribution": {
|
||||
"text": "GSI Japan"
|
||||
}
|
||||
},
|
||||
"description": "Japan GSI Standard Map. Widely covered.",
|
||||
"name": "Japan GSI Standard Map"
|
||||
},
|
||||
"helsingborg-orto": {
|
||||
"name": "Helsingborg Orthophoto",
|
||||
"description": "Orthophotos from the municipality of Helsingborg 2016, public domain",
|
||||
"attribution": {
|
||||
"text": "© Helsingborg municipality"
|
||||
}
|
||||
},
|
||||
"description": "Orthophotos from the municipality of Helsingborg 2016, public domain",
|
||||
"name": "Helsingborg Orthophoto"
|
||||
},
|
||||
"kalmar-orto-2014": {
|
||||
"name": "Kalmar North Orthophoto 2014",
|
||||
"description": "Orthophotos for the north coast of the municipality of Kalmar 2014",
|
||||
"attribution": {
|
||||
"text": "© Kalmar municipality"
|
||||
}
|
||||
},
|
||||
"description": "Orthophotos for the north coast of the municipality of Kalmar 2014",
|
||||
"name": "Kalmar North Orthophoto 2014"
|
||||
},
|
||||
"kalmar-orto-2016": {
|
||||
"name": "Kalmar South Orthophoto 2016",
|
||||
"description": "Orthophotos for the south coast of the municipality of Kalmar 2016",
|
||||
"attribution": {
|
||||
"text": "© Kalmar municipality"
|
||||
}
|
||||
},
|
||||
"description": "Orthophotos for the south coast of the municipality of Kalmar 2016",
|
||||
"name": "Kalmar South Orthophoto 2016"
|
||||
},
|
||||
"kalmar-orto-2018": {
|
||||
"name": "Kalmar Urban Orthophoto 2018",
|
||||
"description": "Orthophotos for urban areas of the municipality of Kalmar 2018",
|
||||
"attribution": {
|
||||
"text": "© Kalmar municipality"
|
||||
}
|
||||
},
|
||||
"description": "Orthophotos for urban areas of the municipality of Kalmar 2018",
|
||||
"name": "Kalmar Urban Orthophoto 2018"
|
||||
},
|
||||
"kelkkareitit": {
|
||||
"name": "Nordic snowmobile overlay",
|
||||
"description": "Kelkkareitit.fi snowmobile trails from OSM (Nordic coverage)",
|
||||
"attribution": {
|
||||
"text": "© Kelkkareitit.fi"
|
||||
}
|
||||
},
|
||||
"description": "Kelkkareitit.fi snowmobile trails from OSM (Nordic coverage)",
|
||||
"name": "Nordic snowmobile overlay"
|
||||
},
|
||||
"lantmateriet-orto1960": {
|
||||
"name": "Lantmäteriet Historic Orthophoto 1960",
|
||||
"description": "Mosaic of Swedish orthophotos from the period 1955–1965. Older and younger pictures may occur.",
|
||||
"attribution": {
|
||||
"text": "© Lantmäteriet, CC0"
|
||||
}
|
||||
},
|
||||
"description": "Mosaic of Swedish orthophotos from the period 1955–1965. Older and younger pictures may occur.",
|
||||
"name": "Lantmäteriet Historic Orthophoto 1960"
|
||||
},
|
||||
"lantmateriet-orto1975": {
|
||||
"name": "Lantmäteriet Historic Orthophoto 1975",
|
||||
"description": "Mosaic of Swedish orthophotos from the period 1970–1980. Is under construction.",
|
||||
"attribution": {
|
||||
"text": "© Lantmäteriet, CC0"
|
||||
}
|
||||
},
|
||||
"description": "Mosaic of Swedish orthophotos from the period 1970–1980. Is under construction.",
|
||||
"name": "Lantmäteriet Historic Orthophoto 1975"
|
||||
},
|
||||
"lantmateriet-topowebb": {
|
||||
"name": "Lantmäteriet Topographic Map",
|
||||
"description": "Topographic map of Sweden 1:50 000",
|
||||
"attribution": {
|
||||
"text": "© Lantmäteriet, CC0"
|
||||
}
|
||||
},
|
||||
"description": "Topographic map of Sweden 1:50 000",
|
||||
"name": "Lantmäteriet Topographic Map"
|
||||
},
|
||||
"linkoping-orto": {
|
||||
"name": "Linköping Orthophoto",
|
||||
"description": "Orthophotos from the municipality of Linköping 2010, open data",
|
||||
"attribution": {
|
||||
"text": "© Linköping municipality"
|
||||
}
|
||||
},
|
||||
"description": "Orthophotos from the municipality of Linköping 2010, open data",
|
||||
"name": "Linköping Orthophoto"
|
||||
},
|
||||
"mapbox_locator_overlay": {
|
||||
"name": "Locator Overlay",
|
||||
"description": "Shows major features to help orient you.",
|
||||
"attribution": {
|
||||
"text": "Terms & Feedback"
|
||||
}
|
||||
},
|
||||
"description": "Shows major features to help orient you.",
|
||||
"name": "Locator Overlay"
|
||||
},
|
||||
"openpt_map": {
|
||||
"name": "OpenPT Map (overlay)",
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"openrailwaymap": {
|
||||
"name": "OpenRailwayMap",
|
||||
"description": "Overlay imagery for railway mapping in OSM",
|
||||
"attribution": {
|
||||
"text": "© OpenRailwayMap.org"
|
||||
}
|
||||
},
|
||||
"openrailwaymap-maxspeeds": {
|
||||
"name": "OpenRailwayMap Maxspeeds",
|
||||
"description": "Overlay imagery showing railway speed limits based on OpenStreetMap data",
|
||||
"attribution": {
|
||||
"text": "Rendering: OpenRailwayMap, © Map data OpenStreetMap contributors"
|
||||
}
|
||||
},
|
||||
"openrailwaymap-signalling": {
|
||||
"name": "OpenRailwayMap Signalling",
|
||||
"description": "Overlay imagery showing railway signals based on OpenStreetMap data",
|
||||
"attribution": {
|
||||
"text": "Rendering: OpenRailwayMap, © Map data OpenStreetMap contributors"
|
||||
}
|
||||
},
|
||||
"openseamap": {
|
||||
"name": "OpenSeaMap",
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"opensnowmap-overlay": {
|
||||
"name": "OpenSnowMap overlay",
|
||||
"description": "Overlay imagery for piste mapping in OSM. Updated daily.",
|
||||
"attribution": {
|
||||
"text": "© OpenSnowMap.org"
|
||||
}
|
||||
},
|
||||
"name": "OpenPT Map (overlay)"
|
||||
},
|
||||
"osm-gps": {
|
||||
"name": "OpenStreetMap GPS traces",
|
||||
"description": "Public GPS traces uploaded to OpenStreetMap.",
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors"
|
||||
}
|
||||
},
|
||||
"description": "Public GPS traces uploaded to OpenStreetMap.",
|
||||
"name": "OpenStreetMap GPS traces"
|
||||
},
|
||||
"osm-mapnik-black_and_white": {
|
||||
"name": "OpenStreetMap (Standard Black & White)",
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"name": "OpenStreetMap (Standard Black & White)"
|
||||
},
|
||||
"osm-mapnik-german_style": {
|
||||
"name": "OpenStreetMap (German Style)",
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"osm-mapnik-no_labels": {
|
||||
"name": "OpenStreetMap (Mapnik, no labels)",
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"osmbe": {
|
||||
"name": "OpenStreetMap (Belgian Style)",
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors, CC-BY-SA; Tiles courtesy of GEO-6"
|
||||
}
|
||||
},
|
||||
"osmbe-fr": {
|
||||
"name": "OpenStreetMap (Belgian Style - French)",
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors, CC-BY-SA; Tiles courtesy of GEO-6"
|
||||
}
|
||||
},
|
||||
"osmbe-nl": {
|
||||
"name": "OpenStreetMap (Belgian Style - Dutch)",
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors, CC-BY-SA; Tiles courtesy of GEO-6"
|
||||
}
|
||||
},
|
||||
"osmfr": {
|
||||
"name": "OpenStreetMap (French Style)",
|
||||
"attribution": {
|
||||
"text": "Tiles © cquest@Openstreetmap France, data © OpenStreetMap contributors, ODBL"
|
||||
}
|
||||
},
|
||||
"name": "OpenStreetMap (German Style)"
|
||||
},
|
||||
"osmse-ekonomiska": {
|
||||
"name": "Lantmäteriet Economic Map 1950–1980",
|
||||
"description": "Scan of \"Economic maps\" ca. 1950–1980",
|
||||
"attribution": {
|
||||
"text": "© Lantmäteriet"
|
||||
}
|
||||
},
|
||||
"public_transport_oepnv": {
|
||||
"name": "Public Transport (ÖPNV)",
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
},
|
||||
"description": "Scan of \"Economic maps\" ca. 1950–1980",
|
||||
"name": "Lantmäteriet Economic Map 1950–1980"
|
||||
},
|
||||
"qa_no_address": {
|
||||
"name": "QA No Address",
|
||||
"attribution": {
|
||||
"text": "Simon Poole, Data ©OpenStreetMap contributors"
|
||||
}
|
||||
},
|
||||
"name": "QA No Address"
|
||||
},
|
||||
"skobbler": {
|
||||
"name": "skobbler",
|
||||
"attribution": {
|
||||
"text": "© Tiles: skobbler Map data: OpenStreetMap contributors"
|
||||
}
|
||||
},
|
||||
"name": "skobbler"
|
||||
},
|
||||
"skoterleder": {
|
||||
"name": "Snowmobile map Sweden",
|
||||
"description": "Snowmobile trails",
|
||||
"attribution": {
|
||||
"text": "© Skoterleder.org"
|
||||
}
|
||||
},
|
||||
"description": "Snowmobile trails",
|
||||
"name": "Snowmobile map Sweden"
|
||||
},
|
||||
"stamen-terrain-background": {
|
||||
"name": "Stamen Terrain",
|
||||
"attribution": {
|
||||
"text": "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL"
|
||||
}
|
||||
},
|
||||
"name": "Stamen Terrain"
|
||||
},
|
||||
"stockholm-orto": {
|
||||
"name": "Stockholm Orthophoto",
|
||||
"description": "Orthophotos from the municipality of Stockholm 2016, CC0 license",
|
||||
"attribution": {
|
||||
"text": "© Stockholm municipality, CC0"
|
||||
}
|
||||
},
|
||||
"description": "Orthophotos from the municipality of Stockholm 2016, CC0 license",
|
||||
"name": "Stockholm Orthophoto"
|
||||
},
|
||||
"tf-cycle": {
|
||||
"name": "Thunderforest OpenCycleMap",
|
||||
"attribution": {
|
||||
"text": "Maps © Thunderforest, Data © OpenStreetMap contributors"
|
||||
}
|
||||
},
|
||||
"name": "Thunderforest OpenCycleMap"
|
||||
},
|
||||
"tf-landscape": {
|
||||
"name": "Thunderforest Landscape",
|
||||
"attribution": {
|
||||
"text": "Maps © Thunderforest, Data © OpenStreetMap contributors"
|
||||
}
|
||||
},
|
||||
"name": "Thunderforest Landscape"
|
||||
},
|
||||
"tf-outdoors": {
|
||||
"name": "Thunderforest Outdoors",
|
||||
"attribution": {
|
||||
"text": "Maps © Thunderforest, Data © OpenStreetMap contributors"
|
||||
}
|
||||
},
|
||||
"name": "Thunderforest Outdoors"
|
||||
},
|
||||
"trafikverket-baninfo": {
|
||||
"name": "Trafikverket Railway Network",
|
||||
"description": "Swedish railway network, including sidings",
|
||||
"attribution": {
|
||||
"text": "© Trafikverket, CC0"
|
||||
}
|
||||
},
|
||||
"description": "Swedish railway network, including sidings",
|
||||
"name": "Trafikverket Railway Network"
|
||||
},
|
||||
"trafikverket-baninfo-option": {
|
||||
"attribution": {
|
||||
"text": "© Trafikverket, CC0"
|
||||
},
|
||||
"description": "Swedish railway network with several options for map layers",
|
||||
"name": "Trafikverket Railway Network options"
|
||||
},
|
||||
"trafikverket-vagnat": {
|
||||
"name": "Trafikverket Road Network",
|
||||
"description": "Swedish NVDB road network",
|
||||
"attribution": {
|
||||
"text": "© Trafikverket, CC0"
|
||||
}
|
||||
},
|
||||
"description": "Swedish NVDB road network",
|
||||
"name": "Trafikverket Road Network"
|
||||
},
|
||||
"trafikverket-vagnat-extra": {
|
||||
"name": "Trafikverket Road Network extra",
|
||||
"description": "Swedish NVDB extra details: Highway reference, traffic calming, rest area, bus stop, bridge, tunnel, speed camera",
|
||||
"attribution": {
|
||||
"text": "© Trafikverket, CC0"
|
||||
}
|
||||
},
|
||||
"description": "Swedish NVDB extra details: Highway reference, traffic calming, rest area, bus stop, bridge, tunnel, speed camera",
|
||||
"name": "Trafikverket Road Network extra"
|
||||
},
|
||||
"trafikverket-vagnat-navn": {
|
||||
"name": "Trafikverket Street Names",
|
||||
"description": "Swedish NVDB street names",
|
||||
"attribution": {
|
||||
"text": "© Trafikverket, CC0"
|
||||
}
|
||||
},
|
||||
"description": "Swedish NVDB street names",
|
||||
"name": "Trafikverket Street Names"
|
||||
},
|
||||
"wikimedia-map": {
|
||||
"name": "Wikimedia Map",
|
||||
"trafikverket-vagnat-option": {
|
||||
"attribution": {
|
||||
"text": "© OpenStreetMap contributors, CC-BY-SA"
|
||||
}
|
||||
"text": "© Trafikverket, CC0"
|
||||
},
|
||||
"description": "Swedish NVDB road network with several options for map layers",
|
||||
"name": "Trafikverket Road Network options"
|
||||
},
|
||||
"wroclaw-orto2018": {
|
||||
"attribution": {
|
||||
"text": "Urząd Miasta Wrocław"
|
||||
},
|
||||
"name": "Wrocław: Orthophotomap 2018 (aerial image)"
|
||||
}
|
||||
},
|
||||
"community": {
|
||||
|
||||
@@ -27,7 +27,7 @@ export function coreContext() {
|
||||
let _deferred = new Set();
|
||||
|
||||
context.version = '2.17.2';
|
||||
context.privacyVersion = '20200312';
|
||||
context.privacyVersion = '20191217';
|
||||
|
||||
|
||||
// https://github.com/openstreetmap/iD/issues/772
|
||||
|
||||
@@ -13,8 +13,7 @@ export function coreData(context) {
|
||||
'address_formats': 'data/address_formats.min.json',
|
||||
'deprecated': 'data/deprecated.min.json',
|
||||
'discarded': 'data/discarded.min.json',
|
||||
'imagery_features': 'https://cdn.jsdelivr.net/npm/@ideditor/imagery-index@0.1/dist/featureCollection.min.json',
|
||||
'imagery_sources': 'https://cdn.jsdelivr.net/npm/@ideditor/imagery-index@0.1/dist/sources.min.json',
|
||||
'imagery': 'data/imagery.min.json',
|
||||
'intro_graph': 'data/intro_graph.min.json',
|
||||
'keepRight': 'data/keepRight.min.json',
|
||||
'languages': 'data/languages.min.json',
|
||||
|
||||
+48
-221
@@ -2,13 +2,14 @@ import { dispatch as d3_dispatch } from 'd3-dispatch';
|
||||
import { interpolateNumber as d3_interpolateNumber } from 'd3-interpolate';
|
||||
import { select as d3_select } from 'd3-selection';
|
||||
|
||||
import LocationConflation from '@ideditor/location-conflation';
|
||||
import whichPolygon from 'which-polygon';
|
||||
|
||||
import { geoExtent, geoMetersToOffset, geoOffsetToMeters} from '../geo';
|
||||
import { rendererBackgroundSource } from './background_source';
|
||||
import { rendererTileLayer } from './tile_layer';
|
||||
import { utilAesDecrypt, utilDetect, utilQsString, utilStringQs, utilRebind } from '../util';
|
||||
import { utilQsString, utilStringQs } from '../util';
|
||||
import { utilDetect } from '../util/detect';
|
||||
import { utilRebind } from '../util/rebind';
|
||||
|
||||
|
||||
let _imageryIndex = null;
|
||||
@@ -26,52 +27,50 @@ export function rendererBackground(context) {
|
||||
|
||||
|
||||
function ensureImageryIndex() {
|
||||
const data = context.data();
|
||||
return Promise.all([ data.get('imagery_sources'), data.get('imagery_features') ])
|
||||
.then(vals => {
|
||||
return context.data().get('imagery')
|
||||
.then(sources => {
|
||||
if (_imageryIndex) return _imageryIndex;
|
||||
|
||||
const sources = preprocessSources(Object.values(vals[0]));
|
||||
const loco = new LocationConflation(vals[1]);
|
||||
let features = {};
|
||||
let backgrounds = [];
|
||||
|
||||
// process all sources
|
||||
sources.forEach(source => {
|
||||
// Resolve the locationSet to a GeoJSON feature..
|
||||
const resolvedFeature = loco.resolveLocationSet(source.locationSet);
|
||||
let feature = features[resolvedFeature.id];
|
||||
if (!feature) {
|
||||
feature = JSON.parse(JSON.stringify(resolvedFeature)); // deep clone
|
||||
feature.properties.sourceIDs = new Set();
|
||||
features[resolvedFeature.id] = feature;
|
||||
}
|
||||
feature.properties.sourceIDs.add(source.id);
|
||||
|
||||
// Features resolved from loco should have area precalculated.
|
||||
source.area = feature.properties.area || Infinity;
|
||||
|
||||
// Flag if this is a "global" source
|
||||
source.isGlobal = feature.id === 'Q2';
|
||||
|
||||
// Instantiate a `rendererBackgroundSource`
|
||||
let background;
|
||||
if (source.type === 'bing') {
|
||||
background = rendererBackgroundSource.Bing(source, dispatch);
|
||||
} else if (/^EsriWorldImagery/.test(source.id)) {
|
||||
background = rendererBackgroundSource.Esri(source);
|
||||
} else {
|
||||
background = rendererBackgroundSource(source);
|
||||
}
|
||||
backgrounds.push(background);
|
||||
});
|
||||
|
||||
_imageryIndex = {
|
||||
features: features,
|
||||
backgrounds: backgrounds,
|
||||
query: whichPolygon({ type: 'FeatureCollection', features: Object.values(features) })
|
||||
imagery: sources,
|
||||
features: {}
|
||||
};
|
||||
|
||||
// use which-polygon to support efficient index and querying for imagery
|
||||
const features = sources.map(source => {
|
||||
if (!source.polygon) return null;
|
||||
// workaround for editor-layer-index weirdness..
|
||||
// Add an extra array nest to each element in `source.polygon`
|
||||
// so the rings are not treated as a bunch of holes:
|
||||
// what we have: [ [[outer],[hole],[hole]] ]
|
||||
// what we want: [ [[outer]],[[outer]],[[outer]] ]
|
||||
const rings = source.polygon.map(ring => [ring]);
|
||||
|
||||
const feature = {
|
||||
type: 'Feature',
|
||||
properties: { id: source.id },
|
||||
geometry: { type: 'MultiPolygon', coordinates: rings }
|
||||
};
|
||||
|
||||
_imageryIndex.features[source.id] = feature;
|
||||
return feature;
|
||||
|
||||
}).filter(Boolean);
|
||||
|
||||
_imageryIndex.query = whichPolygon({ type: 'FeatureCollection', features: features });
|
||||
|
||||
|
||||
// Instantiate `rendererBackgroundSource` objects for each source
|
||||
_imageryIndex.backgrounds = sources.map(source => {
|
||||
if (source.type === 'bing') {
|
||||
return rendererBackgroundSource.Bing(source, dispatch);
|
||||
} else if (/^EsriWorldImagery/.test(source.id)) {
|
||||
return rendererBackgroundSource.Esri(source);
|
||||
} else {
|
||||
return rendererBackgroundSource(source);
|
||||
}
|
||||
});
|
||||
|
||||
// Add 'None'
|
||||
_imageryIndex.backgrounds.unshift(rendererBackgroundSource.None());
|
||||
|
||||
@@ -274,17 +273,14 @@ export function rendererBackground(context) {
|
||||
background.sources = (extent, zoom, includeCurrent) => {
|
||||
if (!_imageryIndex) return []; // called before init()?
|
||||
|
||||
// Gather the source ids visible in the given extent
|
||||
let visible = {};
|
||||
let hits = _imageryIndex.query.bbox(extent.rectangle(), true) || [];
|
||||
hits.forEach(properties => {
|
||||
Array.from(properties.sourceIDs).forEach(sourceID => visible[sourceID] = true);
|
||||
});
|
||||
(_imageryIndex.query.bbox(extent.rectangle(), true) || [])
|
||||
.forEach(d => visible[d.id] = true);
|
||||
|
||||
const currSource = baseLayer.source();
|
||||
|
||||
return _imageryIndex.backgrounds.filter(source => {
|
||||
if (source.isGlobal) return true; // always include imagery with worldwide coverage
|
||||
if (!source.polygon) return true; // always include imagery with worldwide coverage
|
||||
if (includeCurrent && currSource === source) return true; // optionally include the current imagery
|
||||
if (zoom && zoom < 6) return false; // optionally exclude local imagery at low zooms
|
||||
return visible[source.id]; // include imagery visible in given extent
|
||||
@@ -478,7 +474,7 @@ export function rendererBackground(context) {
|
||||
);
|
||||
}
|
||||
|
||||
const locator = imageryIndex.backgrounds.find(d => d.id === 'mapbox_locator_overlay');
|
||||
const locator = imageryIndex.backgrounds.find(d => d.overlay && d.default);
|
||||
if (locator) {
|
||||
background.toggleOverlayLayer(locator);
|
||||
}
|
||||
@@ -508,179 +504,10 @@ export function rendererBackground(context) {
|
||||
background.offset(geoMetersToOffset(offset));
|
||||
}
|
||||
}
|
||||
});
|
||||
// .catch(() => { /* ignore */ });
|
||||
})
|
||||
.catch(() => { /* ignore */ });
|
||||
};
|
||||
|
||||
|
||||
return utilRebind(background, dispatch, 'on');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Historically, iD has used a different imagery subset than what we pulled
|
||||
// from the external imagery index. This remapping previously happened
|
||||
// in the `update_imagery.js` script before the imagery was bundled with iD.
|
||||
//
|
||||
// Now that the client fetches imagery at runtime, it needs to happen here.
|
||||
// *This code should change to be more flexible.*
|
||||
//
|
||||
function preprocessSources(sources) {
|
||||
|
||||
// ignore imagery more than 20 years old..
|
||||
let cutoffDate = new Date();
|
||||
cutoffDate.setFullYear(cutoffDate.getFullYear() - 20);
|
||||
|
||||
const discard = {
|
||||
'osmbe': true, // 'OpenStreetMap (Belgian Style)'
|
||||
'osmfr': true, // 'OpenStreetMap (French Style)'
|
||||
'osm-mapnik-german_style': true, // 'OpenStreetMap (German Style)'
|
||||
'HDM_HOT': true, // 'OpenStreetMap (HOT Style)'
|
||||
'osm-mapnik-black_and_white': true, // 'OpenStreetMap (Standard Black & White)'
|
||||
'osm-mapnik-no_labels': true, // 'OpenStreetMap (Mapnik, no labels)'
|
||||
'OpenStreetMap-turistautak': true, // 'OpenStreetMap (turistautak)'
|
||||
|
||||
'hike_n_bike': true, // 'Hike & Bike'
|
||||
'landsat': true, // 'Landsat'
|
||||
'skobbler': true, // 'Skobbler'
|
||||
'public_transport_oepnv': true, // 'Public Transport (ÖPNV)'
|
||||
'tf-cycle': true, // 'Thunderforest OpenCycleMap'
|
||||
'tf-landscape': true, // 'Thunderforest Landscape'
|
||||
'qa_no_address': true, // 'QA No Address'
|
||||
'wikimedia-map': true, // 'Wikimedia Map'
|
||||
|
||||
'openinframap-petroleum': true,
|
||||
'openinframap-power': true,
|
||||
'openinframap-telecoms': true,
|
||||
'openpt_map': true,
|
||||
'openrailwaymap': true,
|
||||
'openseamap': true,
|
||||
'opensnowmap-overlay': true,
|
||||
|
||||
'US-TIGER-Roads-2012': true,
|
||||
'US-TIGER-Roads-2014': true,
|
||||
|
||||
'Waymarked_Trails-Cycling': true,
|
||||
'Waymarked_Trails-Hiking': true,
|
||||
'Waymarked_Trails-Horse_Riding': true,
|
||||
'Waymarked_Trails-MTB': true,
|
||||
'Waymarked_Trails-Skating': true,
|
||||
'Waymarked_Trails-Winter_Sports': 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,
|
||||
|
||||
'EOXAT2018CLOUDLESS': true
|
||||
};
|
||||
|
||||
const supportedWMSProjections = {
|
||||
'EPSG:4326': true,
|
||||
'EPSG:3857': true,
|
||||
'EPSG:900913': true,
|
||||
'EPSG:3587': true,
|
||||
'EPSG:54004': true,
|
||||
'EPSG:41001': true,
|
||||
'EPSG:102113': true,
|
||||
'EPSG:102100': true,
|
||||
'EPSG:3785': true
|
||||
};
|
||||
|
||||
const apikeys = {
|
||||
'Maxar-Premium': '2ac35d3bc99b64243066ef6888846358386da6cadbe0de9dbaf6ce8c17dae8d532d0d46f',
|
||||
'Maxar-Standard': '7bc70b61c29b34243064bd6f818463583262a6ca8ae78b9db9a4cf8b46d9ed8261d08168'
|
||||
};
|
||||
|
||||
|
||||
let keepImagery = [];
|
||||
sources.forEach(source => {
|
||||
if (source.type !== 'tms' && source.type !== 'wms' && source.type !== 'bing') return;
|
||||
if (source.id in discard) return;
|
||||
|
||||
let im = {
|
||||
id: source.id,
|
||||
type: source.type,
|
||||
name: source.name,
|
||||
template: source.url, // this one renamed
|
||||
locationSet: source.locationSet
|
||||
};
|
||||
|
||||
// decrypt api keys
|
||||
if (apikeys[source.id]) {
|
||||
im.apikey = utilAesDecrypt(apikeys[source.id]);
|
||||
}
|
||||
|
||||
// A few sources support 512px tiles
|
||||
if (source.id === 'Mapbox') {
|
||||
im.template = im.template.replace('.jpg', '@2x.jpg');
|
||||
im.tileSize = 512;
|
||||
} else if (source.id === 'mtbmap-no') {
|
||||
im.tileSize = 512;
|
||||
} else {
|
||||
im.tileSize = 256;
|
||||
}
|
||||
|
||||
// Some WMS sources are supported, check projection
|
||||
if (source.type === 'wms') {
|
||||
const projection = (source.available_projections || []).find(p => supportedWMSProjections[p]);
|
||||
if (!projection) return;
|
||||
if (sources.some(other => other.name === source.name && other.type !== source.type)) return;
|
||||
im.projection = projection;
|
||||
}
|
||||
|
||||
|
||||
let startDate, endDate, isValid;
|
||||
|
||||
if (source.end_date) {
|
||||
endDate = new Date(source.end_date);
|
||||
isValid = !isNaN(endDate.getTime());
|
||||
if (isValid) {
|
||||
if (endDate <= cutoffDate) return; // too old
|
||||
im.endDate = endDate;
|
||||
}
|
||||
}
|
||||
|
||||
if (source.start_date) {
|
||||
startDate = new Date(source.start_date);
|
||||
isValid = !isNaN(startDate.getTime());
|
||||
if (isValid) {
|
||||
im.startDate = startDate;
|
||||
}
|
||||
}
|
||||
|
||||
im.zoomExtent = [
|
||||
source.min_zoom || 0,
|
||||
source.max_zoom || 24
|
||||
];
|
||||
|
||||
if (source.id === 'mapbox_locator_overlay') {
|
||||
im.overzoom = false;
|
||||
}
|
||||
|
||||
const attribution = source.attribution || {};
|
||||
if (attribution.url) { im.terms_url = attribution.url; }
|
||||
if (attribution.text) { im.terms_text = attribution.text; }
|
||||
if (attribution.html) { im.terms_html = attribution.html; }
|
||||
|
||||
|
||||
if (source.icon) {
|
||||
if (/^http(s)?/i.test(source.icon)) {
|
||||
im.icon = source.icon;
|
||||
} else {
|
||||
im.icon = `https://cdn.jsdelivr.net/npm/@ideditor/imagery-index@0.1/dist/images/${source.icon}`;
|
||||
}
|
||||
}
|
||||
|
||||
if (source.best) { im.best = source.best; }
|
||||
if (source.overlay) { im.overlay = source.overlay; }
|
||||
if (source.description) { im.description = source.description; }
|
||||
|
||||
keepImagery.push(im);
|
||||
});
|
||||
|
||||
return keepImagery;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { geoMercatorRaw as d3_geoMercatorRaw } from 'd3-geo';
|
||||
import { geoArea as d3_geoArea, geoMercatorRaw as d3_geoMercatorRaw } from 'd3-geo';
|
||||
import { json as d3_json } from 'd3-fetch';
|
||||
|
||||
import { t } from '../util/locale';
|
||||
import { geoExtent, geoSphericalDistance } from '../geo';
|
||||
import { utilDetect, utilQsString, utilStringQs } from '../util';
|
||||
import { utilQsString, utilStringQs } from '../util';
|
||||
import { utilAesDecrypt } from '../util/aes';
|
||||
import { utilDetect } from '../util/detect';
|
||||
|
||||
|
||||
function localeDateString(s) {
|
||||
@@ -29,49 +31,51 @@ function vintageRange(vintage) {
|
||||
|
||||
export function rendererBackgroundSource(data) {
|
||||
var source = Object.assign({}, data); // shallow copy
|
||||
var _offset = [0, 0];
|
||||
var _name = source.name;
|
||||
var _description = source.description;
|
||||
var _best = !!source.best;
|
||||
var _template = source.template;
|
||||
var offset = [0, 0];
|
||||
var name = source.name;
|
||||
var description = source.description;
|
||||
var best = !!source.best;
|
||||
var template = source.encrypted ? utilAesDecrypt(source.template) : source.template;
|
||||
|
||||
source.tileSize = data.tileSize || 256;
|
||||
source.zoomExtent = data.zoomExtent || [0, 22];
|
||||
source.overzoom = data.overzoom !== false;
|
||||
|
||||
source.offset = function(val) {
|
||||
if (!arguments.length) return _offset;
|
||||
_offset = val;
|
||||
if (!arguments.length) return offset;
|
||||
offset = val;
|
||||
return source;
|
||||
};
|
||||
|
||||
|
||||
source.nudge = function(val, zoomlevel) {
|
||||
_offset[0] += val[0] / Math.pow(2, zoomlevel);
|
||||
_offset[1] += val[1] / Math.pow(2, zoomlevel);
|
||||
offset[0] += val[0] / Math.pow(2, zoomlevel);
|
||||
offset[1] += val[1] / Math.pow(2, zoomlevel);
|
||||
return source;
|
||||
};
|
||||
|
||||
|
||||
source.name = function() {
|
||||
var id_safe = source.id.replace(/\./g, '<TX_DOT>');
|
||||
return t('imagery.' + id_safe + '.name', { default: _name });
|
||||
return t('imagery.' + id_safe + '.name', { default: name });
|
||||
};
|
||||
|
||||
|
||||
source.description = function() {
|
||||
var id_safe = source.id.replace(/\./g, '<TX_DOT>');
|
||||
return t('imagery.' + id_safe + '.description', { default: _description });
|
||||
return t('imagery.' + id_safe + '.description', { default: description });
|
||||
};
|
||||
|
||||
|
||||
source.best = function() {
|
||||
return _best;
|
||||
return best;
|
||||
};
|
||||
|
||||
|
||||
source.area = function() {
|
||||
return data.area || Number.MAX_VALUE;
|
||||
if (!data.polygon) return Number.MAX_VALUE; // worldwide
|
||||
var area = d3_geoArea({ type: 'MultiPolygon', coordinates: [ data.polygon ] });
|
||||
return isNaN(area) ? 0 : area;
|
||||
};
|
||||
|
||||
|
||||
@@ -80,35 +84,15 @@ export function rendererBackgroundSource(data) {
|
||||
};
|
||||
|
||||
|
||||
source.template = function(val) {
|
||||
if (!arguments.length) return _template;
|
||||
if (source.id === 'custom') {
|
||||
_template = val;
|
||||
}
|
||||
source.template = function(_) {
|
||||
if (!arguments.length) return template;
|
||||
if (source.id === 'custom') template = _;
|
||||
return source;
|
||||
};
|
||||
|
||||
|
||||
source.url = function(coord) {
|
||||
var result = _template;
|
||||
if (result === '') return result; // source 'none'
|
||||
|
||||
|
||||
// Guess a type based on the tokens present in the template
|
||||
// (This is for 'custom' source, where we don't know)
|
||||
if (!source.type) {
|
||||
if (/\{(proj|wkid|bbox)\}/.test(_template)) {
|
||||
source.type = 'wms';
|
||||
source.projection = 'EPSG:3857'; // guess
|
||||
} else if (/\{(x|y)\}/.test(_template)) {
|
||||
source.type = 'tms';
|
||||
} else if (/\{u\}/.test(_template)) {
|
||||
source.type = 'bing';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (source.type === 'wms') {
|
||||
if (this.type === 'wms') {
|
||||
var tileToProjectedCoords = (function(x, y, z) {
|
||||
//polyfill for IE11, PhantomJS
|
||||
var sinh = Math.sinh || function(x) {
|
||||
@@ -120,7 +104,7 @@ export function rendererBackgroundSource(data) {
|
||||
var lon = x / zoomSize * Math.PI * 2 - Math.PI;
|
||||
var lat = Math.atan(sinh(Math.PI * (1 - 2 * y / zoomSize)));
|
||||
|
||||
switch (source.projection) {
|
||||
switch (this.projection) {
|
||||
case 'EPSG:4326':
|
||||
return {
|
||||
x: lon * 180 / Math.PI,
|
||||
@@ -133,14 +117,13 @@ export function rendererBackgroundSource(data) {
|
||||
y: 20037508.34 / Math.PI * mercCoords[1]
|
||||
};
|
||||
}
|
||||
});
|
||||
}).bind(this);
|
||||
|
||||
var tileSize = source.tileSize;
|
||||
var projection = source.projection;
|
||||
var tileSize = this.tileSize;
|
||||
var projection = this.projection;
|
||||
var minXmaxY = tileToProjectedCoords(coord[0], coord[1], coord[2]);
|
||||
var maxXminY = tileToProjectedCoords(coord[0]+1, coord[1]+1, coord[2]);
|
||||
|
||||
result = result.replace(/\{(\w+)\}/g, function (token, key) {
|
||||
return template.replace(/\{(\w+)\}/g, function (token, key) {
|
||||
switch (key) {
|
||||
case 'width':
|
||||
case 'height':
|
||||
@@ -163,40 +146,28 @@ export function rendererBackgroundSource(data) {
|
||||
return token;
|
||||
}
|
||||
});
|
||||
|
||||
} else if (source.type === 'tms') {
|
||||
result = result
|
||||
.replace('{x}', coord[0])
|
||||
.replace('{y}', coord[1])
|
||||
// TMS-flipped y coordinate
|
||||
.replace(/\{[t-]y\}/, Math.pow(2, coord[2]) - coord[1] - 1)
|
||||
.replace(/\{z(oom)?\}/, coord[2]);
|
||||
|
||||
} else if (source.type === 'bing') {
|
||||
result = result
|
||||
.replace('{u}', function() {
|
||||
var u = '';
|
||||
for (var zoom = coord[2]; zoom > 0; zoom--) {
|
||||
var b = 0;
|
||||
var mask = 1 << (zoom - 1);
|
||||
if ((coord[0] & mask) !== 0) b++;
|
||||
if ((coord[1] & mask) !== 0) b += 2;
|
||||
u += b.toString();
|
||||
}
|
||||
return u;
|
||||
});
|
||||
}
|
||||
|
||||
// these apply to any type..
|
||||
result = result
|
||||
.replace('{apikey}', (source.apikey || ''))
|
||||
return template
|
||||
.replace('{x}', coord[0])
|
||||
.replace('{y}', coord[1])
|
||||
// TMS-flipped y coordinate
|
||||
.replace(/\{[t-]y\}/, Math.pow(2, coord[2]) - coord[1] - 1)
|
||||
.replace(/\{z(oom)?\}/, coord[2])
|
||||
.replace(/\{switch:([^}]+)\}/, function(s, r) {
|
||||
var subdomains = r.split(',');
|
||||
return subdomains[(coord[0] + coord[1]) % subdomains.length];
|
||||
})
|
||||
.replace('{u}', function() {
|
||||
var u = '';
|
||||
for (var zoom = coord[2]; zoom > 0; zoom--) {
|
||||
var b = 0;
|
||||
var mask = 1 << (zoom - 1);
|
||||
if ((coord[0] & mask) !== 0) b++;
|
||||
if ((coord[1] & mask) !== 0) b += 2;
|
||||
u += b.toString();
|
||||
}
|
||||
return u;
|
||||
});
|
||||
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
|
||||
@@ -508,7 +479,7 @@ rendererBackgroundSource.Esri = function(data) {
|
||||
|
||||
|
||||
rendererBackgroundSource.None = function() {
|
||||
var source = rendererBackgroundSource({ id: 'none', template: '', isGlobal: true });
|
||||
var source = rendererBackgroundSource({ id: 'none', template: '' });
|
||||
|
||||
|
||||
source.name = function() {
|
||||
@@ -531,7 +502,7 @@ rendererBackgroundSource.None = function() {
|
||||
|
||||
|
||||
rendererBackgroundSource.Custom = function(template) {
|
||||
var source = rendererBackgroundSource({ id: 'custom', template: template, isGlobal: true });
|
||||
var source = rendererBackgroundSource({ id: 'custom', template: template });
|
||||
|
||||
|
||||
source.name = function() {
|
||||
|
||||
@@ -18,6 +18,8 @@ export function uiSectionBackgroundList(context) {
|
||||
|
||||
var _backgroundList = d3_select(null);
|
||||
|
||||
var _customSource = context.background().findSource('custom');
|
||||
|
||||
var _settingsCustomBackground = uiSettingsCustomBackground(context)
|
||||
.on('change', customChanged);
|
||||
|
||||
@@ -233,14 +235,11 @@ export function uiSectionBackgroundList(context) {
|
||||
|
||||
|
||||
function customChanged(d) {
|
||||
var customSource = context.background().findSource('custom');
|
||||
if (!customSource) return;
|
||||
|
||||
if (d && d.template) {
|
||||
customSource.template(d.template);
|
||||
chooseBackground(customSource);
|
||||
_customSource.template(d.template);
|
||||
chooseBackground(_customSource);
|
||||
} else {
|
||||
customSource.template('');
|
||||
_customSource.template('');
|
||||
chooseBackground(context.background().findSource('none'));
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -30,6 +30,7 @@
|
||||
"dist:svg:mapillary:signs": "svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/mapillary-sprite.svg node_modules/mapillary_sprite_source/package_signs/*.svg",
|
||||
"dist:svg:mapillary:objects": "svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/mapillary-object-sprite.svg node_modules/mapillary_sprite_source/package_objects/*.svg",
|
||||
"dist:svg:temaki": "svg-sprite --symbol --symbol-dest . --shape-id-generator \"temaki-%s\" --symbol-sprite dist/img/temaki-sprite.svg node_modules/@ideditor/temaki/icons/*.svg",
|
||||
"imagery": "node scripts/update_imagery.js",
|
||||
"lint": "eslint scripts test/spec modules",
|
||||
"start": "npm-run-all -s build start:server",
|
||||
"start:server": "node scripts/server.js",
|
||||
@@ -67,7 +68,6 @@
|
||||
"@fortawesome/free-regular-svg-icons": "~5.12.0",
|
||||
"@fortawesome/free-solid-svg-icons": "~5.12.0",
|
||||
"@ideditor/temaki": "~3.20.0",
|
||||
"@ideditor/imagery-index": "~0.1.0",
|
||||
"@mapbox/maki": "^6.0.0",
|
||||
"@rollup/plugin-buble": "^0.21.0",
|
||||
"@rollup/plugin-commonjs": "^11.0.1",
|
||||
@@ -79,6 +79,7 @@
|
||||
"colors": "^1.1.2",
|
||||
"concat-files": "^0.1.1",
|
||||
"d3": "~5.15.0",
|
||||
"editor-layer-index": "github:osmlab/editor-layer-index#gh-pages",
|
||||
"eslint": "^6.3.0",
|
||||
"gaze": "^1.1.3",
|
||||
"glob": "^7.1.0",
|
||||
|
||||
@@ -122,6 +122,7 @@ function buildData() {
|
||||
minifyJSON('data/address_formats.json', 'dist/data/address_formats.min.json'),
|
||||
minifyJSON('data/deprecated.json', 'dist/data/deprecated.min.json'),
|
||||
minifyJSON('data/discarded.json', 'dist/data/discarded.min.json'),
|
||||
minifyJSON('data/imagery.json', 'dist/data/imagery.min.json'),
|
||||
minifyJSON('data/intro_graph.json', 'dist/data/intro_graph.min.json'),
|
||||
minifyJSON('data/keepRight.json', 'dist/data/keepRight.min.json'),
|
||||
minifyJSON('data/languages.json', 'dist/data/languages.min.json'),
|
||||
@@ -771,16 +772,16 @@ function translationsToYAML(translations) {
|
||||
|
||||
function writeEnJson(tstrings) {
|
||||
const readCoreYaml = readFileProm('data/core.yaml', 'utf8');
|
||||
const readImagery = readFileProm('node_modules/@ideditor/imagery-index/i18n/en.yaml', 'utf8');
|
||||
const readImagery = readFileProm('node_modules/editor-layer-index/i18n/en.yaml', 'utf8');
|
||||
const readCommunity = readFileProm('node_modules/osm-community-index/i18n/en.yaml', 'utf8');
|
||||
|
||||
return Promise.all([readCoreYaml, readImagery, readCommunity])
|
||||
.then(data => {
|
||||
const core = YAML.load(data[0]);
|
||||
const imagery = YAML.load(data[1]);
|
||||
const community = YAML.load(data[2]);
|
||||
let core = YAML.load(data[0]);
|
||||
let imagery = YAML.load(data[1]);
|
||||
let community = YAML.load(data[2]);
|
||||
|
||||
const enjson = core;
|
||||
let enjson = core;
|
||||
enjson.en.presets = tstrings;
|
||||
enjson.en.imagery = imagery.en.imagery;
|
||||
enjson.en.community = community.en;
|
||||
|
||||
@@ -29,7 +29,13 @@ if [[ "${rev}" != "${orig}" ]] ; then
|
||||
npm install > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
# pull latest imagery
|
||||
rm -rf node_modules/editor-layer-index/
|
||||
git clone https://github.com/osmlab/editor-layer-index.git node_modules/editor-layer-index > /dev/null 2>&1
|
||||
rm -rf node_modules/editor-layer-index/.git/
|
||||
|
||||
# build everything
|
||||
npm run imagery
|
||||
npm run all
|
||||
|
||||
# pull latest translations
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
/* eslint-disable no-console */
|
||||
const fs = require('fs');
|
||||
const sources = require('editor-layer-index/imagery.json');
|
||||
const prettyStringify = require('json-stringify-pretty-compact');
|
||||
|
||||
let imagery = [];
|
||||
|
||||
// ignore imagery more than 20 years old..
|
||||
let cutoffDate = new Date();
|
||||
cutoffDate.setFullYear(cutoffDate.getFullYear() - 20);
|
||||
|
||||
|
||||
const keep = [
|
||||
// Add custom sources here if needed.
|
||||
{
|
||||
id: 'Maxar-Premium',
|
||||
name: 'Maxar Premium Imagery (Beta)',
|
||||
type: 'tms',
|
||||
default: true,
|
||||
attribution: {
|
||||
required: true,
|
||||
text: 'Terms & Feedback',
|
||||
url: 'https://wiki.openstreetmap.org/wiki/DigitalGlobe'
|
||||
},
|
||||
description: 'Maxar Premium is a mosaic composed of Maxar basemap with select regions filled with +Vivid or custom area of interest imagery, 50cm resolution or better, and refreshed more frequently with ongoing updates.',
|
||||
icon: 'https://osmlab.github.io/editor-layer-index/sources/world/Maxar.png',
|
||||
max_zoom: 22,
|
||||
url: '7586487389962e3f6e31ab2ed8ca321f2f3fe2cf87f1dedce8fc918b4692efd86fcd816ab8a35303effb1be9abe39b1cce3fe6db2c740044364ae68560822c88373d2c784325baf4e1fa007c6dbedab4cea3fa0dd86ee0ae4feeef032d33dcac28e4b16c90d55a42087c6b66526423ea1b4cc7e63c613940eb1c60f48270060bf41c5fcb6a628985ebe6801e9e71f041cc9f8df06b0345600376663e7dc1cdbc7df16876d8b5d006ed5782e6af4bfe2ff5a292',
|
||||
encrypted: true
|
||||
}, {
|
||||
id: 'Maxar-Standard',
|
||||
name: 'Maxar Standard Imagery (Beta)',
|
||||
type: 'tms',
|
||||
default: true,
|
||||
attribution: {
|
||||
required: true,
|
||||
text: 'Terms & Feedback',
|
||||
url: 'https://wiki.openstreetmap.org/wiki/DigitalGlobe'
|
||||
},
|
||||
description: 'Maxar Standard is a curated set of imagery covering 86% of the earth’s landmass, with 30-60cm resolution where available, backfilled by Landsat. Average age is 2.31 years, with some areas updated 2x per year.',
|
||||
icon: 'https://osmlab.github.io/editor-layer-index/sources/world/Maxar.png',
|
||||
max_zoom: 22,
|
||||
url: '7586487389962e3f6e31ab2ed8ca321f2f3fe2cf87f1dedce8fc918b4692efd86fcd816ab8a35303effb1be9abe39b1cce3fe6db2c740044364ae68560822c88373d2c784325baf4e1fa007c6dbedab4cea3fa0dd86ee0ae4feeef032d33dcac28e4b16c90d55a42087c6b66526423ea1b4cc7e63c613940eb1c60f48270060bf41c5fcb6a628985ebe6801e9e71f010c8c9d7fb6b534560012461377dc1cdb672f16827dfe0d005bf5685b7ac4ea97cf5f795',
|
||||
encrypted: true
|
||||
}
|
||||
];
|
||||
|
||||
const discard = {
|
||||
'osmbe': true, // 'OpenStreetMap (Belgian Style)'
|
||||
'osmfr': true, // 'OpenStreetMap (French Style)'
|
||||
'osm-mapnik-german_style': true, // 'OpenStreetMap (German Style)'
|
||||
'HDM_HOT': true, // 'OpenStreetMap (HOT Style)'
|
||||
'osm-mapnik-black_and_white': true, // 'OpenStreetMap (Standard Black & White)'
|
||||
'osm-mapnik-no_labels': true, // 'OpenStreetMap (Mapnik, no labels)'
|
||||
'OpenStreetMap-turistautak': true, // 'OpenStreetMap (turistautak)'
|
||||
|
||||
'hike_n_bike': true, // 'Hike & Bike'
|
||||
'landsat': true, // 'Landsat'
|
||||
'skobbler': true, // 'Skobbler'
|
||||
'public_transport_oepnv': true, // 'Public Transport (ÖPNV)'
|
||||
'tf-cycle': true, // 'Thunderforest OpenCycleMap'
|
||||
'tf-landscape': true, // 'Thunderforest Landscape'
|
||||
'qa_no_address': true, // 'QA No Address'
|
||||
'wikimedia-map': true, // 'Wikimedia Map'
|
||||
|
||||
'openinframap-petroleum': true,
|
||||
'openinframap-power': true,
|
||||
'openinframap-telecoms': true,
|
||||
'openpt_map': true,
|
||||
'openrailwaymap': true,
|
||||
'openseamap': true,
|
||||
'opensnowmap-overlay': true,
|
||||
|
||||
'US-TIGER-Roads-2012': true,
|
||||
'US-TIGER-Roads-2014': true,
|
||||
|
||||
'Waymarked_Trails-Cycling': true,
|
||||
'Waymarked_Trails-Hiking': true,
|
||||
'Waymarked_Trails-Horse_Riding': true,
|
||||
'Waymarked_Trails-MTB': true,
|
||||
'Waymarked_Trails-Skating': true,
|
||||
'Waymarked_Trails-Winter_Sports': 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,
|
||||
|
||||
'EOXAT2018CLOUDLESS': true
|
||||
};
|
||||
|
||||
const supportedWMSProjections = {
|
||||
'EPSG:4326': true,
|
||||
'EPSG:3857': true,
|
||||
'EPSG:900913': true,
|
||||
'EPSG:3587': true,
|
||||
'EPSG:54004': true,
|
||||
'EPSG:41001': true,
|
||||
'EPSG:102113': true,
|
||||
'EPSG:102100': true,
|
||||
'EPSG:3785': true
|
||||
};
|
||||
|
||||
|
||||
sources.concat(keep).forEach(source => {
|
||||
if (source.type !== 'tms' && source.type !== 'wms' && source.type !== 'bing') return;
|
||||
if (source.id in discard) return;
|
||||
|
||||
let im = {
|
||||
id: source.id,
|
||||
name: source.name,
|
||||
type: source.type,
|
||||
template: source.url
|
||||
};
|
||||
|
||||
// Some sources support 512px tiles
|
||||
if (source.id === 'Mapbox') {
|
||||
im.template = im.template.replace('.jpg', '@2x.jpg');
|
||||
im.tileSize = 512;
|
||||
} else if (source.id === 'mtbmap-no') {
|
||||
im.tileSize = 512;
|
||||
}
|
||||
|
||||
// Some WMS sources are supported, check projection
|
||||
if (source.type === 'wms') {
|
||||
const projection = (source.available_projections || []).find(p => supportedWMSProjections[p]);
|
||||
if (!projection) return;
|
||||
if (sources.some(other => other.name === source.name && other.type !== source.type)) return;
|
||||
im.projection = projection;
|
||||
}
|
||||
|
||||
|
||||
let startDate, endDate, isValid;
|
||||
|
||||
if (source.end_date) {
|
||||
endDate = new Date(source.end_date);
|
||||
isValid = !isNaN(endDate.getTime());
|
||||
if (isValid) {
|
||||
if (endDate <= cutoffDate) return; // too old
|
||||
im.endDate = endDate;
|
||||
}
|
||||
}
|
||||
|
||||
if (source.start_date) {
|
||||
startDate = new Date(source.start_date);
|
||||
isValid = !isNaN(startDate.getTime());
|
||||
if (isValid) {
|
||||
im.startDate = startDate;
|
||||
}
|
||||
}
|
||||
|
||||
let extent = source.extent || {};
|
||||
if (extent.min_zoom || extent.max_zoom) {
|
||||
im.zoomExtent = [
|
||||
extent.min_zoom || 0,
|
||||
extent.max_zoom || 22
|
||||
];
|
||||
}
|
||||
|
||||
if (extent.polygon) {
|
||||
im.polygon = extent.polygon;
|
||||
} else if (extent.bbox) {
|
||||
im.polygon = [[
|
||||
[extent.bbox.min_lon, extent.bbox.min_lat],
|
||||
[extent.bbox.min_lon, extent.bbox.max_lat],
|
||||
[extent.bbox.max_lon, extent.bbox.max_lat],
|
||||
[extent.bbox.max_lon, extent.bbox.min_lat],
|
||||
[extent.bbox.min_lon, extent.bbox.min_lat]
|
||||
]];
|
||||
}
|
||||
|
||||
if (source.id === 'mapbox_locator_overlay') {
|
||||
im.overzoom = false;
|
||||
}
|
||||
|
||||
const attribution = source.attribution || {};
|
||||
if (attribution.url) {
|
||||
im.terms_url = attribution.url;
|
||||
}
|
||||
if (attribution.text) {
|
||||
im.terms_text = attribution.text;
|
||||
}
|
||||
if (attribution.html) {
|
||||
im.terms_html = attribution.html;
|
||||
}
|
||||
|
||||
['best', 'default', 'description', 'encrypted', 'icon', 'overlay', 'tileSize'].forEach(prop => {
|
||||
if (source[prop]) {
|
||||
im[prop] = source[prop];
|
||||
}
|
||||
});
|
||||
|
||||
imagery.push(im);
|
||||
});
|
||||
|
||||
|
||||
imagery.sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
fs.writeFileSync('data/imagery.json', prettyStringify(imagery));
|
||||
fs.writeFileSync('dist/data/imagery.min.json', JSON.stringify(imagery));
|
||||
@@ -5,7 +5,10 @@ describe('iD.rendererBackgroundSource', function() {
|
||||
});
|
||||
|
||||
it('supports tms replacement tokens', function() {
|
||||
var source = iD.rendererBackgroundSource({ type: 'tms', template: '{z}/{x}/{y}' });
|
||||
var source = iD.rendererBackgroundSource({
|
||||
type: 'tms',
|
||||
template: '{z}/{x}/{y}'
|
||||
});
|
||||
expect(source.url([0,1,2])).to.equal('2/0/1');
|
||||
});
|
||||
|
||||
@@ -32,12 +35,12 @@ describe('iD.rendererBackgroundSource', function() {
|
||||
});
|
||||
|
||||
it('supports subdomains', function() {
|
||||
var source = iD.rendererBackgroundSource({ type: 'tms', template: '{switch:a,b}/{z}/{x}/{y}' });
|
||||
var source = iD.rendererBackgroundSource({ template: '{switch:a,b}/{z}/{x}/{y}'});
|
||||
expect(source.url([0,1,2])).to.equal('b/2/0/1');
|
||||
});
|
||||
|
||||
it('distributes requests between subdomains', function() {
|
||||
var source = iD.rendererBackgroundSource({ type: 'tms', template: '{switch:a,b}/{z}/{x}/{y}' });
|
||||
var source = iD.rendererBackgroundSource({ template: '{switch:a,b}/{z}/{x}/{y}' });
|
||||
expect(source.url([0,1,1])).to.equal('b/1/0/1');
|
||||
expect(source.url([0,2,1])).to.equal('a/1/0/2');
|
||||
});
|
||||
|
||||
@@ -11,8 +11,7 @@ for (var k in iD.services) { delete iD.services[k]; }
|
||||
iD.data.locales = { en: { rtl: false, languageNames: {}, scriptNames: {} }};
|
||||
iD.data.locale_en = { en: {} };
|
||||
// Initializing `coreContext` initializes `_background`, which tries loading:
|
||||
iD.data.imagery_sources = [];
|
||||
iD.data.imagery_features = { type: 'FeatureCollection', features: [] };
|
||||
iD.data.imagery = [];
|
||||
// Initializing `coreContext` initializes `_presets`, which tries loading:
|
||||
iD.data.preset_categories = {};
|
||||
iD.data.preset_defaults = {};
|
||||
|
||||
Reference in New Issue
Block a user