Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google Maps JavaScript API v3更改标记并添加卫星视图_Javascript_Google Maps_Google Maps Api 3 - Fatal编程技术网

Google Maps JavaScript API v3更改标记并添加卫星视图

Google Maps JavaScript API v3更改标记并添加卫星视图,javascript,google-maps,google-maps-api-3,Javascript,Google Maps,Google Maps Api 3,我需要帮助添加两件事 var image='1368298974442034922android-car-home-256-th.png'; 我想删除红色默认标记并添加此项目 我不知道如何把这个从地图改成卫星视图 <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta c

我需要帮助添加两件事

var image='1368298974442034922android-car-home-256-th.png'; 我想删除红色默认标记并添加此项目

我不知道如何把这个从地图改成卫星视图

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <title>Info windows</title>
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
      .content 
      {
          width:75%;
          height:45px;
          overflow:scroll;  
      }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
    <script>
// This example displays a marker at the center of Australia.
// When the user clicks the marker, an info window opens.

function initialize() {
  var myLatlng = new google.maps.LatLng(36.3135749,-95.3050332);
  var mapOptions = {
    zoom: 20,
    center: myLatlng
  };

  var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

  var contentString = '<div id="content">'+
      '<div id="siteNotice">'+
      '</div>'+
      '<h1 id="firstHeading" class="firstHeading">Here It Is!</h1>'+
      '<div id="bodyContent">'+
      'Acording to our records it looks like your item is located with in a few feet of here.<br><br> Need more info check out this info. <br> <a href="http://www.example.com">http://www.example.com</a></div>'+
      '</div>';


  var infowindow = new google.maps.InfoWindow({
      content: contentString
  });


  var marker = new google.maps.Marker({
      position: myLatlng,
      map: map,
      title: 'Here Is Where We Found It!'
  });
  google.maps.event.addListener(marker, 'click', function() {
    infowindow.open(map,marker);
  });
}

google.maps.event.addDomListener(window, 'load', initialize);

    </script>
  </head>
  <body>
    <div id="map-canvas"></div>
  </body>
</html>

信息窗口
html,正文,#地图画布{
身高:100%;
边际:0px;
填充:0px
}
.内容
{
宽度:75%;
高度:45px;
溢出:滚动;
}
//此示例在澳大利亚中部显示一个标记。
//当用户单击标记时,将打开一个信息窗口。
函数初始化(){
var mylatng=newgoogle.maps.LatLng(36.3135749,-95.305032);
变量映射选项={
缩放:20,
中心:myLatlng
};
var map=new google.maps.map(document.getElementById('map-canvas'),mapOptions);
var contentString=''+
''+
''+
“在这儿!”+
''+
“根据我们的记录,您的物品似乎位于离这里几英尺的地方。

需要更多信息请查看此信息。
”+ ''; var infowindow=new google.maps.infowindow({ 内容:contentString }); var marker=new google.maps.marker({ 职位:myLatlng, 地图:地图, 标题:“这就是我们发现它的地方!” }); google.maps.event.addListener(标记'click',函数(){ 信息窗口。打开(地图、标记); }); } google.maps.event.addDomListener(窗口“加载”,初始化);
标记:

var marker = new google.maps.Marker({
    position: myLatlng,
    map: map,
    title: 'Here Is Where We Found It!',
    icon: "1368298974442034922android-car-home-256-th.png"
});
卫星视图:

var mapOptions = {
    zoom: 20,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.SATELLITE
};

谢谢你帮我做了我需要的事!