0

私はGoogleマップv3に取り組んでいます。ルート マーカーをクリックすると、情報ウィンドウにマップを表示する必要があります。現在、私のコードは対応するマーカーのアドレスを表示しています。 添付の画像は、私が達成しようとしている例です 添付の画像では、マーカー「B」をクリックすると、マーカー「B」を中心にして小さなマップが開きます。

誰か入力があれば教えてください。

ありがとう、シャラス

Below is my code snippet....
waypoints array contains the 2 points 2 display (origin and destination)
// Code starts from here...
var origin = waypoints[0];
var destination = waypoints[1];

var mapOptions = {
        center: new google.maps.LatLng(-25, 133),
        zoom: 4,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };

var map = new google.maps.Map(document.getElementById("mapCanvas"), mapOptions);
var directions = new google.maps.DirectionsService();
directions.route({
                    origin: origin,
                    destination: destination,
                    travelMode: google.maps.DirectionsTravelMode.DRIVING,
                    unitSystem: google.maps.DirectionsUnitSystem.METRIC
                }, function(result, status) {
                    if (status == google.maps.DirectionsStatus.OK) {
                        directionsDisplay = new google.maps.DirectionsRenderer();
                        directionsDisplay.setPanel(document.getElementById     ("drivingDirections"));
                        directionsDisplay.setMap(map);
                        directionsDisplay.setDirections(result);
                    }
                });
4

0 に答える 0