我正在使用 rails 3.2.12 中的谷歌地图,我需要通过 infoWindow 更新纬度和经度值以获得位置创建值
如果我点击地图上的任何标记,信息窗口将打开位置名称和两个按钮(“更新”和“删除”)点击更新当前信息窗口应关闭并打开其他信息窗口纬度和经度值显示在文本字段中.
请在下面找到我的代码
单击更新按钮时,应调用以下函数
function getlocation(){
            currentprojectid = $('#currentprojectid').val();
            sid = $('#sessionid').val();
            uid = $('#userid').val()
            var locdata = {
                      userid: ,
                      sessionid: sid,
                      command: 'locationupdate',
                      projectid: currentprojectid
                  };
    markersArray.push(marker);
    currentmarker = marker;
    var infowindow = new google.maps.InfoWindow();
    google.maps.event.addListener(marker, 'click', function(event){
        infowindow.close()
        infowindow.setContent("<p>LocatioName:  <input id="country" type="text" value='+ address +'></p>\
              <p>Longitude:  <input id="lat" type="text" value='+ lattitude +'> </p>\
            <p>Lattitude:  <input id="long" type="text" value='+ longitude +'> </p>\
            <p><input type="button" value="Save" onclick="saveLocation(currentprojectid)"/
             <input type="button" value="Remove" onclick="removeMarker()"/></p>");
        infowindow.open(map, marker);
    });
    currentmarker = marker;
    var marker = new google.maps.Marker({
        map: Gmaps.map.map,
        position: new google.maps.LatLng(lattitude, longitude),
        draggable: true
    });