2017-06-21 48 views
0

如何设置Google地图类型例如卫星或地形?我试过的OpenLayers 2语法varitaions:如何设置Google地图类型?

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

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

,但没有喜悦。

回答

1

正确的语法是这样的:

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

看到一个(点击+卫星按钮)。另见JavaScript source file of the example

相关问题