0

How do I set the Google map type e.g. SATELLITE or TERRAIN? I tried varitaions of the OpenLayers 2 syntax:

new olgm.layer.Google( { type: google.maps.MapTypeId.SATELLITE });

and

new olgm.layer.Google({ 
    params: { type: google.maps.MapTypeId.SATELLITE }
});

but no joy.

Richard Greenwood
  • 876
  • 1
  • 10
  • 20

2 Answers2

1

The correct syntax is this:

new olgm.layer.Google({
    mapTypeId: google.maps.MapTypeId.SATELLITE
};

See a live example (click on the + Satellite button). See also the JavaScript source file of the example

Alexandre Dubé
  • 2,769
  • 1
  • 18
  • 30
0

See exemple:

const map = new google.maps.Map(document.getElementById("map"), {
        zoom: 21,
        streetViewControl: false,
        center: { lat: ..., lng: ....},
        mapTypeId: google.maps.MapTypeId.SATELLITE
    });
Danilo Santos
  • 392
  • 3
  • 11