1 | goog.require('ol.Attribution');
|
2 | goog.require('ol.Map');
|
3 | goog.require('ol.View');
|
4 | goog.require('ol.layer.Tile');
|
5 | goog.require('ol.proj');
|
6 | goog.require('ol.source.XYZ');
|
7 |
|
8 |
|
9 | var attribution = new ol.Attribution({
|
10 | html: 'Tiles © <a href="https://services.arcgisonline.com/ArcGIS/' +
|
11 | 'rest/services/World_Topo_Map/MapServer">ArcGIS</a>'
|
12 | });
|
13 |
|
14 | var map = new ol.Map({
|
15 | target: 'map',
|
16 | layers: [
|
17 | new ol.layer.Tile({
|
18 | source: new ol.source.XYZ({
|
19 | attributions: [attribution],
|
20 | url: 'https://server.arcgisonline.com/ArcGIS/rest/services/' +
|
21 | 'World_Topo_Map/MapServer/tile/{z}/{y}/{x}'
|
22 | })
|
23 | })
|
24 | ],
|
25 | view: new ol.View({
|
26 | center: ol.proj.fromLonLat([-121.1, 47.5]),
|
27 | zoom: 7
|
28 | })
|
29 | });
|