3

I would like to know if there is a satellite map for OpenLayers.

I made the following code:

new ol.layer.Tile({
  // A layer must have a title to appear in the layerswitcher
  title: 'Stamen',
  // Again set this layer as a base layer
  type: 'base',
  visible: false,
  source: new ol.source.Stamen({
      layer: 'watercolor'
  })
}),
new ol.layer.Tile({
  // A layer must have a title to appear in the layerswitcher
  title: 'Satelite',
  // Again set this layer as a base layer
  type: 'base',
  visible: false,
  source: new ol.source.Stamen({
      layer: 'terrain'
  })
}),
new ol.layer.Tile({
  // A layer must have a title to appear in the layerswitcher
  title: 'OSM',
  // Again set this layer as a base layer
  type: 'base',
  visible: true,
  source: new ol.source.OSM()
}) 

And now I need an openlayers satellite map or something compatible with it.

1
4

Both maps that @Mike mentioned in his comment require API key. One possible satellite map is Esri's (ArcGIS) World Imagery:

var worldImagery = new ol.layer.Tile({
  source: new ol.source.XYZ({
    url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
    maxZoom: 19
  })
});
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.