本文介绍了我们可以像在Google Earth中那样在卫星视图中在Google Map V3中显示地理边界吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们能否在Google Maps V3的卫星视图中显示国家的地理边界,就像在卫星视图中的Google Earth中显示边界一样?

Can we display geographical borders of country in satellite view of Google Maps V3, similarly the way border is displayed in Google Earth in satellite view?

谢谢!

推荐答案

我相信类似的方法可以在卫星视图中为您提供边框.

I believe something like this should give you borders in satellite view.

var custom-Style = [
                    { featureType: "administrative.country", elementType: "all", stylers: [{ visibility: "on"}] },
                    { featureType: "administrative.land_parcel", elementType: "all", stylers: [{ visibility: "on"}] }
                   ];

var myOptions = {mapTypeId: google.maps.MapTypeId.SATELLITE};

map = new google.maps.Map(document.getElementById("mapDiv"), myOptions);

var styledMapOptions = {
    name: "custom-Style"
}

var customMapType = new google.maps.StyledMapType(custom-Style, styledMapOptions);

map.mapTypes.set('custom-Style', customMapType);
map.setMapTypeId('custom-Style');

这篇关于我们可以像在Google Earth中那样在卫星视图中在Google Map V3中显示地理边界吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 04:24