2017-02-09 21 views
-1

私は自分の埋め込み地図にビジネスを含めるようにしていますが、私の人生ではできませんでした! :D埋め込みのGoogleマップでビジネスを表示する方法

これは私がこれまでに得たものである:

<div id="map"></div> 
    <script> 
     function initMap() { 
     var uluru = {lat: 47.7914, lng: 22.87691}; 
     var map = new google.maps.Map(document.getElementById('map'), { 
      zoom: 17, 
      center: uluru 
     }); 
     var marker = new google.maps.Marker({ 
      position: uluru, 
      map: map 
     }); 
     } 
    </script> 
<script async defer 
     src="https://maps.googleapis.com/maps/api/js?key=MYMAPAPIlanguage=hu&callback=initMap"> 
</script> 

と私は、この事業を含める: https://www.google.co.uk/maps/place/Boitor+Orsolya,+Cabinet+Medical+Individual/@47.7914061,22.8747236,17z/data=!3m1!4b1!4m12!1m6!3m5!1s0x473805cc6d46a92d:0x18460661870adb34!2sBoitor+Orsolya,+Cabinet+Medical+Individual!8m2!3d47.7914061!4d22.8769123!3m4!1s0x473805cc6d46a92d:0x18460661870adb34!8m2!3d47.7914061!4d22.8769123

私はオンラインで見つけることができるすべては、のために、私は避けるだろう、アイフレームを使用しています速度。参考として おかげ

が、これは私は、アイフレームなしで達成したいものです。 enter image description here

+1

関連質問ランニングマップを参照するには:[Google MapsのAPIは、iframeのマップ上のような場所のテキストを取得](http://stackoverflow.com/questions/35274487/google-maps-地図上の赤いテキストですが、テキストの白いボックスなどはありません) – geocodezip

答えて

1

だけのようになります。必要なのは、マーカーを追加して地図を中央に置くために、あなたの望む座標を追加することです。ここのような。また、infoWindowを追加して、その場所にあるものをもう少し説明することもできます。

/* 
    * create map 
    */ 
    var map = new google.maps.Map(document.getElementById("map"), { 
    center: new google.maps.LatLng(47.791846, 22.876955), // <--- I found these are the coordinates for the place you mentioned 
    zoom: 17, 
    mapTypeId: google.maps.MapTypeId.ROADMAP 
    }); 

    /* 
    * create infowindow (which will be used by markers) 
    */ 
    var infoWindow = new google.maps.InfoWindow(); 

チェックこのlink

+0

ありがとう。そこには到達していますが、それはまだ私が達成しようとしているものではありません。 :(私は必要なものの参照画像で質問を更新しました。 –

1

使用情報ウィンドウ

var map = new google.maps.Map(element, { 
     center: {lat: lat, lng: lng}, //location of the map center 
     zoom: 6 
    }); 

    var infoWindow = new google.maps.InfoWindow({map: map}); 

    //Location of your object 
    var pos = { 
     lat: lat, 
     lng: lng 
    }; 

    infoWindow.setPosition(pos); 
    infoWindow.setContent('Business'); //Name of the infowindow 

ここでは enter image description here

+0

ありがとうございます。私はバックアップとして使用する、私はここのようなものを達成しようとしている:https://developers.google.com/maps/documentation/embed/guide –

関連する問題