我已将地图启动并运行,但我无法在“中心”和“位置”上指定纬度和长度的标记。有没有人看到错误?我早些时候做了这个工作,但是在添加了样式数组之后,它停了下来,我一定会意外地搞砸了一些东西,但是现在我没有看到它。Google Maps API,根本无法显示标记
<div id="map"></div>
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
var map;
function initialize() {
var mapOptions = {
zoom: 17,
center: new google.maps.LatLng(36, -110),
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: styleArray,
scrollwheel: false,
};
map = new google.maps.Map(document.getElementById('map'),
mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
var styleArray = [
{
featureType: "all",
stylers: [ { saturation: -80 } ]
},
{
featureType: "road.arterial",
elementType: "geometry",
stylers: [ { hue: "#00ffee" }, { saturation: 50 } ]
},
{
featureType: "poi.business",
elementType: "labels",
stylers: [ { visibility: "off" } ]
}
];
var marker = new google.maps.Marker({
position: (36, -110),
title:"Hello World!",
map: (google.maps.MapTypeId.ROADMAP),
});
marker.setMap(google.maps.MapTypeId.ROADMAP);
</script>