0

以下のコードを使用してユーザーの現在の場所を表示しましたが、ユーザーが自分の場所を変更して、マーク (ピン) が更新された場所ではなく古い場所を表示するようにするにはどうすればよいですか? 設定間隔または毎秒更新を使用しますか?

function handle_geolocation_query(position) {
    $('#map_canvas').gmap('addMarker', {
        'position': new google.maps.LatLng(position.coords.latitude, position.coords.longitude),
        'bounds': true,
        'icon': 'http://google-maps-utility-library-v3.googlecode.com/svn/trunk/geolocationmarker/images/gpsloc.png'
    }).click(function () {
        var a = 'Your current location!';
        $('#map_canvas').gmap('openInfoWindow', {
            'content': '<font color="#2a2a2a" size="4">Location </font><br/><font color="#4a4a4a">Your current location</font>'
        }, this);
    });
}
4

1 に答える 1

0

ハンドラーをマーカーposition_changedまたはdragendイベントのいずれかにバインドしたいようです: https://developers.google.com/maps/documentation/javascript/reference#Marker

于 2013-07-04T12:53:37.997 に答える