簡體   English   中英

自定義標記和原始標記都顯示了Google Maps API v3

[英]Both custom and original markers are showing google maps api v3

由於某種原因,我同時顯示了兩個標記。.http://picpaste.com/Screen_Shot_2013-10-02_at_10.55.41_AM-qKfxgyCO.png

整個事情還有一個盒子。 有什么想法為什么會出現這些?

var gmap;

function initialize() {

  var myLat = new google.maps.LatLng(33.991447,-84.09403);

  var mapOptions = {
    zoom: 13,
    center: myLat,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };

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

  var mapIcon = '../fw/img/map-marker-lowres.png';

  var infowindowContent ='<div class="mapbox"><p><strong>The Arena at Gwinnett Center</strong></p>' + '<p>6400 Sugarloaf Pkwy<br>Duluth, GA 30097<br>(770) 813-7500</p>' + '<a href="http://goo.gl/maps/g3cs0">> get driving directions</a></div>';

  var infowindow = new google.maps.InfoWindow({
    content: infowindowContent,
    maxWidth: 250,

  });

  var marker = new google.maps.Marker({
    position: myLat,
    icon: mapIcon,
    map: gmap
  });

      marker.setMap(gmap);
      infowindow.open(gmap,marker);

}

普遍的答案(現在您已經問了正確的問題)是無法以所需的方式設置標准InfoWindow的樣式。 您需要使用第三方庫(例如InfoBubbleInfoBox)或創建自己的自定義InfoWindow替代品。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM