我使用 google maps api,我想获得像 42floors.com 的 google map UI 这样的 UI。
谁能帮助我他们如何更改 UI?
我猜他们正在使用地图样式 https://developers.google.com/maps/documentation/javascript/examples/maptype-styled-simple
var map;
var brooklyn = new google.maps.LatLng(40.6743890, -73.9455);
var MY_MAPTYPE_ID = 'custom_style';
function initialize() {
var featureOpts = [
{
featureType: 'road',
elementType: 'geometry',
stylers: [
{ hue: -45 },
{ saturation: 100 }
]
},
{
featureType: 'landscape',
elementType: 'geometry',
stylers: [
{ hue: '#000000' },
{ saturation: 75 },
{ lightness: -100}
]
}
];
var mapOptions = {
zoom: 12,
center: brooklyn,
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP, MY_MAPTYPE_ID]
},
mapTypeId: MY_MAPTYPE_ID
};
map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
var styledMapOptions = {
name: 'Custom Style'
};
var customMapType = new google.maps.StyledMapType(featureOpts, styledMapOptions);
map.mapTypes.set(MY_MAPTYPE_ID, customMapType);
}
google.maps.event.addDomListener(window, 'load', initialize);