1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
// In order to get a perfect coherency between the MapType enum definition
// and the population of the LeafletMaps::MapLayer instances vector
// we include this file in GeographicView.h and GeographicView.cpp
#if !defined(ADD_MAPLAYERS)
// when included in GeographicView.h
// this first defines the MapType enum values
#define BEGIN_MAPLAYERS() enum MapType {
#define ADD_MAPLAYER(enum_val, name, url, attrib, maxZoom) enum_val
#define ADD_PSEUDO_MAPLAYER(enum_val, name) enum_val
#else
#undef ADD_MAPLAYER
#undef ADD_PSEUDO_MAPLAYER
#undef BEGIN_MAPLAYERS
// then when included in GeographicView.cpp
// this defines the mapLayers contents
#define BEGIN_MAPLAYERS() static const std::vector<MapLayer> mapLayers = {
#define ADD_MAPLAYER(enum_val, name, url, attrib, maxZoom) MapLayer(name, url, attrib, maxZoom)
#define ADD_PSEUDO_MAPLAYER(enum_val, name) MapLayer(name)
#endif
#define END_MAPLAYERS() };
BEGIN_MAPLAYERS()
// OpenStreetMap is the default one
ADD_MAPLAYER(OpenStreetMap=0,
"OpenStreetMap",
"https://tile.openstreetmap.org/{z}/{x}/{y}.png",
"© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",
19),
// OpenTopoMap
ADD_MAPLAYER(OpenTopoMap,
"OpenTopoMap",
"https://tile.opentopomap.org/{z}/{x}/{y}.png",
"Map data: {attribution.OpenStreetMap}, <a href=\"http://viewfinderpanoramas.org\">SRTM</a> | Map style: © <a href=\"https://opentopomap.org\">OpenTopoMap</a> (<a href=\"https://creativecommons.org/licenses/by-sa/3.0/\">CC-BY-SA</a>)",
17),
// Esri World Street Map
ADD_MAPLAYER(EsriStreetMap,
"Esri World Street Map",
"https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",
"Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",
21),
// Esri Topographic Map
ADD_MAPLAYER(EsriTopoMap,
"Esri Topographic Map",
"https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",
"Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community",
16),
// Esri National Geographic Map
ADD_MAPLAYER(EsriNatGeoMap,
"Esri National Geographic Map",
"https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",
"Tiles © Esri — National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC",
16),
// Esri World Imagery
ADD_MAPLAYER(EsriSatellite,
"Esri World Imagery",
"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
"Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community",
18),
// Esri Light Gray Canvas
ADD_MAPLAYER(EsriLightGrayCanvas,
"Esri Light Gray Canvas",
"https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",
"Tiles © Esri — Esri, DeLorme, NAVTEQ", 16),
// Esri Dark Gray Canvas
ADD_MAPLAYER(EsriDarkGrayCanvas,
"Esri Dark Gray Canvas",
"https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}",
"Tiles © Esri — Esri, DeLorme, NAVTEQ", 16),
// CartoDB Voyager
ADD_MAPLAYER(CartoDB,
"CartoDB Map", "https://basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png",
"© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors © <a href=\"https://carto.com/attributions\">CARTO</a>",
19),
// Carto DB Light Gray Map
ADD_MAPLAYER(CartoDBLight,
"CartoDB Light Map", "https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",
"© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors © <a href=\"https://carto.com/attributions\">CARTO</a>",
19),
// Carto DB Dark Gray Map
ADD_MAPLAYER(CartoDBDark,
"CartoDB Dark Map", "https://basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",
"© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors © <a href=\"https://carto.com/attributions\">CARTO</a>",
19),
// the ones below are not really map layers
// but are needed to populate the GeographicGraphicsView menu
ADD_PSEUDO_MAPLAYER(CustomTileLayer, "Custom Tile Layer"),
ADD_PSEUDO_MAPLAYER(Polygon, "Polygon"),
ADD_PSEUDO_MAPLAYER(Globe, "Globe")
END_MAPLAYERS()
|