Can we display geographical border in Google Map V3 as we do in Google Earth, in satellite view?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 07:32:55

问题


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?

Thanks!


回答1:


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');


来源:https://stackoverflow.com/questions/6502807/can-we-display-geographical-border-in-google-map-v3-as-we-do-in-google-earth-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!