Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Web tiled layer sample data #1324

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,40 @@ namespace ArcGIS.Samples.LoadWebTiledLayer
category: "Layers",
description: "Display a tiled web layer.",
instructions: "Run the sample and a map will appear. As you navigate the map, map tiles will be fetched automatically and displayed on the map.",
tags: new[] { "OGC", "Open Street Map", "OpenStreetMap", "layer", "stamen.com", "tiled", "tiles" })]
tags: new[] { "OGC", "layer", "tiled", "tiles" })]
public partial class LoadWebTiledLayer : ContentPage
{
// Templated URL to the tile service
private readonly string _templateUri = "https://stamen-tiles-{subdomain}.a.ssl.fastly.net/watercolor/{level}/{col}/{row}.jpg";
// Templated URL to the tile service.
private readonly string _templateUri = "https://server.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{level}/{row}/{col}.jpg";

// List of subdomains for use when constructing the web tiled layer
private readonly List<string> _tiledLayerSubdomains = new List<string> { "a", "b", "c", "d" };

// Attribution string for the Stamen service
private readonly string _attribution = "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.";
// Attribution string.
private readonly string _attribution = "Map tiles by <a href=\"https://livingatlas.arcgis.com\">ArcGIS Living Atlas of the World</a>, " +
"under <a href=\"https://www.esri.com/en-us/legal/terms/full-master-agreement\">Esri Master License Agreement</a>. " +
"Data by Esri, Garmin, GEBCO, NOAA NGDC, and other contributors.";

public LoadWebTiledLayer()
{
InitializeComponent();

// Create the UI, setup the control references and execute initialization
// Create the UI, setup the control references and execute initialization.
Initialize();
}

private void Initialize()
{
// Create the layer from the URL and the subdomain list
WebTiledLayer myBaseLayer = new WebTiledLayer(_templateUri, _tiledLayerSubdomains);
// Create the layer from the URL and the subdomain list.
WebTiledLayer myBaseLayer = new WebTiledLayer(_templateUri);

// Create a basemap from the layer
// Create a basemap from the layer.
Basemap layerBasemap = new Basemap(myBaseLayer);

// Apply the attribution for the layer
// Apply the attribution for the layer.
myBaseLayer.Attribution = _attribution;

// Create a map to hold the basemap
// Create a map to hold the basemap.
Map myMap = new Map(layerBasemap);

// Add the map to the map view
// Add the map to the map view.
MyMapView.Map = myMap;
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Run the sample and a map will appear. As you navigate the map, map tiles will be

## How it works

1. Create a `WebTiledLayer` from a URL and a list of subdomains.
1. Create a `WebTiledLayer` from a URL.
2. Create a new `Basemap` from the layer.
3. Update the attribution on the layer. Note: this is a necessary step because web tiled services don't have associated service metadata.
4. Display the basemap.
Expand All @@ -26,7 +26,7 @@ Run the sample and a map will appear. As you navigate the map, map tiles will be

## About the data

The basemap in this sample is provided by [Stamen Design](https://stamen.com/). Stamen publishes tiled services based on OpenStreetMap data with several unique styles applied.
The basemap in this sample is provided by [ArcGIS Living Atlas of the World](https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500). ArcGIS Living Atlas of the World provides tiled services with several unique styles.

## Additional information

Expand All @@ -42,4 +42,4 @@ For more information about web tiled layers, see the following resources:

## Tags

layer, OGC, Open Street Map, OpenStreetMap, stamen.com, tiled, tiles
layer, OGC, tiled, tiles
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
],
"keywords": [
"OGC",
"Open Street Map",
"OpenStreetMap",
"layer",
"stamen.com",
"tiled",
"tiles"
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,40 @@ namespace ArcGIS.WPF.Samples.LoadWebTiledLayer
category: "Layers",
description: "Display a tiled web layer.",
instructions: "Run the sample and a map will appear. As you navigate the map, map tiles will be fetched automatically and displayed on the map.",
tags: new[] { "OGC", "Open Street Map", "OpenStreetMap", "layer", "stamen.com", "tiled", "tiles" })]
tags: new[] { "OGC", "layer", "tiled", "tiles" })]
public partial class LoadWebTiledLayer
{
// Templated URL to the tile service
private readonly string _templateUri = "https://stamen-tiles-{subdomain}.a.ssl.fastly.net/watercolor/{level}/{col}/{row}.jpg";
// Templated URL to the tile service.
private readonly string _templateUri = "https://server.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{level}/{row}/{col}.jpg";

// List of subdomains for use when constructing the web tiled layer
private readonly List<string> _tiledLayerSubdomains = new List<string> { "a", "b", "c", "d" };

// Attribution string for the Stamen service
private readonly string _attribution = "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.";
// Attribution string.
private readonly string _attribution = "Map tiles by <a href=\"https://livingatlas.arcgis.com\">ArcGIS Living Atlas of the World</a>, " +
"under <a href=\"https://www.esri.com/en-us/legal/terms/full-master-agreement\">Esri Master License Agreement</a>. " +
"Data by Esri, Garmin, GEBCO, NOAA NGDC, and other contributors.";

public LoadWebTiledLayer()
{
InitializeComponent();

// Create the UI, setup the control references and execute initialization
// Create the UI, setup the control references and execute initialization.
Initialize();
}

private void Initialize()
{
// Create the layer from the URL and the subdomain list
WebTiledLayer myBaseLayer = new WebTiledLayer(_templateUri, _tiledLayerSubdomains);
// Create the layer from the URL and the subdomain list.
WebTiledLayer myBaseLayer = new WebTiledLayer(_templateUri);

// Create a basemap from the layer
// Create a basemap from the layer.
Basemap layerBasemap = new Basemap(myBaseLayer);

// Apply the attribution for the layer
// Apply the attribution for the layer.
myBaseLayer.Attribution = _attribution;

// Create a map to hold the basemap
// Create a map to hold the basemap.
Map myMap = new Map(layerBasemap);

// Add the map to the map view
// Add the map to the map view.
MyMapView.Map = myMap;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/WPF/WPF.Viewer/Samples/Layers/LoadWebTiledLayer/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Run the sample and a map will appear. As you navigate the map, map tiles will be

## How it works

1. Create a `WebTiledLayer` from a URL and a list of subdomains.
1. Create a `WebTiledLayer` from a URL.
2. Create a new `Basemap` from the layer.
3. Update the attribution on the layer. Note: this is a necessary step because web tiled services don't have associated service metadata.
4. Display the basemap.
Expand All @@ -26,7 +26,7 @@ Run the sample and a map will appear. As you navigate the map, map tiles will be

## About the data

The basemap in this sample is provided by [Stamen Design](https://stamen.com/). Stamen publishes tiled services based on OpenStreetMap data with several unique styles applied.
The basemap in this sample is provided by [ArcGIS Living Atlas of the World](https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500). ArcGIS Living Atlas of the World provides tiled services with several unique styles.

## Additional information

Expand All @@ -42,4 +42,4 @@ For more information about web tiled layers, see the following resources:

## Tags

layer, OGC, Open Street Map, OpenStreetMap, stamen.com, tiled, tiles
layer, OGC, tiled, tiles
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
],
"keywords": [
"OGC",
"Open Street Map",
"OpenStreetMap",
"layer",
"stamen.com",
"tiled",
"tiles"
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,40 @@ namespace ArcGIS.WinUI.Samples.LoadWebTiledLayer
category: "Layers",
description: "Display a tiled web layer.",
instructions: "Run the sample and a map will appear. As you navigate the map, map tiles will be fetched automatically and displayed on the map.",
tags: new[] { "OGC", "Open Street Map", "OpenStreetMap", "layer", "stamen.com", "tiled", "tiles" })]
tags: new[] { "OGC", "layer", "tiled", "tiles" })]
public partial class LoadWebTiledLayer
{
// Templated URL to the tile service
private readonly string _templateUri = "https://stamen-tiles-{subdomain}.a.ssl.fastly.net/watercolor/{level}/{col}/{row}.jpg";
// Templated URL to the tile service.
private readonly string _templateUri = "https://server.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{level}/{row}/{col}.jpg";

// List of subdomains for use when constructing the web tiled layer
private readonly List<string> _tiledLayerSubdomains = new List<string> { "a", "b", "c", "d" };

// Attribution string for the Stamen service
private readonly string _attribution = "Map tiles by <a href=\"http://stamen.com/\">Stamen Design</a>," +
"under <a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a>." +
"Data by <a href=\"http://openstreetmap.org/\">OpenStreetMap</a>," +
"under <a href=\"http://creativecommons.org/licenses/by-sa/3.0\">CC BY SA</a>.";
// Attribution string.
private readonly string _attribution = "Map tiles by <a href=\"https://livingatlas.arcgis.com\">ArcGIS Living Atlas of the World</a>, " +
"under <a href=\"https://www.esri.com/en-us/legal/terms/full-master-agreement\">Esri Master License Agreement</a>. " +
"Data by Esri, Garmin, GEBCO, NOAA NGDC, and other contributors.";

public LoadWebTiledLayer()
{
InitializeComponent();

// Setup the control references and execute initialization
// Setup the control references and execute initialization.
Initialize();
}

private void Initialize()
{
// Create the layer from the URL and the subdomain list
WebTiledLayer myBaseLayer = new WebTiledLayer(_templateUri, _tiledLayerSubdomains);
// Create the layer from the URL and the subdomain list.
WebTiledLayer myBaseLayer = new WebTiledLayer(_templateUri);

// Create a basemap from the layer
// Create a basemap from the layer.
Basemap layerBasemap = new Basemap(myBaseLayer);

// Apply the attribution for the layer
// Apply the attribution for the layer.
myBaseLayer.Attribution = _attribution;

// Create a map to hold the basemap
// Create a map to hold the basemap.
Map myMap = new Map(layerBasemap);

// Add the map to the map view
// Add the map to the map view.
MyMapView.Map = myMap;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Run the sample and a map will appear. As you navigate the map, map tiles will be

## How it works

1. Create a `WebTiledLayer` from a URL and a list of subdomains.
1. Create a `WebTiledLayer` from a URL.
2. Create a new `Basemap` from the layer.
3. Update the attribution on the layer. Note: this is a necessary step because web tiled services don't have associated service metadata.
4. Display the basemap.
Expand All @@ -26,7 +26,7 @@ Run the sample and a map will appear. As you navigate the map, map tiles will be

## About the data

The basemap in this sample is provided by [Stamen Design](https://stamen.com/). Stamen publishes tiled services based on OpenStreetMap data with several unique styles applied.
The basemap in this sample is provided by [ArcGIS Living Atlas of the World](https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500). ArcGIS Living Atlas of the World provides tiled services with several unique styles.

## Additional information

Expand All @@ -42,4 +42,4 @@ For more information about web tiled layers, see the following resources:

## Tags

layer, OGC, Open Street Map, OpenStreetMap, stamen.com, tiled, tiles
layer, OGC, tiled, tiles
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
],
"keywords": [
"OGC",
"Open Street Map",
"OpenStreetMap",
"layer",
"stamen.com",
"tiled",
"tiles"
],
Expand Down
Loading