我米,谷歌地圖工作,我想隱藏,如果有可能我的地圖上的餐廳和酒店。 所以我的問題是如何消除或應用過濾器來隱藏餐廳和酒店點在谷歌地圖API。如何過濾谷歌地圖
感謝所有。 編輯。
<script>
function writeAddressName(latLng) {
var geocoder = new google.maps.Geocoder();
geocoder.geocode({
"location": latLng
},
function(results, status) {
if (status == google.maps.GeocoderStatus.OK)
document.getElementById("address").innerHTML = results[0].formatted_address;
else
document.getElementById("error").innerHTML += "Unable to retrieve your address" + "<br />";
});
}
function geolocationSuccess(position) {
var userLatLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
writeAddressName(userLatLng);
$(document).ready(function(){
var styles = [
{
stylers: [
{ hue: "#00ffe6" },
{ saturation: -20 }
]
},{
featureType: "road",
elementType: "geometry",
stylers: [
{ lightness: 100 },
{ visibility: "simplified" }
]
},{
featureType: "road",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}
];
var styledMap = new google.maps.StyledMapType(styles, {name: "Styled Map"});
// display map
var mapOptions = {
zoom: 11,
center: userLatLng ,
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP,'map_style']
}
};
var map = new google.maps.Map(document.getElementById('map'), mapOptions);
map.mapTypes.set('map_style', styledMap);
map.setMapTypeId('map_style', styledMap);
});
// marker
new google.maps.Marker({
map: map_style,
position: userLatLng
});
你只是渲染地圖或進行API調用? – nilgun
MMH我不知道你的問題我只是讓使用谷歌地圖API推出地圖 – user2803925